协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
pentesting【开发与工程】Use this skill when the user asks about penetration testing, pentest, security assessment, vulnerability assessment, bug bounty, ethical hacking, or red team operations.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Produce structured penetration testing reports with methodology, severity-classified findings, evidence format, and remediation tracking.
User request includes: pentest, penetration test, security test, bug bounty, vulnerability assessment, ethical hacking, red team, security assessment.
A markdown document containing:
Produce the artifact directly. No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
4096 tokens
Document in-scope and out-of-scope targets, testing methodology (black/grey/white box), timeframe, and tools.
Follow OWASP/OSSTMM methodology, covering injection, auth, access control, XSS, SSRF, misconfiguration, crypto, and info leakage.
Score each finding using CVSS 3.1 and assign severity (Critical/High/Medium/Low/Info).
Summarize scope, overall risk rating, key findings count, and business impact for non-technical stakeholders.
Each finding includes: title, severity, CVSS score, status, location, description, impact, reproduction steps, evidence, recommendation.
Map each finding to an owner with a fix timeline per severity SLA.
Perform threat modeling using STRIDE or PASTA before testing. Identify assets, threat agents, attack vectors, and security controls. Prioritize testing based on threat model findings. Map test cases to threats.
Gather information about targets: DNS enumeration, subdomain discovery, technology fingerprinting, endpoint discovery, directory brute force, parameter discovery. Document all discovered surface area.
Correlate findings across test types. Eliminate false positives. Chain vulnerabilities to demonstrate realistic impact. Validate each finding manually. Prioritize chained attack paths.
Generate structured report. Hold findings review with development team. Track remediation in issue tracker. Schedule retesting after fixes. Update risk register.
| Aspect | OWASP | PTES | OSSTMM | NIST SP 800-115 |
|---|---|---|---|---|
| Focus | Web applications | Full penetration test | Security metrics | Technical assessment |
| Structure | 12 testing categories | 7 phases | 5 channels (physical, human, wireless, telecom, data) | 4 phases |
| Scoring | Risk rating methodology | CVSS + custom | STAR (Security Test Audit Report) | N/A |
| Best For | Web app pentesting | Comprehensive pentest | Audit/compliance | Government/enterprise |
| Maturity | Highly mature | Moderate | Very mature | Highly mature |
| Industry adoption | Most widely adopted | Common | Less common | Government standard |
What is being tested?
├── Web application
│ ├── Internal app → Grey box, OWASP methodology
│ └── External app → Black box + grey box, OWASP, DAST + manual
├── Mobile application
│ ├── iOS → IPA analysis, runtime manipulation, network interception
│ └── Android → APK analysis, rooted device testing, intent fuzzing
├── API / Microservices
│ └── Grey box, OpenAPI-based testing, auth testing, injection, rate limiting
├── Cloud infrastructure
│ ├── AWS → IAM analysis, S3 permissions, CloudTrail audit
│ ├── GCP → IAM, GKE security, Cloud SQL audit
│ └── Azure → RBAC, Key Vault, App Service, AKS security
├── Network infrastructure
│ ├── Internal → Lateral movement, AD security, network segmentation
│ └── External → Port scanning, service enumeration, exploit testing
└── Physical / Social engineering
└── OSSTMM methodology, physical access testing, phishing simulation
| Type | Reconnaissance | Access | Knowledge | Accuracy | Coverage | Cost |
|---|---|---|---|---|---|---|
| Black box | Full | None | None | Medium | Low | High |
| Grey box | Targeted | Some | Architecture | High | Medium | Medium |
| White box | Technical docs | Full access | Full code | Very high | High | Low |
| DAST | None | None | None | High | Medium | Low |
| SAST | Full source | Full code | Full | Medium | High | Low-medium |
| Bug bounty | None | None | None | High | Variable | Pay per finding |
Starting a pentest without clearly documented scope leads to disputes about what was included, missed targets, and wasted effort. Always define in-scope and out-of-scope in writing. Include URL/IP lists and explicit exclusions.
Automated scanners produce high false-positive rates and miss logic flaws, business logic vulnerabilities, and chained attacks. DAST tools only catch known patterns. Manual testing is essential for high-severity findings.
Reporting scanner output without manual validation produces reports full of false positives that teams learn to ignore. Manually validate every finding before including it in the report. Document validation steps in the finding.
Findings without clear reproduction steps, request/response pairs, or screenshots cannot be reproduced or fixed. Document evidence as you go — recreating evidence later is time-consuming and error-prone.
Reporting a CVSS score without the vector string makes the score meaningless — it cannot be verified or recalculated if the environment changes. Always include the full vector string.
Many testers check basic login/logout but miss IDOR, privilege escalation, session fixation, and JWT vulnerabilities. These are often the highest-impact findings. Dedicate significant testing time to auth and access control.
Automated scanners don't test business logic — multi-step workflows, approval chains, financial calculations, and user role interactions. Manual business logic testing frequently finds critical vulnerabilities.
Finding vulnerabilities without actionable remediation guidance frustrates development teams and delays fixes. Every finding must include specific, actionable recommendation code snippets where possible.
Including live credentials, real customer data, or internal IP addresses in reports creates a secondary security incident. Sanitize all evidence before including it in the report.
Remediation verification is as important as initial testing. Without retesting, you cannot confirm that fixes are effective or that they haven't introduced new issues. Schedule retesting as part of the engagement.
engagement:
title: External Web Application Pentest
client: Acme Corp
date: 2026-04-15 to 2026-04-26
methodology: OWASP Web Application Testing Guide v4.2
testing_type: Grey box
in_scope:
targets:
- https://app.acme.com
- https://api.acme.com/v2
- https://admin.acme.com
testing_allowed:
- Authentication and session testing
- Injection testing
- Business logic testing
- Access control testing
out_of_scope:
- Third-party services (Auth0, Stripe, AWS)
- Denial of Service attacks
- Physical security
- Social engineering
- Employee accounts (testing accounts provided)
rules_of_engagement:
- Testing hours: 08:00 - 18:00 local time only
- No destructive testing without approval
- Emergency contact: security@acme.com / +1-555-0123
- Report critical findings immediately, not in final report
- Data handling: all data destroyed 30 days after report delivery
finding:
id: PENTEST-2026-001
title: SQL Injection in Order Search
severity: Critical
cvss: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
cvss_score: 9.8
status: Open
location: "POST /api/v2/orders/search (order-service)"
discovered: 2026-04-16
description: |
The `q` parameter in the order search endpoint is directly concatenated
into SQL queries without parameterization or sanitization.
impact: |
An unauthenticated attacker can extract, modify, or delete all database
records, including user credentials, payment information, and order data.
reproduction:
- Step 1: Intercept request to POST /api/v2/orders/search
- Step 2: Set payload: q=1' OR '1'='1
- Step 3: Observe that all orders are returned instead of user's orders
- Step 4: Extract data using UNION-based injection
evidence:
request: "POST /api/v2/orders/search HTTP/1.1\nContent-Type: application/json\n\n{\"q\":\"1' OR '1'='1\"}"
response: "HTTP/1.1 200 OK\n... (150 orders returned, including orders from other users)"
recommendation: |
Replace string concatenation with parameterized queries:
```python
cursor.execute("SELECT * FROM orders WHERE user_id = %s AND search LIKE %s",
(user_id, f"%{search_term}%"))
```
remediation:
owner: team-orders
due_date: 2026-04-17
verification: Re-test after deployment to staging
references:
- https://owasp.org/www-community/attacks/SQL_Injection
- https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
| Tool Category | Recommended Tools | Use Case | Cost |
|---|---|---|---|
| Scanner (web) | Burp Suite Professional, OWASP ZAP | Web app scanning | $ / Free |
| Scanner (network) | Nessus, OpenVAS | Network vulnerabilities | $ / Free |
| Scanner (cloud) | ScoutSuite, Prowler, CloudSploit | Cloud config review | Free |
| Reconnaissance | Amass, Sublist3r, ffuf, gau, httpx | Subdomain and endpoint discovery | Free |
| Exploitation | Metasploit, Cobalt Strike | Post-exploitation | Free / $$ |
| Mobile | MobSF, Frida, objection, jadx | Mobile app analysis | Free |
| Wireless | Aircrack-ng, Kismet, Reaver | Wireless security | Free |
| Password | Hashcat, John the Ripper, Hydra | Password cracking | Free |
| OSINT | Maltego, theHarvester, Shodan | Intelligence gathering | Free / $ |
| DAST | Burp Scanner, Acunetix, Netsparker | Automated web scanning | $ / $$ |
| SAST | Semgrep, CodeQL, SonarQube | Source code analysis | Free / $ |
| API | Postman, Insomnia, Burp | API security testing | Free / $ |
During a grey-box pentest of an e-commerce platform, the tester found a SQL injection in the order search endpoint. The automated scanner flagged the parameter but the test team validated it manually by extracting database version and table structure. Chaining this with an information disclosure finding (debug endpoint exposed database schema) demonstrated complete database compromise. Remediation: parameterized queries implemented within 4 hours of the finding being reported.
An infrastructure pentest of an AWS environment using ScoutSuite found 47 S3 buckets with public read access. Manual validation confirmed that 12 buckets contained PII (customer names, emails, purchase history). The finding was escalated to CISO within 24 hours. Remediation: S3 bucket policies updated, CloudTrail enhanced, and automated compliance scanning implemented.
During an API pentest, manual business logic testing revealed that a payment API did not validate that the requesting user owned the order they were paying for. An attacker could change another user's order amount from $100 to $0.01 and pay the reduced amount. No automated scanner would catch this. Remediation: server-side ownership validation was added.
A mobile app pentest using Frida and runtime manipulation discovered that the app accepted unsigned JWTs with arbitrary user IDs. The finding was validated by creating a JWT with {"sub": "admin", "role": "admin"} and no signature, which the server accepted. Root cause: the server verification library was misconfigured in "debug mode". Remediation: JWT signature verification properly configured, production configs reviewed.
| Severity | CVSS 3.1 | Impact | Exploitability | Count |
|---|---|---|---|---|
| Critical | 9.0-10.0 | Complete compromise | Easy, public exploit | # |
| High | 7.0-8.9 | Significant data/access | Moderate | # |
| Medium | 4.0-6.9 | Limited impact | Complex | # |
| Low | 0.1-3.9 | Minimal | Very complex | # |
| Info | 0.0 | No direct risk | N/A | # |
Each finding MUST contain:
ID: PENTEST-2026-001 Severity: Critical (CVSS 9.8) Status: Open / Fixed / Accepted / Mitigated Location: POST /api/v2/orders/search (order-service)
The q parameter is directly concatenated into SQL query without parameterization.
An attacker can extract, modify, or delete all database records.
q=1' OR '1'='1Request: POST /api/orders/search Payload: q=1' OR '1'='1 Response: 200 OK (150 orders returned, including orders from other users)
Replace string concatenation with parameterized queries.
| Severity | Fix Timeline | Verification | Escalation |
|---|---|---|---|
| Critical | 24 hours | Re-test required | CISO |
| High | 7 days | Re-test required | Security lead |
| Medium | 30 days | Code review | Engineering manager |
| Low | 90 days | Code review | Team lead |
| Category | Finding | Typical Severity |
|---|---|---|
| Injection | SQL, NoSQL, Command, LDAP injection | Critical/High |
| Auth | Broken authentication, session fixation, weak password policy | Critical/High |
| Access Control | IDOR, privilege escalation, missing function-level access control | High |
| XSS | Stored, Reflected, DOM-based | Medium/High |
| SSRF | Server-side request forgery | High |
| Misconfiguration | Default credentials, debug endpoints, CORS misconfig | Medium |
| Crypto | Weak TLS, hardcoded keys, weak hashing | Medium |
| Info Leakage | Stack traces, error messages, directory listing | Low/Info |
Hand off to management/security/SKILL.md for vulnerability remediation workflow. Hand off to management/alerting/SKILL.md for detection rule creation.
| Decision Point | Option A | Option B | Decision Criteria |
|---|---|---|---|
| Knowledge level | Black box (realistic external) | White box (thorough coverage) | Budget, compliance requirements |
| Methodology | OWASP WSTG (web-focused) | PTES (comprehensive) | Application type, org maturity |
| Tool selection | Automated scanners (efficient) | Manual testing (deep findings) | Time constraints, finding quality needs |
`markdown
| Risk Level | Count | Examples |
|---|---|---|
| Critical | {n} | {titles} |
| High | {n} | {titles} |
| Medium | {n} | {titles} |
| Low | {n} | {titles} |
| ` |
`markdown
| Anti-Pattern | Symptom | Solution |
|---|---|---|
| Scanner-only testing | 50+ false positives, no real findings | Always manually verify scanner findings |
| No retest window | Findings never get validated | Contractually require retest within 30 days |
| Scope creep | Missed critical areas due to unfocused testing | Strictly define scope and stick to it |
| Findings without business context | Management ignores report | Add business impact, regulatory risk, remediation cost |
| No evidence | Cannot reproduce findings | Screenshots, request/response pairs, proof of concept |