|
20 | 20 | - [Transparent proxy](#transparent-proxy) |
21 | 21 | - [redirect (via NAT and SO_ORIGINAL_DST)](#redirect-via-nat-and-so_original_dst) |
22 | 22 | - [tproxy (via MANGLE and IP_TRANSPARENT)](#tproxy-via-mangle-and-ip_transparent) |
| 23 | + - [UDP support](#udp-support) |
23 | 24 | - [ARP spoofing](#arp-spoofing) |
24 | 25 | - [Traffic sniffing](#traffic-sniffing) |
25 | 26 | - [JSON format](#json-format) |
@@ -62,8 +63,11 @@ Specify http server in proxy configuration of Postman |
62 | 63 | - **Transparent proxy**\ |
63 | 64 | Supports `redirect` (SO_ORIGINAL_DST) and `tproxy` (IP_TRANSPARENT) modes |
64 | 65 |
|
| 66 | +- **TCP and UDP Transparent proxy**\ |
| 67 | + `tproxy` (IP_TRANSPARENT) handles TCP and UDP traffic |
| 68 | + |
65 | 69 | - **Traffic sniffing**\ |
66 | | - Proxy is able to parse HTTP headers and TLS handshake metadata |
| 70 | + Proxy is able to parse HTTP headers, TLS handshake, DNS messages and more |
67 | 71 |
|
68 | 72 | - **ARP spoofing**\ |
69 | 73 | Proxy entire subnets with ARP spoofing approach |
@@ -101,7 +105,7 @@ You can download the binary for your platform from [Releases](https://github.com |
101 | 105 | Example: |
102 | 106 |
|
103 | 107 | ```shell |
104 | | -GOHPTS_RELEASE=v1.9.4; wget -v https://github.com/shadowy-pycoder/go-http-proxy-to-socks/releases/download/$GOHPTS_RELEASE/gohpts-$GOHPTS_RELEASE-linux-amd64.tar.gz -O gohpts && tar xvzf gohpts && mv -f gohpts-$GOHPTS_RELEASE-linux-amd64 gohpts && ./gohpts -h |
| 108 | +GOHPTS_RELEASE=v2.0.0; wget -v https://github.com/shadowy-pycoder/go-http-proxy-to-socks/releases/download/$GOHPTS_RELEASE/gohpts-$GOHPTS_RELEASE-linux-amd64.tar.gz -O gohpts && tar xvzf gohpts && mv -f gohpts-$GOHPTS_RELEASE-linux-amd64 gohpts && ./gohpts -h |
105 | 109 | ``` |
106 | 110 |
|
107 | 111 | Alternatively, you can install it using `go install` command (requires Go [1.24](https://go.dev/doc/install) or later): |
@@ -168,6 +172,7 @@ Options: |
168 | 172 | TProxy: |
169 | 173 | -t Address of transparent proxy server (it starts along with HTTP proxy server) |
170 | 174 | -T Address of transparent proxy server (no HTTP) |
| 175 | + -Tu Address of transparent UDP proxy server |
171 | 176 | -M Transparent proxy mode: (redirect, tproxy) |
172 | 177 | -auto Automatically setup iptables for transparent proxy (requires elevated privileges) |
173 | 178 | -arpspoof Enable ARP spoof proxy for selected targets (Example: "targets 10.0.0.1,10.0.0.5-10,192.168.1.*,192.168.10.0/24;fullduplex false;debug true") |
@@ -521,6 +526,30 @@ sudo bettercap -eval "net.probe on;net.recon on;set arp.spoof.fullduplex true;ar |
521 | 526 |
|
522 | 527 | Check proxy logs for traffic from other devices from your LAN |
523 | 528 |
|
| 529 | +### UDP support |
| 530 | +
|
| 531 | +`GoHPTS` has UDP support that can be enabled in `tproxy` mode. For this setup to work you need to connect to a socks5 server capable of serving UDP connections (`UDP ASSOCIATE`). For example, you can use [https://github.com/wzshiming/socks5](https://github.com/wzshiming/socks5) to deploy UDP capable UDP server on some remote or local machine. Once you have the server to connect to, run the following command: |
| 532 | +
|
| 533 | +```shell |
| 534 | +sudo env PATH=$PATH gohpts -s remote -Tu :8989 -M tproxy -auto -mark 100 -d |
| 535 | +``` |
| 536 | +
|
| 537 | +This command will configure your operating system and setup server on `0.0.0.0:8989` address. |
| 538 | +
|
| 539 | +To test it locally, you can combine UDP transparent proxy with `-arpspoof` flag. For example: |
| 540 | +
|
| 541 | +1. Setup VM on your system with any Linux distributive that supports `tproxy` (Kali Linux, for instance). |
| 542 | +2. Enable `Bridged` network so that VM could access your host machine. |
| 543 | +3. Move `gohpts` binary to VM (via `ssh`, for instance) or build it there in case of different OS/arch. |
| 544 | +4. On your VM run the following command: |
| 545 | +
|
| 546 | +```shell |
| 547 | +# Do not forget to replace <socks5 server> and <your host> with actual addresses |
| 548 | +sudo ./gohpts -s <socks5 server> -T 8888 -Tu :8989 -M tproxy -sniff -body -auto -mark 100 -d -arpspoof "targets <your host>;fullduplex true;debug false" |
| 549 | +``` |
| 550 | +
|
| 551 | +4. Check connection on your host machine, the traffic should go through Kali machine. |
| 552 | +
|
524 | 553 | ## Traffic sniffing |
525 | 554 |
|
526 | 555 | [[Back]](#table-of-contents) |
|
0 commit comments