tcp_obfuscator

所属分类:网络编程
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-11-27 02:39:22
上 传 者sh-1993
说明:  tcp混淆器
(tcp obfuscator)

文件列表:
Cargo.toml (411, 2023-11-02)
pcaps/ (0, 2023-11-02)
pcaps/ens160.pcap (5963, 2023-11-02)
pcaps/tun.pcap (11063, 2023-11-02)
src/ (0, 2023-11-02)
src/main.rs (14593, 2023-11-02)
wireshark.png (1960647, 2023-11-02)

## tun\_obfuscator hide your tcp stream from wireshark! ## Note 1. Don't use this project in a VM that NATed by OSX (bridged vm is ok). Seems the OSX kernel will reassemble those obfuscated segments. 1. because osx will drops ooo tcp segments 2. check [this link](https://github.com/canonical/multipass/issues/3038#issuecomment-1665807689) 2. check [route_localnet](https://github.com/kubernetes/kubernetes/issues/90259) if you want to use this project to mirror from/to 127.0.0.0/8 ## Let's try 1. which servers you want to connect to? ``` $ ping www.baidu.com PING www.a.shifen.com (180.101.50.188) 56(84) bytes of data. ... ``` 2. what's your local public ethernet interface + ip? ``` $ ip addr 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens160: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:83:1c:a4 brd ff:ff:ff:ff:ff:ff altname enp2s0 inet 192.168.43.83/24 brd 192.168.43.255 scope global dynamic noprefixroute ens160 valid_lft 2636sec preferred_lft 2636sec inet6 fe80::b254:7af9:54a7:f7e1/64 scope link noprefixroute valid_lft forever preferred_lft forever ``` 3. start a terminal and run the obfuscator: ``` sudo RUST_LOG=trace ./target/debug/tun_obfuscator --dst 180.101.50.0/24 --dst-virtual 1.1.1.0/24 --src 192.168.43.0/24 --src-virtual 2.2.2.0/24 --interface lima0 --public-ip 192.168.43.194 --gateway 192.168.43.1 2023-10-26T12:21:10.897437Z INFO tun_obfuscator: creating tun... 2023-10-26T12:21:10.897660Z INFO tun_obfuscator: tun created, name: obfuscator_tun 2023-10-26T12:21:10.897668Z INFO tun_obfuscator: executing `sysctl -w net.ipv4.ip_forward=1` net.ipv4.ip_forward = 1 2023-10-26T12:21:10.899440Z INFO tun_obfuscator: executing `ip addr add 1.1.0.0/16 dev obfuscator_tun` 2023-10-26T12:21:10.900488Z INFO tun_obfuscator: executing `iptables -t nat -D POSTROUTING -o obfuscator_tun -j MASQUERADE` iptables: Bad rule (does a matching rule exist in that chain?). 2023-10-26T12:21:10.912266Z INFO tun_obfuscator: executing `iptables -t nat -A POSTROUTING -o obfuscator_tun -j MASQUERADE` 2023-10-26T12:21:10.917233Z INFO tun_obfuscator: executing `sudo iptables -t nat -D POSTROUTING -s 1.1.0.0/16 -o ens160 -j SNAT --to 192.168.43.83` iptables: Bad rule (does a matching rule exist in that chain?). 2023-10-26T12:21:10.927210Z INFO tun_obfuscator: executing `sudo iptables -t nat -A POSTROUTING -s 1.1.0.0/16 -o ens160 -j SNAT --to 192.168.43.83` 2023-10-26T12:21:10.935511Z INFO tun_obfuscator: setup tun and iptables done. 2023-10-26T12:21:10.935528Z INFO tun_obfuscator: running.. ``` 4. start a new terminal and access via mirror ip: ``` $ curl http://1.1.50.188 -v -H Host:www.baidu.com * Trying 1.1.50.188:80... * Connected to 1.1.50.188 (1.1.50.188) port 80 (#0) > GET / HTTP/1.1 > Host:www.baidu.com > User-Agent: curl/7.81.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Accept-Ranges: bytes < Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform < Connection: keep-alive < Content-Length: 2381 < Content-Type: text/html < Date: Thu, 26 Oct 2023 12:22:48 GMT < Etag: "588604c8-94d" < Last-Modified: Mon, 23 Jan 2017 13:27:36 GMT < Pragma: no-cache < Server: bfe/1.0.8.18 < Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/ < 百度一下,你就知道

关于百度 About Baidu

©2017 Baidu 使用百度前必读  意见反馈 京ICP证030173号 

* Connection #0 to host 1.1.50.188 left intact ``` 5. let's check the tcp stream in wireshark ![wireshark](./wireshark.png)

近期下载者

相关文件


收藏者