Cyber Services / All lessons / CEH — Ethical Hacking / Wapiti Web Application Vulnerability Scanner

Wapiti Web Application Vulnerability Scanner

Module 17 of 130 · 7 min read · Free to read

MODULES ↓ Command blocks have a COPY button
Comprehensive Web Security Assessment Tool for Ethical Hackers
Vulnerability Detection Web Application Scanning Security Testing Practical Activities

Wapiti: The Web Application Auditor

Wapiti stands as a robust, open-source tool dedicated to web application security auditing. It operates as a "black-box" scanner, meaning it interacts with the application from the outside-in, just like an attacker, without needing access to the source code. Wapiti intelligently crawls web applications, discovering endpoints, forms, and parameters, then launches targeted attacks (module-based) to identify a wide spectrum of vulnerabilities.

Black-Box Scanning Approach

Wapiti simulates real-world attacker behavior by interacting with web applications externally, making it ideal for security assessments where source code access isn't available. This approach helps identify vulnerabilities that would be exploitable by external attackers.

Ethical Mandate: Permission is Paramount

WARNING: Web vulnerability scanners like Wapiti actively probe and inject potentially harmful payloads. NEVER run Wapiti against any website or web application without explicit, written authorization from the owner. Unauthorized scanning is illegal and can cause disruptions or damage. Confine all usage to authorized tests or personal lab environments.

Injection Detection

SQL Injection, Command Execution, XPath Injection, XXE, and SSRF vulnerabilities

XSS Detection

Reflected and Stored Cross-Site Scripting vulnerability identification

File Inclusion

Local and Remote File Inclusion (LFI/RFI) and Directory Traversal detection

Configuration Testing

Backup file detection, HTTP security headers, and insecure configurations

Installation & Setup

Prerequisites

Wapiti relies on Python 3. Ensure you have Python 3 and `pip` installed on your system.

# Update system and install prerequisites
sudo apt update
sudo apt install python3 python3-pip git -y
Virtual Environment Recommendation

It's highly recommended to install Python packages within a virtual environment to avoid system-wide dependency conflicts.

# Create and activate virtual environment
python3 -m venv wapiti-env
source wapiti-env/bin/activate

Installation Methods

# Install Wapiti using pip
pip install wapiti3
# Verify installation
wapiti --version
# Get help and see available options
wapiti --help

Core Capabilities and Detected Vulnerabilities

Comprehensive Vulnerability Detection

Wapiti's strength lies in its modular design and comprehensive vulnerability checks across multiple security domains.

Primary Vulnerability Categories

Category Specific Vulnerabilities Impact Level
Injection Flaws SQL Injection, Command Execution, XPath Injection, XXE, SSRF Critical
Cross-Site Scripting Reflected XSS, Stored XSS, DOM-based XSS High
File Inclusion Local File Inclusion (LFI), Remote File Inclusion (RFI) High
Configuration Issues Backup files, HTTP security headers, insecure methods Medium
Session Security CSRF detection, cookie security, authentication issues Medium
Information Disclosure Application fingerprinting, CMS detection, subdomain takeover Low-Medium
CEH Domain Relevance

Wapiti directly supports the Hacking Web Applications domain of the CEH curriculum. Its ability to detect vulnerabilities like SQL Injection, XSS, Command Injection, File Inclusion, and others aligns perfectly with the practical skills expected of a Certified Ethical Hacker.

Core Usage and Workflow

Basic Scan

The most straightforward scan targets a URL and uses default modules and scope:

# Basic Wapiti scan
wapiti -u http://target-domain.com/

Wapiti will start crawling from the base URL and launch default attack modules against discovered endpoints.

General Workflow

Understanding Wapiti's workflow helps in planning effective security assessments:

  1. Target Definition: Specify the target URL (-u) or API definition (--swagger)
  2. Scope Control: Define how far Wapiti should crawl (--scope) and exclude paths (-x)
  3. Authentication: Provide credentials via cookies, HTTP Auth, or form parameters
  4. Module Selection: Choose specific modules (-m) or exclude modules (-xm)
  5. Crawling & Attack Tuning: Adjust depth, timeouts, concurrency, and headers
  6. Reporting: Specify output format (-f) and file (-o)
  7. Execution & Analysis: Run the scan and analyze generated reports

Advanced Command-Line Options

Targeting & Scope Control

Scope Definition
Control how extensively Wapiti crawls and attacks the target application.
# Define crawling scope
wapiti -u http://target.com/ --scope {page|folder|domain|subdomain|url|punk}
# Exclude specific paths
wapiti -u http://target.com/ -x /logout|/admin
Module Control
Select specific vulnerability modules to focus the scan.
# Run only specific modules
wapiti -u http://target.com/ -m sqli,xss,xxe
# List all available modules
wapiti --list-modules

Authentication Mechanisms

Cookie-based Authentication
Use session cookies for authenticated scanning.
# Use cookies from browser session
wapiti -u http://target.com/ -c session_cookies.txt
Form-based Authentication
Automate login for form-based authentication systems.
# Configure form authentication
wapiti -u http://target.com/ --form-target /login.php --form-user username --form-password password --form-cred admin:password123

Network & Performance Tuning

