Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Web Application Firewall (WAF) Implementation using ModSecurity

This project is part of my undergraduate research, focusing on optimizing website security through the implementation of a Web Application Firewall (WAF) using ModSecurity with the OWASP Core Rule Set (CRS). The system was tested against three major attack types: SQL Injection, Cross-Site Scripting (XSS), and Application Layer DDoS.


📌 Project Overview

  • Objective: To protect a vulnerable web application (DVWA) from common web attacks using ModSecurity WAF.
  • Testing Environment: Local testbed simulating real-world attacks.
  • Attacks Simulated: SQL Injection, Cross-Site Scripting (XSS), and Slow HTTP (Slowloris) DoS.
  • Evaluation Focus: Effectiveness of detection and blocking capability.

🧰 Tech Stack

Component Technology
Web Server Nginx
WAF Engine ModSecurity v3.x
Rule Set OWASP CRS v4.x
Target Web App Damn Vulnerable Web App (DVWA)
OS & Tools Kali Linux, SQLMap, XSSer, Slowloris

⚙️ Setup Overview

  1. Installed ModSecurity v3.x as a dynamic module for Nginx
  2. Configured OWASP CRS as the primary detection ruleset
  3. Deployed DVWA on local server
  4. Simulated attacks using offensive tools inside isolated testing environment
  5. Analyzed ModSecurity logs (/var/log/modsec_audit.log) for detection evidence

🧪 Attack Simulation and Results

Attack Type Tool Used Result Without WAF Result With ModSecurity WAF
SQL Injection SQLMap Database Extracted 🚫 Blocked
XSS XSSer Script Executed 🚫 Blocked
HTTP DoS (Slowloris) Slowloris Service Exhausted ⚠️ Partially Mitigated

ModSecurity was effective for SQLi and XSS prevention but only partially mitigated application-layer DDoS due to architectural limitations.


📂 Repository Contents

.

├── modsecurity.conf # Main ModSecurity configuration file ├── crs-setup.conf # OWASP CRS customization ├── nginx.conf (partial) # WAF integration section ├── test-scripts/ │ ├── sqlmap_test.sh │ ├── xsser_test.sh │ └── slowloris_test.py └── README.md # Project documentation


🔍 Key Learnings

  • Rule tuning is crucial: False positives can affect site usability.
  • Not all threats are equally handled: Application-layer DoS needs rate limiting or external services.
  • Log analysis is essential: ModSecurity provides granular forensic logs.

🔄 Future Enhancements

  • Integrate with Fail2Ban or Nginx rate limiting for better DoS mitigation.
  • Write custom ModSecurity rules for business-specific logic.
  • Deploy and test on a cloud environment (e.g., AWS EC2, DigitalOcean) for real-world simulation.

📌 About This Project

This project was developed as part of my undergraduate thesis titled:

"Optimizing Website Security through the Implementation of a ModSecurity-based Web Application Firewall"

I am currently open to freelance cybersecurity projects, especially those related to web security, threat detection, WAF configuration, and basic penetration testing. Feel free to reach out!


📫 Contact


✅ If you found this project interesting, feel free to clone, fork, or contact me for collaboration or freelance opportunities.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages