Overview
The browser driver (@vulcn/driver-browser) enables security testing of web applications by recording and replaying browser interactions. It uses Playwright for browser automation.
Installation
The browser driver is included with the
vulcn CLI by default. You only need
to install it separately for programmatic usage.Configuration
| Option | Type | Default | Description |
|---|---|---|---|
startUrl | string | required | URL to navigate to when recording starts |
browser | "chromium" | "firefox" | "webkit" | "chromium" | Browser engine to use |
viewport | { width: number, height: number } | { width: 1280, height: 720 } | Browser viewport size |
headless | boolean | false | Run browser in headless mode |
Example Configuration
Step Types
The browser driver defines the following step types:browser.navigate
Navigate to a URL.
browser.click
Click on an element.
browser.input
Type into a form field. This is the primary injection point for payloads.
Set
injectable: true on input steps to mark them as payload injection
points. During replay, Vulcn will inject security payloads into these fields.browser.keypress
Press a key or key combination.
browser.scroll
Scroll the page or an element.
browser.wait
Wait for a duration (useful for manual session editing).
Browser Support
The driver uses a smart fallback strategy:- System Chrome - Uses your installed Chrome browser (zero download)
- System Edge - Falls back to Microsoft Edge if Chrome isn’t found
- Playwright Browsers - Uses Playwright’s bundled browsers as last resort
Auto-Crawl
The browser driver supports auto-crawl — an automated mode that discovers forms, inputs, and injection points without manual recording. Think of it as a lightweight spider that generates sessions for you.How it Works
- Opens a headless browser and navigates to the target URL
- Discovers all
<form>elements and standalone inputs on the page - Identifies injectable text-like inputs (text, search, url, email, tel, password, textarea)
- Finds submit triggers (submit buttons, untyped buttons, or falls back to Enter keypress)
- Follows same-origin links with configurable depth (BFS traversal)
- Generates a
Sessionper discovered form withnavigate → input → submitsteps
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
maxDepth | number | 2 | Maximum link-following depth (0 = target URL only) |
maxPages | number | 20 | Maximum number of pages to crawl |
pageTimeout | number | 10000 | Page load timeout in milliseconds |
sameOrigin | boolean | true | Only follow links to the same origin |
CLI Usage
Programmatic Usage
Direct Access
You can also use the crawler directly without going through the engine:Auto-crawl generates sessions with
injectable: true on all discovered text
inputs. During replay, Vulcn injects payloads into these fields and triggers
the form submission.Programmatic Usage
Recording
Running
Detection
During replay, the browser driver monitors for:- JavaScript Dialogs -
alert(),confirm(),prompt()triggered by payloads - Console Messages -
console.log()outputs matching payload markers - Payload Reflection - Payload strings appearing in page content
Example Session
Complete recorded session example:Plugin System
Learn how to add detection plugins for comprehensive vulnerability scanning
