Local hosted AI powered WAF
100% accuracy (18000+ SQLi/XSS/SSRF payloads tested, 100% detection rate)
- Create a virtual environment and install packages
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
- Run it! (Assuming your application is running on port 5001)
bash run.sh
- Protected Web App can be accessed at port 8888 (configurable in run.sh)
- Set your endpoint to port 8888
- That's it!
- Start mitm proxy without forwarding and enable logging in main.py
mitmproxy -s main.py --listen-port 8888
- Set up the HTTP proxy in your web browser and do normal things
- Once you have enough data, stop mitm proxy
- Change "label" to 0 in convert.py (line 32)
- Run convert.py, and copy output.jsonl into ai_detector/data.jsonl (make sure data.jsonl is fully empty (unless you want to append data))
- Delete output.jsonl and data.json
- Repeat steps 1-6 but generate suspicious traffic (sqlmap/etc) and set "label" to 1
- Run train.py
- Move waf.pkl into the project root directory
- Done!