Vulnsocket is a vulnerable websocket machine.This machine has two different vulnerabilities:
- CSWSH (Cross Site WebSocket Hijacking)
- Reflected XSS
And this machine shows you how to close these vulnerabilities.
Requirements:
- Python 3
- PHP 8
- MYSQL
-
You should download the project files to your xampp htdocs(C:\xampp\htdocs\ or /opt/xamp/htdocs etc.) folder.
git clone https://github.com/Serhatcck/vulnsocket.git
-
You should create a database named "web_socket" in MySQL.
-
You have to edit the configuration in database.php file
$host = "localhost"; $user = "root"; $pass = "root"; $dbname = "web_socket";
-
You should visit http://localhost/vulnsocket/db_reset.php to create database tables and add rows.
- Install Requirements
pip3 install -r requirements.txt
- You have to edit the configuration in socket_servers/DB.py file
host = "localhost" user = "root" passwd = "root" db = "web_socket"
If you get an error in cswsh_exploit.py, check:
- Are the selenium drivers in the Selenium Driver folder correct?
- Do you install selenium in python3 ?
- Create a html/javascript poc
- Serve this file in server(example: http://localhost/poc.html)
- Exploit CSWSH with exploitation code:
python3 cswsh_exploit.py {your file address}
python3 cswsh_exploit.py http://localhost/poc.html
- Hijack admin account
https://medium.com/@serhatdbs/vulnerable-websocket-server-e44bee5e0b5f