Udp2raw-Tunnel:一款功能強大的UDP隧道工具
今天給大家介紹的是一款功能強大的UDP隧道工具,該工具可以利用原始套接字並通過偽造的TCP/UDP/ICMP流量來幫助研究人員繞過UDP防火牆(或不穩定的UDP環境)。
支援的平臺
Linux主機,需擁有root訪問權,其中包括桌面端Linux、Android手機/平板、OpenWRT路由器或樹莓派。
對於Windows/macOS平臺,我們釋出了一個預安裝了udp2raw的虛擬映象,大家可以直接使用VMware/VirtualBox來載入安裝。虛擬映象會自動獲取IP,其中的dup2raw可以在啟動完成之後立即執行(請確定虛擬機器網路模式設定為橋接)。
功能介紹
傳送/接收UDP資料包(偽造的TCP/ICMP頭)
偽造的TCP/ICMP頭可以幫助我們繞過UDP遮蔽、UDP QOS或其他不正確的UDP NAT行為。除此之外,該工具還支援包含了UDP頭的元資料包、在UDP Header模式下,它跟普通的UDP隧道一樣,你可以直接使用其他功能。
模擬TCP握手
模擬三次握手過程,包括seq和ack_seq。MSS、sackOk、TS、TS_ack、wscale等TCP選項都可以模擬。工具可以保證資料包實時傳遞,在使用OpenVPN時不存在TCP連線問題。
加密、反重放和MITM
-使用AES-128-CBC加密通訊流量。
-通過MD5或CRC32保護資料完整性。
-利用反重放視窗機制防禦重放攻擊,與IPSec和OpenVPN類似。
-手動認證,無中間人攻擊
工具使用
安裝
大家可以從【 ofollow,noindex" target="_blank">這裡 】下載原始碼。
工具執行
假設你的UDP已被遮蔽,假設你的伺服器IP為44.55.66.77,你有一個服務在監聽udp埠7777。
# Runat server side: ./udp2raw_amd64-s -l0.0.0.0:4096 -r 127.0.0.1:7777-a-k "passwd" --raw-mode faketcp # Runat client side ./udp2raw_amd64-c -l0.0.0.0:3333-r44.55.66.77:4096 -a-k "passwd" --raw-mode faketcp
伺服器端輸出
客戶端輸出
此時,已成功通過TCP埠4096在客戶端和伺服器端之間建立了一條經過加密的通訊隧道。在客戶端通過UDP埠3333連線,等同於在伺服器端連線埠7777。
如果你需要在Android端執行的話,請參考【 這篇教程 】
幫助選單
udp2raw-tunnel version:Aug 18 2017 00:29:11 repository:https://github.com/wangyu-/udp2raw-tunnel usage: run as client : ./this_program -c -llocal_listen_ip:local_port -r server_ip:server_port[options] run as server : ./this_program -s -lserver_listen_ip:server_port -r remote_ip:remote_port[options] commonoptions, these options must be same on both side: --raw-mode<string>avaliable values:faketcp(default), udp,icmp -k, --key<string>password to gen symetric key,default:"secret key" --cipher-mode<string>avaliable values:aes128cbc(default),xor, none --auth-mode<string>avaliable values:md5(default), crc32,simple, none -a, --auto-ruleauto add (and delete)iptables rule -g, --gen-rulegenerate iptables rulethen exit --disable-anti-replaydisable anti-replay, notsuggested clientoptions: --source-ip<ip>force source-ip for raw socket --source-port<port>force source-port for raw socket,tcp/udp only thisoption disables port changing while re-connecting otheroptions: --log-level<number>0:never1:fatal2:error3:warn 4:info (default)5:debug6:trace --log-positionenable file name,function name, line number in log --disable-colordisable log color --disable-bpfdisable the kernelspace filter, most time its not necessary unless you suspect there is a bug --sock-buf<number>buf size for socket, >=10 and <=10240,unit:kbyte, default:1024 --seqmode<number>seq increase mode for faketcp: 0:dont increase 1:increase every packet 2:increase randomly,about every 3 packets (default) --lower-level<string>send packet at OSI level 2,format:'if_name#dest_mac_adress' ie:'eth0#00:23:45:67:89:b9'.Beta. -h, --helpprint this helpmessage
IPTABLES規則
該程式可通過元套接字傳送資料包。在FakeTCP模式下,iptables規則會在通訊雙方兩端遮蔽掉Linux核心的TCP資料包處理程序,你可以使用-a選項在工具啟動和退出的時候自動自動新增/刪除iptables規則。除此之外,你還可以使用-g選項手動生成並新增一條iptables規則。
加密模式和認證模式
我們建議大家使用aes128cbc + md5來最大程度地實現安全性。如果你想要在路由器上使用該工具,你可以嘗試xor + simple,在普通情況下這樣足以繞過大部分防火牆的資料報審計功能,不過這種方法無法抵禦其他嚴重攻擊。
Seq模式
FakeTCP模式的工作機制並不是跟真實的TCP連線完全一樣,因為網際網路服務提供商能夠區分模擬TCP流量和真實TCP流量。Seq模式可以幫助我們進一步提升模擬TCP流量的真實程度。
* 參考來源: kitploit ,FB小編Alpha_h4ck編譯,轉載請註明來自FreeBuf.COM