National Cyber Warfare Foundation (NCWF)login

UA3F for transparent HTTP(S) traffic rewriting at the network edge


0 user ratings
2026-10-29 03:32:14
milo
Red Team (CNA)
"UA3F

UA3F is a Go-based rewriting proxy that transparently modifies HTTP(S) headers and bodies in authorized network administration, lab, and defensive research contexts.








ToolSunBK201/UA3F — an HTTP(S) rewriting proxy supporting HTTP, SOCKS5, TPROXY, REDIRECT, and NFQUEUE service modes
CategoryTransparent proxy / HTTP(S) traffic rewriting (Go, netfilter)
Primary UseRule-based rewriting of HTTP(S) headers and bodies — most notably User-Agent — on routers and lab gateways running OpenWrt, with optional HTTPS MitM decryption
Safe UseEducational and documentary analysis for authorized professionals: network administrators operating their own infrastructure, lab environments, and defensive researchers studying DPI and traffic-manipulation behavior
Telemetry NoteUA3F writes logs to /var/log/ua3f.log and exposes an optional API server for status queries; its rewriting visibly alters User-Agent and header fingerprints, and its Desync fragmentation produces detectable packet-level anomalies that defenders can monitor

UA3F is an HTTP(S) rewriting proxy written in Go that positions itself as the successor-in-spirit to well-known User-Agent rewriters like Zxilly/UA2F. At roughly 690 stars and licensed under GPL-3.0, it is an actively maintained project with a CodeQL scanning workflow in its CI pipeline, which signals at least baseline hygiene around code quality. The core idea is simple and powerful: sit in the path of HTTP(S) traffic — whether as an explicit proxy or as a transparent interception point — and rewrite request and response content on the fly according to a flexible rule system. The canonical use case, inherited from its lineage, is normalizing User-Agent headers, but the engine is far more general than that single trick.


Architecturally, UA3F is interesting because it operates at three different layers of the stack depending on how you deploy it. At the application layer it can run as a classic HTTP or SOCKS5 proxy. At the transport layer it can intercept traffic via netfilter TPROXY or REDIRECT targets on Linux routers. At the network layer it can consume packets through NFQUEUE, inheriting the interception model that made UA2F popular on OpenWrt devices. This tiered design means the same rewriting core can be embedded in anything from a Docker container on a workstation to an edge router flashing packets for an entire campus network — a scope the README's credits and Telegram community (crack_campus_network) make fairly explicit.


The feature set goes well beyond header munging. The README documents bidirectional rewriting of both headers and bodies for HTTP(S) requests and responses, URL redirection via three distinct mechanisms — REDIRECT-302, REDIRECT-307, and REDIRECT-HEADER (the last being a transparent rewrite the client never perceives) — and full HTTPS MitM decryption for rewriting encrypted flows. There is also a real-time statistics panel for monitoring how much traffic has actually been modified, which is a thoughtful operational touch: when you are rewriting production traffic on your own infrastructure, you want visibility into what the engine touched.


The rule system is where UA3F shows its maturity. Three rewrite strategies govern global behavior: GLOBAL rewrites everything with a fixed User-Agent (default FFF), DIRECT passes traffic through untouched, and RULE applies a per-match rule engine. Matching supports ten rule types ranging from DOMAIN, DOMAIN-SUFFIX, DOMAIN-KEYWORD, and DOMAIN-SET through IP-CIDR, SRC-IP, DST-PORT, and header- and URL-level regex with HEADER-KEYWORD, HEADER-REGEX, and URL-REGEX. Actions include DIRECT, DELETE, ADD, REPLACE, REPLACE-REGEX, REJECT, and DROP — a vocabulary that reads more like a mini firewall policy language than a simple UA rewriter. For authorized administrators, this granularity makes UA3F usable as a lightweight policy enforcement point for egress header hygiene.


One of the more technically ambitious corners of the project is its L3 rewriting capability: UA3F can modify TTL, IPID, TCP timestamps, and the TCP initial window. These are fingerprint-level knobs usually associated with OS-impersonation and TCP fingerprint randomization research. Combined with the documented Desync functionality — packet fragmentation and out-of-order emission intended to confuse deep packet inspection — UA3F straddles the line between network administration tool and DPI-evasion research instrument. For defenders, that duality is precisely why the tool deserves study: understanding how fragmentation-based DPI desync behaves is directly useful for building better detection, and the project's dedicated documentation pages make it a usable reference implementation.


Performance is addressed head-on with support for eBPF traffic offload to accelerate forwarding, which matters when the proxy is inline on a router handling aggregate traffic. The README also documents extensive OpenWrt integration: prebuilt opkg and apk packages for common architectures, a LuCI web interface under Services -> UA3F, and instructions for compiling it directly into an OpenWrt build tree on the openwrt-24.10 branch. Compatibility notes for coexisting with Clash in both Fake-IP and Redir-Host modes, and credits referencing Dreamacro/clash and MetaCubeX/mihomo, indicate the tool is designed to run alongside existing proxy stacks rather than replace them.


Operationally, the binary exposes a clean CLI surface. Flags include -c for a custom config.yaml, -g to generate a template config, -m to select service mode (HTTP, SOCKS5, TPROXY, REDIRECT; default SOCKS5), -b and -p for bind address and port (defaults 127.0.0.1:1080), -l for log level with output landing in /var/log/ua3f.log, -f for the replacement User-Agent, -r and -s for regex matching and partial replacement, and -z for supplying rewrite rules as a JSON string under the RULE strategy. A built-in API server, enabled with --api-server , exposes runtime status and configuration control — useful for automation and monitoring in a managed deployment.


Installation is straightforward for a Go project. A typical Docker invocation is docker run -p 1080:1080 sunbk201/ua3f -f FFF to run it as a SOCKS5 rewriter, and building from source follows the standard pattern of git clone https://github.com/SunBK201/UA3F.git followed by go build -o ua3f main.go. The README thoughtfully recommends running the service as an unprivileged user on OpenWrt (sudo -u nobody /usr/bin/ua3f), which reflects a security-conscious default posture for an edge-resident service.


From a defensive perspective, UA3F is worth understanding even if you never deploy it. Any tool that rewrites User-Agent values, mutates TCP/IP fingerprint parameters, and fragments streams to defeat DPI will produce observable artifacts: implausibly uniform UA strings across diverse clients, header anomalies under HTTPS inspection, and fragmentation patterns that stand out in flow analysis. Blue teams operating enterprise DPI or NDR tooling can use UA3F in a lab to generate exactly these artifacts and tune detections against them — a fully authorized and genuinely useful application of the project.


The main caveats for professionals are the obvious ones. HTTPS MitM functionality implies certificate interception, which on any real network requires explicit authorization, a managed trust anchor, and clear governance about what is decrypted and logged. The NFQUEUE mode has the lowest compatibility of the five service modes per the README's own table, so transport-layer modes are the more reliable production choice. Documentation lives at the project's dedicated site, including a configuration guide, config examples, an API reference, and the Desync overview — the README is dense but the external docs fill the gaps. As a piece of network-engineering craftsmanship in Go, UA3F is a strong example of how far a transparent rewriting proxy can be pushed.



Official project repository for SunBK201/UA3F.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/10/ua3f-for-transparent-https-traffic.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.