一張圖告訴你,如何構(gòu)建內(nèi)網(wǎng)隱蔽通道
本文轉(zhuǎn)載自微信公眾號「Bypass」,作者Bypass。轉(zhuǎn)載本文請聯(lián)系Bypass公眾號。
構(gòu)建內(nèi)網(wǎng)隱蔽通道,從而突破各種安全策略限制,實(shí)現(xiàn)對目標(biāo)服務(wù)器的完美控制。
當(dāng)我們從外網(wǎng)成功獲得攻擊點(diǎn)的時(shí)候,通過反彈shell、端口轉(zhuǎn)發(fā)、內(nèi)網(wǎng)穿透等技巧,來進(jìn)一步入侵內(nèi)網(wǎng)服務(wù)器。當(dāng)我們?nèi)〉脙?nèi)網(wǎng)目標(biāo)服務(wù)器的控制權(quán)限,通過隧道技術(shù)繞過網(wǎng)絡(luò)限制,實(shí)現(xiàn)隱蔽C2服務(wù)器的通信。
在這里,我梳理了一張腦圖,將構(gòu)建內(nèi)網(wǎng)隱蔽通道分為突破訪問限制和隱藏通信隧道技術(shù)。在不同的場景下進(jìn)行應(yīng)用,突破限制訪問內(nèi)網(wǎng)服務(wù)器,利用隧道技術(shù)實(shí)現(xiàn)C2通信。
突破訪問限制方式
反彈shell
- 一句話反彈shell的各種方式
- 1、系統(tǒng)自帶命令:bash反彈、awk反彈、telnet反彈、socat反彈、powershell反彈、nc反彈等
- 2、編程語言實(shí)現(xiàn):python反彈、php反彈、perl反彈、ruby反彈、lua反彈等
- 3、滲透測試框架:MSF、Cobalt strike、Empire、nishang等
端口轉(zhuǎn)發(fā)
- 端口轉(zhuǎn)發(fā)的幾種常用方法
- 1、系統(tǒng)自帶命令:ssh端口轉(zhuǎn)發(fā)、iptables端口轉(zhuǎn)發(fā)、firewall端口轉(zhuǎn)發(fā)、rinetd端口轉(zhuǎn)發(fā)、netsh端口轉(zhuǎn)發(fā)、socat端口轉(zhuǎn)發(fā)
- 2、第三方小工具:lcx端口轉(zhuǎn)發(fā)、ncat端口轉(zhuǎn)發(fā)、portmap端口轉(zhuǎn)發(fā)
內(nèi)網(wǎng)穿透工具
- 內(nèi)網(wǎng)穿透工具,提供http,tcp,udp全隧道穿透
- 1、ngrok:https://ngrok.com
- 2、frp:https://github.com/fatedier/frp
- 3、Sunny-Ngrok:https://www.ngrok.cc
- 4、Natapp:https://natapp.cn
遠(yuǎn)程控制軟件
- 常見的遠(yuǎn)程控制軟件
- 1、TeamViewer:https://www.teamviewer.cn/cn/
- 2、向日葵:https://sunlogin.oray.com/
隱藏通信隧道技術(shù)
ICMP隧道
- 將 IP 流量封裝進(jìn) IMCP 的 ping 數(shù)據(jù)包進(jìn)行傳輸
- 隧道工具:icmptunnel、ptunnel、icmpsh、powershell icmp等
- 1、icmptunnel:https://github.com/jamesbarlow/icmptunnel
- 2、ptunnel:http://www.cs.uit.no/~daniels/PingTunnel/
- 3、icmpsh:https://github.com/inquisb/icmpsh
- 4、Powershell-ICMP:https://github.com/api0cradle/Powershell-ICMP
IPv6 隧道
- 通過 IPv4 隧道傳送 IPv6 數(shù)據(jù)報(bào)文
- 隧道工具:socat、6tunnel、nt6tunnel等
- 1、socat:http://www.dest-unreach.org/socat/download/
- 2、6tunnel:https://github.com/wojtekka/6tunnel
UDP隧道
- 將UDP轉(zhuǎn)TCP發(fā)送數(shù)據(jù)
- UDP隧道工具,如Udp2raw-Tunnel、udptunnel等
- 1、Udp2raw-Tunnel:https://github.com/wangyu-/udp2raw-tunnel
Socks隧道
- 全能代理,支持多種協(xié)議,包括http、ftp請求及其它類型的請求。
- socks代理工具:
- 1、sSocks:http://sourceforge.net/projects/ssocks
- 2、Earthworm:https://github.com/rootkiter/EarthWorm
- 3、Shadowsocks:https://Shadowsocks.org
- socks代理鏈工具:
- 1、SocksCap64:http://www.sockscap64.com
- 2、Proxifier:https://www.proxifier.com
- 3、ProxyChains:http://proxychains.sourceforge.net
HTTP(S) 隧道
- 把所有要傳送的數(shù)據(jù)全部封裝到HTTP協(xié)議里進(jìn)行傳送
- 隧道工具:Kali自帶的HTTPTunnel、reDuh、reGeorg、Tunna等
- 1、reDuh:https://github.com/sensepost/reDuh
- 2、reGeorg:https://github.com/sensepost/reGeorg
- 3、ABPTTS :https://github.com/nccgroup/ABPTTS
- 4、Tunna:https://github.com/SECFORCE/Tunna
- 5、node-http-tunnel:https://github.com/johncant/node-http-tunnel
SSH隧道
- 通過SSH協(xié)議構(gòu)造隧道達(dá)成數(shù)據(jù)加密傳輸
- 隧道工具:系統(tǒng)自帶的SSH、AutoSSH
- 1、AutoSSH:https://www.harding.motd.ca/autossh
DNS隧道
- 通過將其他協(xié)議封裝在DNS協(xié)議中進(jìn)行通信。
- 隧道工具:dnscat2、iodine、dns2tcp等。
- 1、dnscat2:https://github.com/iagox86/dnscat2
- 2、iodine:https://github.com/yarrick/iodine
- 3、dns2tcp:https://pkgs.org/download/dns2tcp