Essential operations and features of OWASP ZAP for web application security testing
OWASP Zed Attack Proxy (ZAP) is a powerful open-source web application security testing tool that functions as an intercepting proxy. This guide covers the core operations and essential features of OWASP ZAP for effective security testing.
Overview of Core Operations
OWASP ZAP provides several key operational modes and features:
Proxying : Intercepting and modifying HTTP/HTTPS traffic between browser and web application
Automated Scanning : Discovering vulnerabilities through automated active and passive scanning
Spider/Crawler : Discovering the attack surface of web applications
Manual Testing : Tools for manual security testing and exploration
Reporting : Generating comprehensive security reports
User Interface Overview
The ZAP interface is divided into several key sections:
Main Components Key Views Operation Modes
Main Components
Menu Bar : Access to all ZAP features and configurations
Toolbar : Quick access to commonly used functions
Tree Panel : Hierarchical view of sites being tested
Workspace Panel : Displays details of selected items
Information Panel : Shows details about requests, responses, and discovered issues
Footer : Status information and quick filters
Setting Up the Proxy
The proxy is ZAP's core feature, allowing you to intercept and analyze HTTP/HTTPS traffic.
1
Configure Proxy Settings
Go to Tools > Options > Network > Local Servers/Proxies
Verify the address (default: 127.0.0.1) and port (default: 8080)
Click OK to save changes
2
Configure Browser There are multiple ways to configure your browser to use ZAP as a proxy:
Manual Configuration :
Open your browser's network settings
Set HTTP/HTTPS proxy to 127.0.0.1:8080
Using ZAP's Browser Launch Feature :
Go to Tools > Launch Browser
Select your preferred browser
ZAP will launch the browser with the correct proxy settings
Using ZAP's Quick Start Tab :
Go to the Quick Start tab
Enter the URL to attack
Click Launch Browser
3
Install SSL Certificate To intercept HTTPS traffic without browser warnings:
Go to Tools > Options > Network > Server Certificates
Click Generate if you haven't created a certificate
Click Save to export the certificate
Import the certificate into your browser or operating system
Alternative Method :
Navigate to http://zap/ in your proxied browser
Click on Download ZAP Root CA Certificate
Follow browser-specific instructions to install the certificate
Note:
For mobile devices or other systems, you may need to configure a proxy and install the ZAP certificate manually. See the Mobile Testing guide for details.
Exploring Web Applications
Using the Spider
The Spider automatically discovers content and functionality in web applications:
Spider → Discovers URLs → Builds site map → Identifies entry points
Traditional Spider AJAX Spider
Traditional SpiderThe traditional spider crawls web applications by parsing HTML and following links.
To use the traditional spider :
Right-click on a target in the Sites tree
Select Attack > Spider
Configure options:
Max depth : How deep to crawl (default: 5)
Thread count : Number of concurrent threads (default: 2)
Context : Select a context if defined
User : Select a user if authentication is required
Click Start Scan
View results :
Go to the Spider tab to see discovered URLs
The Sites tree will be updated with new content
Common options :
Scope : Limit crawling to in-scope targets
Parse robots.txt : Discover URLs from robots.txt
Parse sitemap.xml : Discover URLs from sitemap.xml
Process forms : Submit forms with default values
Manual Exploration
Manual exploration allows you to browse the application while ZAP records traffic:
Configure your browser to use ZAP as a proxy
Browse the application normally
All traffic will appear in the History tab
The Sites tree will be populated with discovered resources
Note:
Manual exploration is essential for understanding application flow and discovering functionality that automated tools might miss.
Passive Scanning
Passive scanning analyzes HTTP messages without sending additional requests:
HTTP Traffic → Passive Scanner → Analyzes content → Reports issues
How Passive Scanning Works
ZAP automatically analyzes all traffic passing through the proxy
It applies passive scan rules to identify potential issues
Discovered issues appear in the Alerts tab
No additional requests are sent to the target
Configuring Passive Scan Rules
Go to Tools > Options > Passive Scanner
Enable or disable specific rules
Adjust the scan strength and threshold for each rule
Configure scan only in scope if desired
Common Passive Scan Findings
Information disclosure
Insecure headers
Cookie issues
Content security policy problems
Sensitive data in HTML/JavaScript
Outdated libraries
Active Scanning
Active scanning sends test requests to identify vulnerabilities:
Target → Active Scanner → Sends test requests → Analyzes responses → Reports vulnerabilities
1
Start an Active Scan
Right-click on a target in the Sites tree
Select Attack > Active Scan
Configure scan options:
Policy : Select a scan policy
Context : Select a context if defined
User : Select a user if authentication is required
Recurse : Scan all nodes under the selected target
Click Start Scan
2
Monitor Scan Progress
Go to the Active Scan tab
View the progress of the scan
See which rules are being applied
Check the number of requests sent
3
Review Results
Go to the Alerts tab
Review identified vulnerabilities
Sort by risk level
Examine details of each alert
Scan Policies
Scan policies determine which active scan rules are used:
Default Policy Custom Policies
Default PolicyThe default policy includes a balanced set of scan rules suitable for most applications.
Categories included :
Injection flaws (SQL, NoSQL, Command, etc.)
Cross-site scripting (XSS)
Path traversal
Server-side request forgery (SSRF)
XML external entity (XXE)
And many more
Context and Scope
Contexts and scopes help focus your testing on specific targets:
Setting Up a Context
Right-click on a site in the Sites tree
Select Include in Context > New Context
Name your context
Configure context properties:
Include/Exclude URLs : Define the boundaries
Authentication : Set up authentication methods
Session Management : Configure session handling
Users : Define users for authenticated testing
Technology : Specify technologies used by the application
Authorization : Define authorization rules
Defining Scope
Right-click on a site or URL in the Sites tree
Select Add to Scope
Alternatively, go to Tools > Options > Scope
Add include/exclude regex patterns
Note:
Setting the scope is crucial for focused testing. Many ZAP features can be configured to work only on in-scope items.
Authentication
ZAP supports various authentication methods for testing secure areas:
Form-Based HTTP Authentication Script-Based
Configure form-based authentication:
Go to the context properties
Select Authentication
Choose Form-based Authentication
Configure:
Login URL : The URL of the login page
Login Request POST Data : The form parameters
Username Parameter : Parameter name for username
Password Parameter : Parameter name for password
Logged In/Out Indicators : Regex patterns to detect login state
Example configuration :
Login URL: https://example.com/login
POST Data: username=%username%&password=%password%
Logged In Indicator: Logout|Welcome
Logged Out Indicator: Login|Sign in
Setting Up Users
Go to the context properties
Select Users
Click Add to create a new user
Configure:
Name : User identifier
Username : Authentication username
Password : Authentication password
Enable the user for testing
Session Management
ZAP offers various session management methods:
Cookie-Based : Default method, tracks cookies automatically
HTTP Authentication : Maintains HTTP authentication
Script-Based : Custom session handling via scripts
To configure:
Go to the context properties
Select Session Management
Choose the appropriate method
Configure method-specific settings
Next Steps
Now that you understand the core operations of OWASP ZAP, explore these topics: