Attack Surface Mapping
Overview
Attack surface mapping is the critical first step in any penetration test. Pensar Console automatically analyzes your application to identify all external attack surfaces including web pages, API endpoints, authentication flows, and more.
How It Works
The approach to attack surface mapping depends on whether you’ve provided source code access:
With Source Code
Without Source Code
When you provide source code (via VCS integration or zip upload), Pensar’s AI agents perform static analysis to identify:
- Web Routes & Endpoints: All HTTP endpoints, REST APIs, GraphQL schemas, and WebSocket connections
- Authentication Mechanisms: Login pages, OAuth flows, API key validation, and session management
- Input Vectors: Forms, query parameters, request bodies, headers, and file uploads
- External Dependencies: Third-party APIs, external services, and integrations
- Data Flows: How data moves through your application and where it’s processed or stored
Source code analysis provides the most comprehensive attack surface mapping with detailed understanding of application internals.
Pentest Objectives
For each identified endpoint in your attack surface, Pensar automatically generates pentest objectives - specific testing goals that guide how that endpoint should be tested.
What Are Pentest Objectives?
Pentest objectives are AI-generated testing strategies tailored to each unique endpoint based on:
- The endpoint’s functionality and purpose
- Input parameters and their types
- Authentication and authorization requirements
- Potential security risks specific to that endpoint
Example Objectives
User Login Endpoint
For a /api/auth/login endpoint, objectives might include:
- Test for SQL injection in username/password fields
- Verify rate limiting on failed login attempts
- Check for username enumeration vulnerabilities
- Test session token generation for randomness
- Verify secure password storage mechanisms
- Test for authentication bypass vulnerabilities
File Upload Endpoint
For a /api/files/upload endpoint, objectives might include:
- Test file type validation and extension filtering
- Verify file size limits are enforced
- Check for path traversal vulnerabilities
- Test for malicious file content detection
- Verify uploaded files cannot be executed
- Test for unrestricted file upload vulnerabilities
User Profile API
For a /api/users/:id endpoint, objectives might include:
- Test for Insecure Direct Object Reference (IDOR)
- Verify authorization checks for other users’ data
- Test for SQL injection in ID parameter
- Check for sensitive data exposure in responses
- Test mass assignment vulnerabilities
- Verify input validation on profile updates
Attack Surface Visualization
Once mapping is complete, you can view your entire attack surface in the Pensar Console:
Endpoint Inventory
Browse all discovered endpoints with details about HTTP methods, parameters, and authentication requirements.
Testing Coverage
View which endpoints have been tested, are currently being tested, or are queued for testing.
Continuous Mapping
Attack surface mapping isn’t a one-time activity:
Pensar automatically updates your attack surface map when:
- New code is pushed to your repository
- New domains are added to your project
- Reconnaissance discovers new subdomains or endpoints
- Application routes or APIs are modified
This ensures your security testing always covers your current application state, not just a point-in-time snapshot.
Benefits of Comprehensive Mapping
Ensure no endpoints are missed during security testing. Automated mapping finds endpoints that manual testing often overlooks.
Pentest objectives ensure each endpoint is tested with relevant security checks rather than generic scans.
Automated mapping is faster and more thorough than manual reconnaissance, reducing time to first findings.
Source code analysis provides context about business logic that makes vulnerability detection more accurate.
Next Steps
With your attack surface mapped, Pensar moves on to penetration testing:
- Whitebox Testing: Learn about whitebox penetration testing with source code access
- Blackbox Testing: Explore blackbox penetration testing for live applications
- View Results: Monitor testing progress and review findings in real-time through the Console dashboard