This Python script is designed to brute-force directories and files for CTF challenges. It supports login authentication and customizable directories and filenames.
git clone https://github.com/KOGELSPONS/html-scada-modbus-dir-bruteforce
cd html-scada-modbus-dir-bruteforce
Instead of installing dependencies manually, you can install all required dependencies from the requirements.txt
file:
pip3 install -r requirements.txt
nano config.json
Do not copy this JSON directly. Edit the downloaded file to avoid breaking the code, example config.json
:
{
"ip": "192.168.56.0", // IP of the webpage
"port": 80, //Standard HTTP port is 80, and standard HTTPS port is 443, but they can be configured to use different ports
"username": "admin", // Login username
"password": "admin123", // Login password
"readability": true //Set to true if you want a .html summary instead of the full .html output of the found directory
}
After editing, press CTRL + X to exit nano. Press Y to confirm saving. Press Enter to save the file.
nano directories_filenames.json
w Add or remove directories and filenames you want to test in the lists, or use the default ones:
{
"directories": ["/etc/", "/home/", "/var/log/"],
"filenames": ["passwd", "shadow", "nginx.conf"]
}
Save the file the same way (CTRL + X, Y, Enter).
Once the configuration is complete, run the Python script:
python3 login_bruteforce.py
The script will log in, brute-force directories, and output results based on your configuration.
If the script doesn't work as expected, the code is easily modifiable. You can make adjustments by using ChatGPT or similar tools to help with any customizations or fixes needed. Alternatively, you can use this code as a base/example for your own projects.