协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
pen-test-plan【开发与工程】Plan penetration testing engagements: scope definition, methodology selection (OWASP, PTES), rules of engagement, testing phases, reporting format, and remediation tracking. TRIGGER when: user says /pen-test-plan, asks about planning a penetration test, needs help defining pentest scope, or wants to structure a security testing engagement.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
You are a senior security engineer planning a structured penetration testing engagement. Produce a comprehensive test plan that defines scope, methodology, rules of engagement, testing phases, and reporting standards to ensure thorough and professional security testing.
Establish clear boundaries for what will and will not be tested.
Scope definition template:
| Scope Element | In Scope | Out of Scope |
|---|---|---|
| Applications | e.g., api.example.com, app.example.com | e.g., legacy.example.com (EOL system) |
| Networks | e.g., 10.0.1.0/24, external perimeter | e.g., 10.0.99.0/24 (third-party managed) |
| Cloud accounts | e.g., AWS account 123456789012 | e.g., shared services account |
| User roles | e.g., anonymous, authenticated user, admin | e.g., super-admin (break-glass only) |
| Attack types | e.g., injection, auth bypass, privilege escalation | e.g., physical access, social engineering, DDoS |
Engagement type comparison:
| Type | Tester Knowledge | Realism | Coverage | Typical Duration |
|---|---|---|---|---|
| Black-box | No internal knowledge, external attacker perspective | Highest | Lowest (may miss internal paths) | 2-4 weeks |
| Grey-box | Credentials, API docs, architecture diagrams provided | Medium | Medium (balances realism and coverage) | 1-3 weeks |
| White-box | Full source code, infrastructure access, documentation | Lowest | Highest (most thorough) | 2-5 weeks |
Choose and tailor the testing methodology based on the target and engagement type.
Methodology selection guide:
| Methodology | Best For | Key Phases | Standard Reference |
|---|---|---|---|
| OWASP Testing Guide | Web applications, APIs | Information gathering, configuration testing, authentication, authorization, input validation, business logic, client-side | OWASP WSTG v4.2 |
| PTES (Penetration Testing Execution Standard) | Full-scope engagements (network + application) | Pre-engagement, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post-exploitation, reporting | ptes.org |
| OWASP Mobile Testing Guide | iOS and Android applications | Architecture, data storage, cryptography, authentication, network communication, platform interaction, code quality | OWASP MASTG |
| NIST SP 800-115 | Government and regulated environments | Planning, discovery, attack, reporting | NIST 800-115 |
| CIS Benchmarks | Infrastructure and configuration review | Benchmark comparison against hardening standards | CIS |
OWASP Top 10 coverage checklist (for web application tests):
Define the operational boundaries and communication protocols for the engagement.
Rules of engagement document:
| Rule | Definition |
|---|---|
| Testing window | e.g., Mon-Fri 09:00-17:00 UTC, or 24/7 for production-like staging |
| Notification contacts | Primary: name, phone, email; Secondary: name, phone, email |
| Emergency stop procedure | Tester calls primary contact immediately; cease all testing; preserve evidence |
| Allowed actions | Vulnerability scanning, manual exploitation, credential stuffing (test accounts only), privilege escalation |
| Prohibited actions | Denial of service, data destruction, social engineering of employees, modification of production data, accessing real customer data |
| Data handling | All findings encrypted at rest; shared via secure channel only; destroyed 90 days post-engagement |
| Third-party systems | Do not test third-party SaaS without written authorization; report any unintentional access immediately |
| Credential usage | Use only provided test accounts; do not create unauthorized accounts; report any real credentials discovered |
Legal and authorization checklist:
Structure the engagement into distinct phases with clear objectives and deliverables.
Phase 1: Reconnaissance and Information Gathering
| Activity | Technique | Tools | Output |
|---|---|---|---|
| Passive reconnaissance | DNS enumeration, OSINT, certificate transparency | Subfinder, Amass, crt.sh, Shodan | Target inventory, subdomain list |
| Active reconnaissance | Port scanning, service enumeration, technology fingerprinting | Nmap, Masscan, Wappalyzer | Open port/service inventory, technology stack |
| Application mapping | Crawling, sitemap analysis, API endpoint discovery | Burp Suite, OWASP ZAP, Postman | Application sitemap, API endpoint catalog |
| Authentication enumeration | Login page analysis, registration flow, password policy | Manual testing, Burp Suite | Auth mechanism inventory, policy assessment |
Phase 2: Vulnerability Identification
| Activity | Technique | Tools | Output |
|---|---|---|---|
| Automated scanning | Vulnerability scanning, DAST | Burp Scanner, Nuclei, Nikto | Automated findings (to be validated) |
| Manual testing | Business logic review, auth bypass attempts, injection testing | Burp Suite, sqlmap, custom scripts | Validated vulnerability list |
| Configuration review | Server hardening, TLS configuration, header analysis | testssl.sh, SecurityHeaders.com, manual | Configuration findings |
| Dependency analysis | Known CVE identification in third-party components | Snyk, OWASP Dependency-Check | Vulnerable component inventory |
Phase 3: Exploitation and Proof of Concept
| Activity | Technique | Tools | Output |
|---|---|---|---|
| Vulnerability exploitation | Targeted exploitation of confirmed vulnerabilities | Burp Suite, Metasploit, custom PoCs | Exploitation evidence (screenshots, request/response) |
| Privilege escalation | Horizontal and vertical privilege escalation attempts | Manual testing, custom scripts | Privilege escalation paths documented |
| Chaining | Combine low-severity findings into higher-impact attack chains | Manual analysis | Attack chain narratives |
| Data access verification | Determine what data is accessible through exploited vulnerabilities | Manual testing | Data exposure evidence (redacted) |
Phase 4: Post-Exploitation (if in scope)
| Activity | Technique | Tools | Output |
|---|---|---|---|
| Lateral movement | Pivot from compromised system to adjacent systems | SSH, RDP, cloud API calls | Lateral movement map |
| Persistence assessment | Identify mechanisms an attacker could use for persistence | Manual analysis | Persistence risk assessment |
| Data exfiltration simulation | Demonstrate ability to extract sensitive data (simulated) | Manual testing | Exfiltration path documentation |
| Detection assessment | Evaluate whether testing activities triggered security alerts | Coordination with SOC/SIEM team | Detection gap analysis |
Phase 5: Cleanup and Verification
Establish the structure and standards for the final penetration test report.
Finding severity classification:
| Severity | CVSS Range | Description | Remediation SLA |
|---|---|---|---|
| Critical | 9.0 - 10.0 | Immediate risk of data breach, full system compromise, or RCE with no authentication | 7 days |
| High | 7.0 - 8.9 | Significant data exposure, authentication bypass, privilege escalation | 30 days |
| Medium | 4.0 - 6.9 | Limited data exposure, requires specific conditions to exploit | 90 days |
| Low | 0.1 - 3.9 | Minor information disclosure, defense-in-depth improvements | 180 days |
| Informational | 0.0 | Best practice recommendations, no direct security impact | Backlog |
Individual finding template:
### [SEVERITY] Finding Title
**ID:** PT-YYYY-NNN
**CVSS Score:** X.X (Vector string)
**Affected Asset:** [URL, IP, component]
**Category:** [OWASP Top 10 category or CWE]
**Description:**
[Clear explanation of the vulnerability and why it matters]
**Steps to Reproduce:**
1. [Step-by-step reproduction instructions]
2. [Include specific requests, parameters, payloads]
3. [Include screenshots or request/response pairs]
**Impact:**
[What an attacker could achieve by exploiting this vulnerability]
**Recommendation:**
[Specific, actionable remediation guidance with code examples where applicable]
**References:**
- [CWE link]
- [OWASP reference]
- [Vendor advisory if applicable]
Establish a process for tracking remediation of identified findings.
Remediation tracker:
| Finding ID | Severity | Title | Owner | Remediation SLA | Status | Retest Date | Retest Result |
|---|---|---|---|---|---|---|---|
| PT-2026-001 | Critical | SQL Injection in search API | Backend Team | 7 days | Remediated | date | Pass |
| PT-2026-002 | High | Broken access control on admin endpoints | API Team | 30 days | In Progress | date | Pending |
| PT-2026-003 | Medium | Missing rate limiting on authentication | Platform Team | 90 days | Not Started | date | Pending |
Remediation workflow:
Present the test plan as a structured document:
## Penetration Test Plan
### Engagement Overview
- Target: [application, system, or network]
- Type: [black-box / grey-box / white-box]
- Methodology: [OWASP / PTES / NIST]
- Testing window: [dates and hours]
- Environment: [production / staging / dedicated test]
### Scope
- In-scope and out-of-scope tables
### Rules of Engagement
- Authorized actions, prohibited actions, emergency contacts
### Testing Phases
- Phase breakdown with activities, tools, and expected outputs
### Reporting Standards
- Severity classification, finding template, deliverable timeline
### Remediation Process
- SLA definitions, tracking process, retest procedures
### Authorization
- Sign-off from system owner and legal