1. 程式人生 > 實用技巧 >轉:一張圖告訴你,如何構建內網隱蔽通道

轉:一張圖告訴你,如何構建內網隱蔽通道

轉載地址:https://www.cnblogs.com/xiaozi/p/13603926.html

構建內網隱蔽通道,從而突破各種安全策略限制,實現對目標伺服器的完美控制。

當我們從外網成功獲得攻擊點的時候,通過反彈shell、埠轉發、內網穿透等技巧,來進一步入侵內網伺服器。當我們取得內網目標伺服器的控制權限,通過隧道技術繞過網路限制,實現隱蔽C2伺服器的通訊。

在這裡,我梳理了一張腦圖,將構建內網隱蔽通道分為突破訪問限制和隱藏通訊隧道技術。在不同的場景下進行應用,突破限制訪問內網伺服器,利用隧道技術實現C2通訊。

突破訪問限制方式

反彈shell

一句話反彈shell的各種方式
1、系統自帶命令:bash反彈、awk反彈、telnet反彈、socat反彈、powershell反彈、nc反彈等
2、程式語言實現:python反彈、php反彈、perl反彈、ruby反彈、lua反彈等
3、滲透測試框架:MSF、Cobalt strike、Empire、nishang等

埠轉發

埠轉發的幾種常用方法
1、系統自帶命令:ssh埠轉發、iptables埠轉發、firewall埠轉發、rinetd埠轉發、netsh埠轉發、socat埠轉發 
2、第三方小工具:lcx埠轉發、ncat埠轉發、portmap埠轉發

內網穿透工具

內網穿透工具,提供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

遠端控制軟體

常見的遠端控制軟體
1、TeamViewer:https://www.teamviewer.cn/cn/
2、向日葵:https://sunlogin.oray.com/

隱藏通訊隧道技術

ICMP隧道

將 IP 流量封裝進 IMCP 的 ping 資料包進行傳輸
隧道工具: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 資料報文
隧道工具:socat、6tunnel、nt6tunnel等
1、socat:http://www.dest-unreach.org/socat/download/
2、6tunnel:https://github.com/wojtekka/6tunnel

UDP 隧道

將UDP轉TCP傳送資料
UDP隧道工具,如Udp2raw-Tunnel、udptunnel等
1、Udp2raw-Tunnel:https://github.com/wangyu-/udp2raw-tunnel

Socks隧道

全能代理,支援多種協議,包括http、ftp請求及其它型別的請求。
socks代理工具:
1、sSocks:http://sourceforge.net/projects/ssocks
2、Earthworm:https://github.com/rootkiter/EarthWorm
3、Shad owsocks:https://shado wsocks.org
socks代理鏈工具:
1、SocksCap64:http://www.sockscap64.com
2、Proxifier:https://www.proxifier.com
3、ProxyChains:http://proxychains.sourceforge.net

HTTP(S) 隧道

把所有要傳送的資料全部封裝到HTTP協議裡進行傳送
隧道工具: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協議構造隧道達成資料加密傳輸
隧道工具:系統自帶的SSH、AutoSSH
1、AutoSSH:https://www.harding.motd.ca/autossh

DNS隧道

通過將其他協議封裝在DNS協議中進行通訊。
隧道工具:dnscat2、iodine、dns2tcp等。
1、dnscat2:https://github.com/iagox86/dnscat2
2、iodine:https://github.com/yarrick/iodine
3、dns2tcp:https://pkgs.org/download/dns2tcp