pentest command executes a complete penetration test workflow, including attack surface discovery and targeted vulnerability assessment.
Syntax
Description
This command runs a comprehensive two-phase pentest:- Attack Surface Discovery: Identifies all testable endpoints, parameters, and attack vectors
- Targeted Exploitation: Spawns specialized agents to test each discovered target
Required Options
string
required
Target URL, domain, or IP address to testExamples:
https://example.comhttp://192.168.1.100:8080example.com(assumes HTTPS)
Optional Parameters
string
Path to source code directory for whitebox testingWhen provided, Pensar analyzes the source code to build a comprehensive attack surface map, enabling deeper vulnerability discovery.Default: None (blackbox mode)Example:
string
Pentest mode configurationSupported values:
exfil- Exfiltration mode with pivoting and flag extraction
Exfiltration mode is designed for CTF-style challenges and authorized red team exercises where the goal is to extract specific flags or data.
string
AI model to use for security analysisDefault:
claude-sonnet-4-5Supported models:claude-sonnet-4-5(recommended)claude-opus-4-0gpt-4ogpt-4-turbo- Custom models via OpenRouter or local vLLM
Examples
Basic Blackbox Pentest
Test a web application without source code access:Whitebox Pentest with Source Code
Analyze source code for comprehensive vulnerability discovery:Exfiltration Mode (CTF/Red Team)
Run pentest with pivoting and flag extraction:Custom Model Selection
Use a different AI model:CI/CD Integration
Run automated security testing in CI/CD pipelines:Output Files
The pentest command generates structured output in the session directory:findings.json
JSON file containing all discovered vulnerabilities:pocs/
Directory containing proof-of-concept exploit scripts:report.md
Human-readable markdown report:Use Cases
- Web Application Security
- API Security Testing
- Code-Assisted Pentest
- CTF Challenges
Test web applications for common vulnerabilities:Discovers:
- SQL injection
- XSS vulnerabilities
- Authentication bypasses
- Authorization flaws
- API security issues
Pentest Workflow
The pentest command follows a structured workflow:Environment Variables
string
API key for Claude models (recommended for best results)
string
API key for GPT models
string
API key for OpenRouter multi-model access
Troubleshooting
No Vulnerabilities Found
If the pentest completes with no findings:-
Verify target is accessible:
-
Try whitebox mode if you have source code:
-
Check session logs for errors:
Authentication Required
For targets requiring authentication:-
Launch the TUI and use the authentication wizard:
- Or use targeted-pentest with manual session setup
Rate Limiting
If you encounter rate limiting:Related Commands
- targeted-pentest - Focused testing with specific objectives
- pensar - Interactive TUI with manual control
- doctor - Verify system configuration
Next Steps
Interpreting Results
Learn how to analyze pentest findings
Writing POCs
Customize and validate proof-of-concept exploits

