7.1 KiB
title, description, difficulty, duration, prerequisites, tags
| title | description | difficulty | duration | prerequisites | tags | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Lab 2: Web Application Vulnerability Assessment | Explore common web application vulnerabilities using OWASP ZAP and manual testing techniques | Intermediate | 90 minutes | Basic understanding of HTTP, HTML, and web applications |
|
Objectives
By the end of this lab, you will be able to:
- Set up and configure OWASP ZAP for web application testing
- Identify common web application vulnerabilities
- Perform manual and automated vulnerability assessments
- Understand the OWASP Top 10 vulnerabilities in practice
- Document findings and provide remediation recommendations
Prerequisites
- Understanding of HTTP protocol and web technologies
- Basic knowledge of HTML, CSS, and JavaScript
- Familiarity with web browsers and developer tools
- Access to OWASP ZAP and a vulnerable web application
Lab Environment Setup
-
Install OWASP ZAP
# On Kali Linux sudo apt update && sudo apt install zaproxy # Or download from https://www.zaproxy.org/download/ -
Target Application
- We'll use DVWA (Damn Vulnerable Web Application)
- Alternative: WebGoat or Mutillidae
- Ensure the application is running locally or on an isolated network
-
Browser Configuration
- Configure your browser to use ZAP as a proxy
- Install any necessary certificates
Exercise 1: Passive Scanning and Reconnaissance
Step 1: Configure ZAP Proxy
- Start OWASP ZAP
- Configure your browser to use
127.0.0.1:8080as HTTP proxy - Install ZAP's root certificate in your browser
Step 2: Spider the Application
- Navigate to your target application (e.g.,
http://localhost/dvwa) - Log in with default credentials
- Use ZAP's spider to crawl the application:
- Right-click on the target URL in ZAP
- Select "Attack" → "Spider"
- Configure spider settings as needed
Questions:
- How many pages did the spider discover?
- What different types of content were found?
- Are there any hidden directories or files?
Step 3: Passive Vulnerability Detection
Review the passive scan results in ZAP:
Questions:
- What passive vulnerabilities were detected?
- Which findings have the highest risk rating?
- Are there any false positives?
Exercise 2: Active Vulnerability Scanning
Step 1: Configure Active Scan
- Select the target application in ZAP's site tree
- Right-click and choose "Attack" → "Active Scan"
- Configure scan policies and parameters
Step 2: Analyze Active Scan Results
Monitor the active scan progress and results:
Questions:
- What new vulnerabilities were discovered during active scanning?
- How do the results differ from passive scanning?
- Which vulnerabilities pose the greatest risk?
Exercise 3: Manual Vulnerability Testing
Step 1: SQL Injection Testing
Test for SQL injection vulnerabilities manually:
-
Identify Input Fields
- Login forms
- Search boxes
- URL parameters
-
Test Basic SQL Injection
' OR '1'='1 ' OR 1=1-- admin'-- -
Advanced SQL Injection
' UNION SELECT null,user(),version()-- ' UNION SELECT null,database(),@@version--
Questions:
- Which input fields are vulnerable to SQL injection?
- What information can you extract from the database?
- Can you bypass authentication using SQL injection?
Step 2: Cross-Site Scripting (XSS) Testing
Test for XSS vulnerabilities:
-
Reflected XSS
<script>alert('XSS')</script> <img src="x" onerror="alert('XSS')"> -
Stored XSS
- Submit malicious payloads through forms
- Check if they persist and execute for other users
-
DOM-based XSS
- Test client-side input handling
- Examine JavaScript code for vulnerabilities
Questions:
- Where can XSS payloads be successfully injected?
- What types of XSS vulnerabilities are present?
- How could these be exploited in a real attack?
Step 3: Authentication and Session Management
Test authentication mechanisms:
-
Weak Password Policy
- Try common passwords
- Test password complexity requirements
-
Session Management
- Examine session tokens
- Test session fixation
- Check for session timeout
Questions:
- Are there weaknesses in the authentication system?
- How secure are the session management mechanisms?
- Can sessions be hijacked or predicted?
Exercise 4: Advanced Testing Techniques
Step 1: Directory Traversal
Test for path traversal vulnerabilities:
../../../etc/passwd
..\..\..\..\windows\system32\drivers\etc\hosts
Step 2: File Upload Vulnerabilities
If file upload functionality exists:
- Test uploading different file types
- Try to upload malicious files (PHP shells, etc.)
- Check file validation mechanisms
Step 3: Business Logic Flaws
Look for application-specific vulnerabilities:
- Price manipulation in e-commerce
- Privilege escalation
- Workflow bypass
Documentation and Reporting
Vulnerability Report Template
Create a comprehensive report including:
-
Executive Summary
- High-level findings
- Risk assessment
- Business impact
-
Technical Findings
- Detailed vulnerability descriptions
- Proof of concept
- CVSS scores
-
Remediation Recommendations
- Specific fix instructions
- Best practices
- Timeline for fixes
Risk Prioritization
Classify vulnerabilities by:
- Critical: Remote code execution, SQL injection with data access
- High: Authentication bypass, sensitive data exposure
- Medium: XSS, information disclosure
- Low: Minor configuration issues
Remediation Verification
After implementing fixes:
-
Retest Previously Vulnerable Areas
- Verify fixes are effective
- Ensure no new vulnerabilities introduced
-
Regression Testing
- Test application functionality
- Verify security controls work properly
Additional Challenges
- Custom Payloads: Create your own injection payloads
- Automated Testing: Write custom ZAP scripts
- Mobile Testing: If applicable, test mobile app versions
- API Testing: Test REST/SOAP APIs for vulnerabilities
Resources
Conclusion
This lab provided hands-on experience with web application security testing using both automated tools and manual techniques. You learned to identify, exploit, and document common web vulnerabilities while understanding their potential impact and remediation strategies.
Key takeaways:
- Automated tools are helpful but manual testing is essential
- Understanding the business context is crucial for risk assessment
- Proper documentation enables effective remediation
- Regular testing should be part of the development lifecycle
Always ensure you have proper authorization before testing any web application!