targeted-pentest command runs a focused security assessment against specific testing objectives, ideal for investigating particular vulnerability classes or security concerns.
Syntax
Description
Unlike the fullpentest command which performs comprehensive attack surface discovery, targeted-pentest focuses exclusively on your specified objectives. This makes it ideal for:
- Testing specific vulnerability hypotheses
- Focused security audits
- Regression testing after security fixes
- Investigating specific attack vectors
Required Options
string
required
Target URL, domain, or IP address to testExamples:
https://example.comhttp://192.168.1.100:8080api.example.com
string
required
Testing objective or security goal (repeatable)Define what you want to test. You can specify multiple objectives by using the flag multiple times.Examples:
"Test for SQL injection in login form""Check authentication bypass vulnerabilities""Verify session management security""Test file upload restrictions"
At least one
--objective is required. You can specify multiple objectives to test several attack vectors in a single run.Optional Parameters
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
Single Objective Testing
Test for SQL injection vulnerabilities:Multiple Objectives
Test several security aspects in one run:API Security Testing
Focus on REST API vulnerabilities:Custom Model Selection
Use a specific model for testing:Regression Testing
Verify that a security fix works:File Upload Security
Test file upload functionality:Output Files
The targeted-pentest command generates output files in the session directory:findings.json
JSON file with discovered vulnerabilities:pocs/
Proof-of-concept exploit scripts:Use Cases
- Hypothesis Testing
- Compliance Audits
- Regression Testing
- Bug Bounty
Test a specific vulnerability theory:Perfect for:
- Security research
- Validating suspicions
- Focused investigations
Objective Writing Tips
Be Specific
Include Context
Reference Standards
Comparison with Full Pentest
Use
pentest for initial security assessments and targeted-pentest for focused investigations or regression testing.Environment Variables
string
API key for Claude models (recommended)
string
API key for GPT models
string
API key for OpenRouter
Troubleshooting
Objective Not Being Tested
If your objective isn’t being addressed:-
Make it more specific:
-
Break down complex objectives:
No Findings
If the test completes with no findings:- The target may be secure for the tested objectives ✅
- Try rephrasing your objectives
- Use the full
pentestcommand for broader testing - Check logs:
~/.pensar/sessions/*/agent.log
Authentication Required
For authenticated testing:Related Commands
- pentest - Comprehensive automated pentest
- pensar - Interactive TUI with manual control
- doctor - Check system configuration
Next Steps
Writing Objectives
Learn to write effective security testing objectives
Interpreting Results
Understand and act on pentest findings

