./groidproxy [options] [packages...]| Flag | Description |
|---|---|
-blacklist string |
Comma-separated list of blocked hosts/IPs (.domain.com for wildcards)βDoesn't work on raw redirect |
-d |
Run as daemon |
-dns |
Also redirect DNS (port 53) |
-flush |
Remove all GROID rules |
-global |
Redirect all traffic |
-list |
List current rules |
-local-port int |
Local port for transparent proxy (default: 8123) |
-p string |
Proxy address (host:port, http://host:port, or socks5://host:port) |
-remove string |
Remove rules for specified package |
-save string |
Save traffic to a SQLite database βDoesn't work on raw redirect βCan work without external proxy (default: /data/local/tmp/Groid.db) |
-stats |
Show I/O statistics |
-timeout int |
Connection timeout in seconds (default: 10) |
-tlscert string |
PKCS12 certificate for TLS interception AND CA per-host |
-tlspass string |
Password for PKCS12 certificate |
-v |
Verbose output |
host:portβ Redirect TCP packets (raw redirect) to an external transparent proxyhttp://host:portβ Transparent redirect to an HTTP proxysocks5://host:portβ Transparent redirect to a SOCKS5 proxysave /path/base.dbβ Save all HTTP traffic (app β server) to SQLite file- Can work without upstream proxy
- With TLS (PKCS12) certificate, saves decrypted HTTPS content
./groidproxy -p 192.168.1.100:8888 com.example.app
./groidproxy -p http://192.168.1.100:8080 com.example.app com.android.chrome
./groidproxy -p socks5://192.168.1.100:1080 -global
./groidproxy -p socks5://192.168.1.100:1080 -blacklist "facebook.com,.youtube.com" com.example.app
./groidproxy -p http://192.168.1.100:1080 -save /data/local/tmp/Example.db -tlscert burp.pk12 -tlspass pass com.example.app
./groidproxy -save /data/local/tmp/Example.db -tlscert burp.pk12 -tlspass pass com.example.appUntil Groid v1.2, there're bugs related to how Burp sends an EOF (end-of-file) after each HTTP/1.1 response, this was fixed by version 1.3.0 :). If you encounter any issues while using Groid HTTP mode (-p http://), OPEN a ticket. In v1.2 one of the following configs must be set to use HTTP mode (-p http://):
- Proxy Settings -> Proxy listeners -> Request handling -> Support invisible proxying: ON (Best)
- Proxy Settings -> Miscellaneous: Use keep-alvie for HTTP/1.1 OFF (Worst)
- Proxy Settings -> Miscellaneous: Set response header "Connection: close" ON
First run will sync mod dependencies and build for AARCH64:
/build.sh
Building...
Done :)
Build and push ELF to Android /data/local/tmp using ADB:
/build.sh push
Building...
Done :)
groidproxy: 1 file pushed, 0 skipped. 255.0 MB/s (8323224 bytes in 0.031s)
Pushed to /data/local/tmp
If need to resync mod dependencies:
/build.sh update
[go mod tidy output :P]
Groid is a transparent proxy for Android that intercepts and redirects application traffic through iptables, with support for TLS capture and SQLite database storage.
βββββββββββββββ iptables ββββββββββββββββββββ TCP βββββββββββββββ
β Android App β βββββββββββββββΊβ DNAT Redirection β βββββββββΊ β Ext. Proxy β
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
β β
β Raw TCP Passthrough β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Features:
- β Direct redirection via iptables DNAT
- β Zero overhead - no local processing
- β Compatible with any transparent proxy
- β No data capture capabilities
βββββββββββββββ iptables ββββββββββββββββββββ HTTP βββββββββββββββ
β Android App β βββββββββββββββΊβ Local Proxy β βββββββββββΊ β HTTP Proxy β
βββββββββββββββ β (Port 8123) β CONNECT βββββββββββββββ
β ββββββββββββββββββββ β
β β β
β Transparent TCP β HTTP Protocol β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β
ββββββββΌβββββββ
β HTTP Parser β
β & Relay β
βββββββββββββββ
Data Flow:
- App β TCP connection β iptables β redirect to
127.0.0.1:8123 - Local Proxy β reads original destination β creates HTTP CONNECT to external proxy
- HTTP Proxy β establishes tunnel β Target Server
- Bidirectional relay between app and server through proxy chain
βββββββββββββββ iptables ββββββββββββββββββββ SOCKS5 βββββββββββββββ
β Android App β βββββββββββββββΊβ Local Proxy β βββββββββββΊ β SOCKS5 Proxyβ
βββββββββββββββ β (Port 8123) β Handshake βββββββββββββββ
β ββββββββββββββββββββ β
β β β
β Transparent TCP β SOCKS5 Protocol β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β
ββββββββΌβββββββ
β SOCKS5 β
β Handler β
βββββββββββββββ
Protocol Flow:
- App β TCP connection β iptables β redirect to
127.0.0.1:8123 - Local Proxy β SOCKS5 handshake (version + auth) β SOCKS5 Proxy
- Connection request β target host:port β Target Server
- Bidirectional relay between app and server through SOCKS5 tunnel
βββββββββββββββ iptables ββββββββββββββββββββ Direct βββββββββββββββ
β Android App β βββββββββββββββΊβ TLS Interceptor β ββββββββββΊ β Target β
βββββββββββββββ β (Port 8123) β TLS β Server β
β ββββββββββββββββββββ βββββββββββββββ
β β
β TLS Tunnel 1 β TLS Tunnel 2
ββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β
βββββββββΌββββββββββ
β TLS Interceptor β
β βββββββββββββββ β
β β Certificate β β
β β Generator β β
β βββββββββββββββ β
β βββββββββββββββ β
β β HTTPPairer β β
β β FIFO Queue β β
β βββββββββββββββ β
β βββββββββββββββ β
β β SQLite β β
β β Worker β β
β βββββββββββββββ β
βββββββββββββββββββ
βββββββββββββββ iptables ββββββββββββββββββββ HTTP βββββββββββββββ βββββββββββββββ
β Android App β βββββββββββββββΊβ TLS Interceptor β βββββββββββΊ β HTTP Proxy ββββΊβ Target β
βββββββββββββββ β (Port 8123) β CONNECT βββββββββββββββ β Server β
β ββββββββββββββββββββ βββββββββββββββ
β β
β TLS Tunnel 1 β TLS Tunnel 2
ββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββΌββββββββββ
β TLS Interceptor β
β βββββββββββββββ β
β β SNI Extract β β
β β & Cert Gen β β
β βββββββββββββββ β
β βββββββββββββββ β
β β HTTPPairer β β
β β Req/Resp β β
β β Correlation β β
β βββββββββββββββ β
β βββββββββββββββ β
β β SQLite DB β β
β β Async Save β β
β βββββββββββββββ β
βββββββββββββββββββ
βββββββββββββββββββ ClientHello βββββββββββββββββββ
β Android App β ββββββββββββββββββΊ β TLS Proxy β
βββββββββββββββββββ βββββββββββββββββββ
β
ββββββββΌβββββββ
β Extract SNI β
βgateway.com β
ββββββββ¬βββββββ
β
βββββββββββΌββββββββββ
β Generate Cert β
β CN: gateway.com β
β Signed by Root CA β
βββββββββββ¬ββββββββββ
β
βββββββββββββββββββ ServerHello + Cert β
β Android App β βββββββββββββββββββββββββββ
βββββββββββββββββββ
Client Goroutine: Server Goroutine:
βββββββββββββββββββ βββββββββββββββββββ
β Read from App β β Read from Srv β
β β β β β β
β Relay to Server β β Relay to App β
β β β β β β
β Buffer Request β β Buffer Response β
β β β β β β
β Complete HTTP? β β Complete HTTP? β
β β β β β β
β Add to Queue β β Match & Pair β
βββββββββββββββββββ βββββββββββββββββββ
β β
βββββββββββββββ βββββββββββββββββ
βΌ βΌ
βββββββββββββββββββ
β HTTPPairer β
β βββββββββββββββ β
β β Pending β β
β β Requests β β
β β FIFO Queue β β
β βββββββββββββββ β
β βββββββββββββββ β
β β Save Worker β β
β β Channel β β
β βββββββββββββββ β
βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β SQLite Database β
β βββββββββββββββ β
β β requests β β
β β βββββββββββ β β
β β βtimestampβ β β
β β β method β β β
β β β url β β β
β β β request β β β
β β βresponse β β β
β β βββββββββββ β β
β βββββββββββββββ β
βββββββββββββββββββ
Priority 1: Data Relay (Never Blocks)
βββββββββββββββββββββββββββββββββββββββ
β client.Read() β server.Write() β
β server.Read() β client.Write() β
βββββββββββββββββββββββββββββββββββββββ
β
Priority 2: Capture Processing
βββββββββββββββββββββββββββββββββββββββ
β Buffer accumulation β
β HTTP message parsing β
β Request/Response pairing β
βββββββββββββββββββββββββββββββββββββββ
β
Priority 3: Database Storage
βββββββββββββββββββββββββββββββββββββββ
β Async worker goroutines β
β Non-blocking channel operations β
β SQLite batch operations β
βββββββββββββββββββββββββββββββββββββββ
- Memory: Bounded buffers with automatic cleanup
- Goroutines: One per connection + async workers
- Database: Async writes with channel buffering
- Timeouts: 30-second orphan request cleanup