
This repository contains a Python-based exploit tool designed to take advantage of the CVE-2014-6287 vulnerability in HTTP File Server (HFS) versions 2.3.x. This vulnerability allows an attacker to execute arbitrary commands on the server, potentially leading to unauthorized access and control.
⚠️ Disclaimer:
This tool is intended solely for educational and authorized penetration testing purposes. Unauthorized use of this tool against systems you do not own or have explicit permission to test is illegal and unethical. The author and contributors are not responsible for any misuse or damage caused by this tool.
nc) installed on the attacker's machine.Clone the Repository:
git clone https://github.com/francescobrina/hfs-cve-2014-6287-exploit.git
cd hfs-cve-2014-6287-exploit
Install Dependencies:
This script relies on Python's standard libraries. Ensure you have Python 3.6 or higher installed.
python3 --version
If you don't have Python installed, download it from the official website or use your package manager.
Configure the Script:
Open the exploit.py file in a text editor and configure the following variables:
lhost = "YOUR_LOCAL_IP" # Your attacker's IP address
lport = 1111 # Port to listen on
rhost = "TARGET_IP" # Target HFS server IP address
rport = 80 # Target HFS server port (default is 80)
Start Netcat Listener:
On your attacker's machine, start a Netcat listener to receive the reverse shell:
nc -nlvp 1111
Run the Exploit Script:
Execute the Python exploit script:
python3 exploit.py
The script will encode the PowerShell command in Base64, send an HTTP GET request to the target HFS server, and await a reverse shell connection.
Establish Connection:
If the exploit is successful, you should receive a reverse shell on your Netcat listener.
PowerShell Command Creation:
The script constructs a PowerShell command that initiates a TCP connection back to the attacker's machine (lhost:lport). Once connected, it creates a stream to send and receive data, effectively establishing a reverse shell.
Encoding the Command:
The PowerShell command is encoded in Base64 using UTF-16LE encoding to obfuscate it and bypass potential security filters.
Crafting the Payload:
The encoded command is embedded into a payload that is sent as part of an HTTP GET request to the target HFS server's vulnerable endpoint.
Executing the Payload:
When the HFS server processes the request, it decodes and executes the PowerShell command, establishing a reverse shell back to the attacker.
Ensure that the following configurations are correctly set before running the exploit:
lhost: Your machine's IP address where Netcat is listening.lport: The port number on which Netcat is listening.rhost: The target machine's IP address running the vulnerable HFS server.rport: The port number of the target HFS server (default is 80).Example configuration:
lhost = "192.168.1.100"
lport = 1111
rhost = "192.168.1.105"
rport = 80
No Reverse Shell Connection:
lhost and rhost are correctly set and reachable.Script Errors:
Netcat Issues:
-nlvp) to start the listener.Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Fork the Repository
Create a Feature Branch
git checkout -b feature/YourFeature
Commit Your Changes
git commit -m "Add Your Feature"
Push to the Branch
git push origin feature/YourFeature
Open a Pull Request
Developed by Francesco Brina.
Email: [email protected]
This project is licensed under the MIT License.
Disclaimer:
Use this tool responsibly and only on systems you have explicit permission to test. The author is not liable for any misuse or damage caused by this tool.
Feel free to let me know if you'd like any further adjustments!