Skip to main content

Overview

Attack surface agents are recon-focused specializations of the OffensiveSecurityAgent 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

The consume() 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
High-level summary of the analysis
number
Total number of assets discovered
number
Total number of domains/subdomains found
number
Number of high-priority targets identified
boolean
Whether the analysis completed successfully
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
AuthenticationInfo
Authentication details if required
string
Authentication method (e.g., “cookie”, “bearer”)
string
Details about the auth mechanism
string
Credential reference or ID
string
Cookie string if using cookie auth
string
Additional headers required
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 assets
  • create_attack_surface_report - Generate the final analysis report
  • browser_navigate - Navigate to web pages
  • browser_snapshot - Capture DOM snapshots
  • browser_screenshot - Take screenshots for documentation
  • browser_click - Interact with page elements
  • browser_fill - Fill form fields
  • browser_evaluate - Execute JavaScript in the browser context
  • browser_console - Access browser console logs
  • browser_get_cookies - Extract cookies from browser
  • email_list_inboxes - List available email inboxes (if configured)
  • email_list_messages - List messages in an inbox
  • email_search_messages - Search for specific messages
  • email_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.
Subdomain Enumeration: Only enable enumerateSubdomains when you have permission to perform active DNS enumeration on the target domain.
Scope Control: Use strictScope: true for bug bounty programs with defined scope. Use strictScope: false for comprehensive red team assessments.