Proxy Configuration
Route traffic through proxies for monitoring or evasion.
# Use HTTP proxy
wapiti -u http://target.com/ -p http://127.0.0.1:8080
# Use Tor network
wapiti -u http://target.com/ --tor
Performance Optimization
Adjust scanning performance and timing parameters.
# Configure concurrent tasks and timeouts
wapiti -u http://target.com/ --tasks 15 -t 30

Practical Examples & CEH Scenarios

Scenario 1: OWASP Top 10 Focused Scan
Objective: Target common OWASP Top 10 vulnerabilities in a web application
# Focus on critical injection and XSS vulnerabilities
wapiti -u http://vulnerable-app.lab/ -m sqli,xss,xxe,exec,ssrf -f html -o owasp_scan.html -v 1

This command scans the target URL, running only modules related to SQL Injection, XSS, XXE, Command Execution, and SSRF. Outputs an HTML report with verbosity level 1 for detailed logging.

CEH Connection

Directly tests for several vulnerabilities listed in the OWASP Top 10, a critical knowledge area for CEH focusing on web application security risks.

Scenario 2: Authenticated Application Scan
Objective: Perform comprehensive security testing of authenticated application areas
# Scan authenticated area using session cookies
wapiti -u http://secure-portal.lab/dashboard/ -c session_cookies.txt --scope folder -f json -o dashboard_scan.json

Scans only within the `/dashboard/` directory using authentication cookies provided in the file. This approach is essential for testing application functionality behind login forms.

Scenario 3: JavaScript-Heavy Application Testing
Objective: Test modern single-page applications with heavy JavaScript usage
# Use headless browser for JavaScript rendering
wapiti -u https://modern-webapp.lab/ -d 5 --headless hidden -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" -H "X-Requested-With: XMLHttpRequest" -o deep_scan.html -f html

Crawls up to depth 5, uses a headless browser for JavaScript rendering, sets a specific User-Agent and custom header to simulate real browser behavior.

Hands-On Activities

Activity 1: Basic Web Application Assessment
Objective: Perform a comprehensive security assessment of a test web application
  1. Set up a test environment with a vulnerable web application (DVWA, bWAPP, etc.)
  2. Run a basic Wapiti scan to discover the application structure
  3. Analyze initial findings and identify high-priority vulnerabilities
  4. Run targeted scans using specific modules for critical vulnerabilities
  5. Generate comprehensive reports in multiple formats
  6. Document findings with evidence and severity ratings
# Comprehensive assessment command
wapiti -u http://test-app.local/ -m all -f html,json -o comprehensive_scan -v 2
Activity 2: Authentication Bypass Testing
Objective: Test authentication mechanisms and identify potential bypass methods
  1. Configure Wapiti for form-based authentication against a test application
  2. Test various authentication endpoints and parameters
  3. Identify potential authentication bypass vulnerabilities
  4. Test session management and cookie security
  5. Document authentication-related security issues
# Authentication testing command
wapiti -u http://auth-test.local/ --form-target /login --form-user email --form-password password --form-cred test@test.com:password123 -m auth,csrf -o auth_scan
Activity 3: API Security Assessment
Objective: Perform security testing of REST API endpoints
  1. Identify API endpoints using Swagger/OpenAPI documentation
  2. Configure Wapiti to target API-specific endpoints
  3. Test for API-specific vulnerabilities (injection, authentication issues)
  4. Validate input validation and error handling
  5. Generate API-specific security reports
# API security assessment
wapiti --swagger http://api.test.local/swagger.json -H "Authorization: Bearer token123" -f json -o api_scan.json -m sqli,xxe,exec --tasks 5
Interpreting Results & Next Steps
  • Prioritize by Severity: Focus on high-impact findings like SQL Injection, Command Execution, XXE first
  • Verify Findings: Always manually verify reported vulnerabilities to eliminate false positives
  • Understand Context: Analyze where vulnerabilities were found to determine exploitability
  • Leverage Detailed Info: Use request/response pairs in reports for verification
  • Combine with Manual Testing: Use Wapiti as a starting point for deeper manual security testing

Conclusion: Wapiti as Part of Your Toolkit

Wapiti is a versatile and powerful automated web application scanner that serves as an excellent addition to any ethical hacker's arsenal. Its strength lies in its wide range of vulnerability modules, flexible configuration options, and clear reporting. By mastering its command-line interface and understanding how to tailor scans effectively, you can significantly speed up the process of identifying common web security weaknesses.

Key Takeaways
  • Wapiti provides comprehensive black-box web application security testing
  • Modular design allows targeted vulnerability scanning
  • Flexible authentication options enable testing of protected areas
  • Multiple output formats support integration with other tools
  • Regular updates ensure coverage of latest vulnerabilities
  • Always verify findings manually and operate within authorized scopes
Final Ethical Reminder

Automated web application scanners like Wapiti are powerful tools that must be used responsibly. Always ensure you have explicit, written permission before scanning any systems. Unauthorized scanning is not only unethical but also illegal in many jurisdictions. Use these skills to improve security posture, not to compromise systems. Document your findings responsibly and follow proper disclosure procedures.

Modules (130) ← CEH — Ethical Hacking