Damn Vulnerable Web Application (DVWA) Pentesting Report – A detailed security assessment of DVWA covering vulnerability identification, exploitation techniques, and remediation strategies. Includes practical demonstrations of web security flaws such as SQL Injection, XSS, CSRF, Command Injection, and more, along with mitigation recommendations.
- Introduction
- Installation & Setup
- Security Levels in DVWA
- Modules & Vulnerabilities
- Best Practices for Testing
- Mitigation Techniques
- References
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application designed for security professionals to test their skills and tools in a legal environment. It contains several security flaws to practice penetration testing techniques.
- Download DVWA from the official GitHub repository.
- Place it in your web server directory (e.g.,
htdocs
for XAMPP). - Configure
config.inc.php
with your database credentials. - Import the
dvwa.sql
database. - Start Apache and MySQL.
- Access DVWA via
http://localhost/dvwa
.
DVWA has three security levels:
- Low – Minimal protection, easy to exploit.
- Medium – Basic security features enabled.
- High – Advanced protection and sanitization.
- Goal: Test ability to exploit and extract database information.
- Example Payload:
' OR '1'='1 --
- Mitigation: Use prepared statements and parameterized queries.
- Goal: Inject malicious JavaScript into a web page.
- Example Payload:
<script>alert('XSS')</script>
- Mitigation: Input validation and output encoding.
- Goal: Trick authenticated users into performing unwanted actions.
- Mitigation: Use CSRF tokens in forms.
- Goal: Execute OS commands via unsanitized user input.
- Example Payload:
; ls
- Mitigation: Validate and sanitize user inputs.
- Goal: Include unauthorized files on the server.
- Types: Local File Inclusion (LFI), Remote File Inclusion (RFI)
- Mitigation: Use whitelists for file paths.
- Goal: Guess valid login credentials by repeated attempts.
- Mitigation: Rate limiting, account lockouts, strong password policies.
- Always test in a controlled, isolated environment.
- Document each vulnerability found.
- Use tools like Burp Suite, OWASP ZAP, and SQLMap for automation.
- Validate and sanitize all inputs.
- Apply the principle of least privilege.
- Keep software up to date.
- Implement secure coding practices.