Overview
Attack surface agents are recon-focused specializations of theOffensiveSecurityAgent that map the entire attack surface of a target. They discover assets, endpoints, authentication flows, and produce a structured list of targets for deep penetration testing.
BlackboxAttackSurfaceAgent
Maps the entire attack surface of a target through blackbox reconnaissance — discovers assets, endpoints, authentication flows, and produces a list of targets for deep testing.Constructor
AttackSurfaceAgentInput
required
Configuration object for the attack surface agent
AttackSurfaceAgentInput
AIModel
required
AI model identifier (e.g.,
"claude-sonnet-4-20250514")SessionInfo
required
Session providing paths for findings, POCs, logs, etc.
string
The target to analyze (domain, IP, URL, network range, or org name). Either
target or cwd must be provided.string
Working directory for source-code based analysis. Either
target or cwd must be provided.AIAuthConfig
Optional per-provider API key overrides
StreamTextOnStepFinishCallback<ToolSet>
Callback fired after each agent step
AbortSignal
AbortSignal to cancel the agent mid-run
ConsumeCallbacks
Callbacks for stream events and subagent forwarding
FindingsRegistry
Shared findings registry for cross-agent dedup
CredentialManager
In-memory credential store for secret-free agent prompts
StopCondition<ToolSet>
Override the default stop condition
Result Type
Theconsume() method returns an AttackSurfaceResult:
AttackSurfaceAnalysisResults | null
The full analysis results (targets, assets, key findings)
PentestTarget[]
All targets identified for deep penetration testing
string
Absolute path to the attack-surface-results.json file
string
Absolute path to the session’s assets directory
AttackSurfaceAnalysisResults
AttackSurfaceSummary
string[]
Array of discovered asset strings (e.g., “example.com - Web server (nginx) - Ports 80,443”)
PentestTarget[]
Structured targets for deep testing
string
Target URL or endpoint
string
Testing objective for this target
string
Why this target was selected
string[]
Array of key findings from the analysis (e.g., “[HIGH] Admin panel exposed - admin.example.com”)
Active Tools
The BlackboxAttackSurfaceAgent uses the following tools:execute_command- Run reconnaissance commands (nmap, dig, curl, etc.)document_asset- Document discovered assetscreate_attack_surface_report- Generate the final analysis reportbrowser_navigate- Navigate to web pagesbrowser_snapshot- Capture DOM snapshotsbrowser_screenshot- Take screenshots for documentationbrowser_click- Interact with page elementsbrowser_fill- Fill form fieldsbrowser_evaluate- Execute JavaScript in the browser contextbrowser_console- Access browser console logsbrowser_get_cookies- Extract cookies from browseremail_list_inboxes- List available email inboxes (if configured)email_list_messages- List messages in an inboxemail_search_messages- Search for specific messagesemail_get_message- Retrieve full message content
Usage Examples
Basic Attack Surface Analysis
With Authentication Credentials
With Custom Configuration
Processing Results
Loading Previous Results
Analysis Phases
The BlackboxAttackSurfaceAgent follows a structured reconnaissance methodology:1
Phase 1: Authentication (if credentials provided)
The agent authenticates first if credentials are available, then proceeds with authenticated discovery.
2
Phase 2: Subdomain Enumeration (if enabled)
DNS brute-force, certificate transparency logs, zone transfers, and passive DNS lookup.
3
Phase 3: Asset Discovery
Port scanning, service enumeration, technology detection, and web crawling.
4
Phase 4: Endpoint Discovery
JavaScript extraction, API endpoint discovery, sitemap parsing, and robots.txt analysis.
5
Phase 5: Target Selection
Analysis of discovered assets to identify high-value targets for deep penetration testing.
6
Phase 6: Report Generation
Creates structured JSON report with all findings and pentest targets.
Scope Configuration
Control reconnaissance scope through session configuration:Helper Functions
parseDiscoveredAsset()
Parse a discovered asset string into structured data.parseKeyFinding()
Parse a key finding string into severity and description.getHighPriorityKeywords()
Extract high-priority findings (CRITICAL and HIGH severity).extractPentestTargets()
Extract simplified target objects for orchestration.Best Practices
Authentication First: If credentials are provided, the agent authenticates before running any reconnaissance commands.

