DEV Community

Sharoz
Sharoz

Posted on

I Built a WAF From Scratch and Tested It Against 39 Real Attacks

As a final-year cybersecurity student, I wanted to go beyond tutorials and build something that actually detects real attacks — so I built SentinelShield-WAF, a Flask-based Web Application Firewall.

What it does

SentinelShield inspects incoming HTTP requests and blocks malicious ones in real time using regex-based signature detection across multiple attack categories — SQL injection, XSS, path traversal, command injection, and more.

The numbers

  • 47 regex signatures across 7 attack categories
  • Tested against 39 real attack payloads
  • 100% detection accuracy
  • 0 false positives, 0 false negatives
  • Deployed live on Railway

What I learned

Getting to 0 FP/FN wasn't easy — early versions either blocked legitimate traffic or missed obfuscated payloads. I had to iterate on the regex patterns and think like an attacker trying to bypass my own rules, not just like a defender writing detection logic.

Try it / check the code

GitHub: https://github.com/SHAROZ221/SentinelShield-WAF

Would love feedback from anyone working on detection engineering or WAF design — what would you add or test differently?

Top comments (0)