Browser Tool
The Browser tool provides automated web browser control for dynamic application security testing.
Tip
For a comprehensive deep-dive into browser internals, visual feedback system, and advanced workflows, see HackerBrowser Deep Dive.
🎬 GIF: browser-automation.gif
Browser tool automated testing
Overview
The Browser tool enables:
- Navigating web applications
- Interacting with page elements
- Capturing network traffic
- Taking screenshots
- Executing JavaScript
- Testing client-side vulnerabilities
Launching the Browser
Basic Launch
> Launch the browser and go to https://target.comWith Proxy
> Launch browser with traffic capture enabledHeadless Mode
> Run browser in headless mode for automationNavigation
Go to URL
> Navigate to https://target.com/loginClick Elements
> Click the login buttonFill Forms
> Fill the username field with "admin" and password with "test123"Submit Forms
> Submit the login formElement Interaction
By Selector
> Click the element with selector "#submit-btn"By Text
> Click the button containing "Sign In"By XPath
> Fill the input at xpath "//input[@name='email']"Wait for Element
> Wait for the dashboard to load before continuingTraffic Capture
Enable Capture
> Start capturing network trafficView Requests
> Show all captured HTTP requestsFilter Traffic
> Show only POST requests to /api endpointsExport HAR
> Export captured traffic to pentest-session.harScreenshots
Full Page
> Take a screenshot of the current pageElement Screenshot
> Take a screenshot of the login formEvidence Collection
> Screenshot the vulnerability evidenceJavaScript Execution
Run Script
> Execute JavaScript to get all cookiesdocument.cookieDOM Manipulation
> Modify the hidden field value to test tamperingdocument.querySelector('#hidden-field').value = 'modified'Extract Data
> Extract all links from the pageArray.from(document.querySelectorAll('a')).map(a => a.href)Security Testing
XSS Testing
> Test the search field for XSS vulnerabilities- Navigate to search page
- Enter XSS payload:
<script>alert(1)</script> - Submit and observe
- Screenshot evidence
CSRF Testing
> Check if the form has CSRF protection- Inspect form for CSRF token
- Attempt submission without token
- Document results
Authentication Testing
> Test login for SQL injection- Navigate to login
- Enter payload:
admin' OR '1'='1' -- - Submit and check response
- Document bypass if successful
Session Testing
> Analyze session cookies for security issuesChecks:
- HttpOnly flag
- Secure flag
- SameSite attribute
- Session fixation
Multi-Page Workflows
Login and Navigate
> Log in as user and navigate to admin panel- Go to login page
- Enter credentials
- Submit form
- Navigate to /admin
- Check access
Spider Application
> Crawl the application and discover all endpointsAutomated crawling:
- Follow links
- Submit forms
- Record endpoints
- Build sitemap
Browser Configuration
Viewport Size
> Set browser viewport to mobile sizeUser Agent
> Use mobile user agent for testingCookies
> Set authentication cookie before navigatingProxy Integration
Burp Suite
> Route traffic through Burp Suite proxyConfiguration:
{ "browser": { "proxy": "http://127.0.0.1:8080" }}mitmproxy
> Use mitmproxy for traffic inspectionZAP
> Connect to OWASP ZAP proxyError Handling
Element Not Found
Error: Element not found: #nonexistentSolutions:
- Verify selector
- Wait for element
- Check page state
Navigation Timeout
Error: Navigation timeoutSolutions:
- Increase timeout
- Check network connectivity
- Verify URL
JavaScript Error
Error: JavaScript execution failedSolutions:
- Check syntax
- Verify DOM state
- Handle async operations
Best Practices
- Wait for elements - Use explicit waits
- Handle popups - Dismiss or accept alerts
- Clean state - Clear cookies between tests
- Capture evidence - Screenshot all findings
- Export traffic - Save HAR for analysis
Tip
Use the browser tool for testing client-side vulnerabilities that require JavaScript execution.
BrowserUI Tool
For interactive browser control:
> Open interactive browser sessionFeatures:
- Visual browser window
- Manual interaction
- Real-time inspection
- Live traffic monitoring
Related Documentation
- HackerBrowser Deep Dive - Architecture, internals, and advanced usage
- Web Application Agent - Web testing
- File Operations - Saving results
- Memory Tool - Storing findings