|
25 | 25 | - [UDP support](#udp-support) |
26 | 26 | - [Android support](#android-support) |
27 | 27 | - [IPv6 support](#ipv6-support) |
| 28 | + - [NDP spoofing](#ndp-spoofing) |
28 | 29 | - [Traffic sniffing](#traffic-sniffing) |
29 | 30 | - [JSON format](#json-format) |
30 | 31 | - [Colored format](#colored-format) |
@@ -75,6 +76,9 @@ Specify http server in proxy configuration of Postman |
75 | 76 | - **ARP spoofing**\ |
76 | 77 | Proxy entire subnets with ARP spoofing approach |
77 | 78 |
|
| 79 | +- **NDP spoofing**\ |
| 80 | + Proxy IPv6 connections using Router/Neighbor Advertisement and RDNSS injections. |
| 81 | + |
78 | 82 | - **DNS Leak Protection**\ |
79 | 83 | DNS resolution occurs on SOCKS5 server side. |
80 | 84 |
|
@@ -108,7 +112,7 @@ You can download the binary for your platform from [Releases](https://github.com |
108 | 112 | Example: |
109 | 113 |
|
110 | 114 | ```shell |
111 | | -GOHPTS_RELEASE=v1.12.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 |
| 115 | +GOHPTS_RELEASE=v1.12.1; 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 |
112 | 116 | ``` |
113 | 117 |
|
114 | 118 | Alternatively, you can install it using `go install` command (requires Go [1.26](https://go.dev/doc/install) or later): |
@@ -184,8 +188,10 @@ OPTIONS: |
184 | 188 | -wu Number of instances of transparent UDP proxy server (Default: number of CPU cores) |
185 | 189 | -auto Automatically setup iptables for transparent proxy (requires elevated privileges) |
186 | 190 | -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") |
| 191 | + -ndpspoof Enable NDP spoof proxy for selected targets (Example: "ra true;na true;targets fe80::3a1c:7bff:fe22:91a4;fullduplex false;debug true") |
187 | 192 | -mark Set mark for each packet sent through transparent proxy (Default: redirect 0, tproxy 100) |
188 | 193 | -P Comma separated list of ports to ignore when proxying traffic (Example: "22,80,443,9092") |
| 194 | + -dump Dump iptables rules and other system settings generated by -auto flag |
189 | 195 | ``` |
190 | 196 |
|
191 | 197 | ### Configuration via CLI flags |
@@ -541,6 +547,8 @@ sudo bettercap -eval "net.probe on;net.recon on;set arp.spoof.fullduplex true;ar |
541 | 547 |
|
542 | 548 | Check proxy logs for traffic from other devices from your LAN |
543 | 549 |
|
| 550 | +For more information about arpspoof options see `gohpts -h` and [https://github.com/shadowy-pycoder/arpspoof](https://github.com/shadowy-pycoder/arpspoof) |
| 551 | +
|
544 | 552 | ### UDP support |
545 | 553 |
|
546 | 554 | [[Back]](#table-of-contents) |
@@ -614,6 +622,63 @@ sudo ./gohpts -T 8888 -Tu 8889 -M tproxy -sniff -body -auto -d -6 |
614 | 622 |
|
615 | 623 | 3. Visit any website on your virtual machine and see traffic in proxy logs |
616 | 624 |
|
| 625 | +### NDP spoofing |
| 626 | +
|
| 627 | +[[Back]](#table-of-contents) |
| 628 | +
|
| 629 | +`GoHPTS` has in-built functionality to perform NDP spoofing in IPv6 networks with Router Advertisement (RA) and Neighbor Advertisement (NA) packets. It also includes RDNSS option in RA packets to put host as a IPv6 nameserver for affected clients. When combined with transparent proxy mode (TCP/UDP), NDP spoofing allows `gohpts` to proxy traffic for clients in the local networks. As is the case with [ARP spoofing](#arp-spoofing), you can set ndp spoof options with single `-ndpspoof` flag: |
| 630 | +
|
| 631 | +Example: |
| 632 | +
|
| 633 | +```shell |
| 634 | +sudo env PATH=$PATH gohpts -d -T 8888 -M tproxy -sniff -body -auto -mark 100 -ndpspoof "ra true;na true;targets fe80::3a1c:7bff:fe22:91a4;fullduplex false;debug true" |
| 635 | +``` |
| 636 | +
|
| 637 | +For more information about ndpspoof options see `gohpts -h` and [https://github.com/shadowy-pycoder/ndpspoof](https://github.com/shadowy-pycoder/ndpspoof) |
| 638 | +
|
| 639 | +Plese note that some options like `rdnss`, `gateway`, `interface` are set automatically by `gohpts` itself to properly function as a proxy. |
| 640 | +
|
| 641 | +Since `gohpts` proxies all connections via upstream SOCKS5 server, you need to have a working server with IPv4/IPv6 and TCP/UDP support. Obviously, a remote machine (e.g. VPS) should also have IPv6 connectivity working. Needless to say, the machine on which `gohpts` is installed should be part of network with IPv6 support. |
| 642 | +
|
| 643 | +Example setup for NDP spoofing to work correctly: |
| 644 | +
|
| 645 | +1. Connect to VPS |
| 646 | +
|
| 647 | +```shell |
| 648 | +ssh remote@203.0.113.10 |
| 649 | +``` |
| 650 | +
|
| 651 | +2. Install dependencies |
| 652 | +
|
| 653 | +```shell |
| 654 | +GO_VERSION=$(curl 'https://go.dev/VERSION?m=text' | head -n1) |
| 655 | +cd ~/Downloads/ && wget https://go.dev/dl/$GO_VERSION.linux-amd64.tar.gz |
| 656 | +sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $GO_VERSION.linux-amd64.tar.gz |
| 657 | +``` |
| 658 | +
|
| 659 | +3. Setup SOCKS5 server (make sure firewall rules do not block used ports) |
| 660 | +
|
| 661 | +```shell |
| 662 | +git clone https://github.com/wzshiming/socks5.git && cd socks5 |
| 663 | +go build -o ./bin/socks5_server ./cmd/socks5/*.go |
| 664 | +./bin/socks5_server -a :3000 |
| 665 | +``` |
| 666 | +
|
| 667 | +4. Go back to your host machine and install `gohpts` (see [Installation](#installation)) |
| 668 | +
|
| 669 | +5. Run `gohtps`: |
| 670 | +
|
| 671 | +```shell |
| 672 | +sudo env PATH=$PATH gohpts -s 203.0.113.10:3000 -T 8888 -Tu 8889 -M tproxy -sniff -body -auto -mark 100 -arpspoof "fullduplex true;debug true" -ndpspoof "ra true;debug true |
| 673 | +" -6 -d |
| 674 | +``` |
| 675 | +
|
| 676 | +6. Get another device (phone, tablet, etc) and connect it to the same network. Try to access Internet and check if some traffic appears on your host machine. Check public IP address with some online tools (it should match your VPS address `203.0.113.10` in this case or global IPv6 address) |
| 677 | +
|
| 678 | +7. Stop proxy by hitting Ctrl+C |
| 679 | +
|
| 680 | +8. Profit! |
| 681 | +
|
617 | 682 | ## Traffic sniffing |
618 | 683 |
|
619 | 684 | [[Back]](#table-of-contents) |
@@ -800,6 +865,12 @@ Learn more about transparent proxies by visiting the following links: |
800 | 865 | - [https://github.com/semigodking/redsocks](https://github.com/semigodking/redsocks) |
801 | 866 | - [https://github.com/ginuerzh/gost](https://github.com/ginuerzh/gost) |
802 | 867 |
|
| 868 | +IPv4/IPv6 network security: |
| 869 | +
|
| 870 | +- [https://caster0x00.com/legless/](https://caster0x00.com/legless/) |
| 871 | +- [https://caster0x00.com/intercept/](https://caster0x00.com/intercept/) |
| 872 | +- [https://www.prosec-networks.com/en/blog/ipv6-mitm/](https://www.prosec-networks.com/en/blog/ipv6-mitm/) |
| 873 | +
|
803 | 874 | ## Contributing |
804 | 875 |
|
805 | 876 | [[Back]](#table-of-contents) |
|
0 commit comments