Penetration Testing
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Penetration testing (pen testing) is a simulated cyber attack on your systems to identify vulnerabilities before malicious attackers do. It's ethical hacking with explicit permission. Effective penetration testing includes planning, reconnaissance, exploitation, reporting, and remediation verification. This skill covers black box, white box, and gray box testing methodologies, common attack vectors, tools, and reporting standards.
Why This Matters
- Find vulnerabilities first: Before attackers do
- Test real-world scenarios: Simulate actual attack techniques
- Validate security investments: Confirm controls work as expected
- Meet compliance: PCI DSS, SOC 2, HIPAA require regular testing
- Reduce breach risk: Proactive identification reduces exposure
Core Concepts & Rules
1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
Inputs / Outputs / Contracts
- Inputs:
- Written authorization from system owner
- Target systems and applications
- Testing scope and rules of engagement
- Threat model and risk assessment
- Security requirements and compliance standards
- Entry Conditions:
- Written authorization obtained
- Testing scope clearly defined
- Rules of engagement agreed upon
- Testing tools and environment prepared
- Incident response plan in place
- Outputs:
- Penetration test report with findings
- Vulnerability details and evidence
- Risk ratings and impact assessment
- Remediation recommendations
- Proof of concept (PoC) exploits
- Verification results after remediation
- Artifacts Required (Deliverables):
- Executive summary of findings
- Technical vulnerability details
- Evidence screenshots and logs
- Risk assessment and ratings
- Remediation recommendations
- Proof of concept code or demonstrations
- Testing methodology and timeline
- Acceptance Evidence:
- All findings documented with severity ratings
- Evidence preserved for verification
- Vulnerabilities validated and reproducible
- Remediation recommendations actionable
- Report delivered to stakeholders
- Scope respected throughout testing
- Success Criteria:
- All high/critical vulnerabilities identified
- Risk assessment completed with ratings
- Remediation verified effective
- Report comprehensive and actionable
- Testing completed within agreed timeline
- No systems taken offline during testing
Skill Composition
- Depends on: owasp-top-10, vulnerability-management, security-audit
- Compatible with: incident-response, secrets-management, secure-coding
- Conflicts with: None
- Related Skills: web-application-security, api-security
Quick Start
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.example keys: API_KEY, DATABASE_URL (no values)
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
Anti-patterns
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: penetration-testing3description: Penetration testing (pen testing) is a simulated cyber attack on your Use when this capability is needed.4---56# Penetration Testing78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Penetration testing (pen testing) is a simulated cyber attack on your systems to identify vulnerabilities before malicious attackers do. It's ethical hacking with explicit permission. Effective penetration testing includes planning, reconnaissance, exploitation, reporting, and remediation verification. This skill covers black box, white box, and gray box testing methodologies, common attack vectors, tools, and reporting standards.1819## Why This Matters20- **Find vulnerabilities first**: Before attackers do21- **Test real-world scenarios**: Simulate actual attack techniques22- **Validate security investments**: Confirm controls work as expected23- **Meet compliance**: PCI DSS, SOC 2, HIPAA require regular testing24- **Reduce breach risk**: Proactive identification reduces exposure2526---2728## Core Concepts & Rules2930### 1. Core Principles31- Follow established patterns and conventions32- Maintain consistency across codebase33- Document decisions and trade-offs3435### 2. Implementation Guidelines36- Start with the simplest viable solution37- Iterate based on feedback and requirements38- Test thoroughly before deployment394041## Inputs / Outputs / Contracts42* **Inputs**:43 - Written authorization from system owner44 - Target systems and applications45 - Testing scope and rules of engagement46 - Threat model and risk assessment47 - Security requirements and compliance standards48* **Entry Conditions**:49 - Written authorization obtained50 - Testing scope clearly defined51 - Rules of engagement agreed upon52 - Testing tools and environment prepared53 - Incident response plan in place54* **Outputs**:55 - Penetration test report with findings56 - Vulnerability details and evidence57 - Risk ratings and impact assessment58 - Remediation recommendations59 - Proof of concept (PoC) exploits60 - Verification results after remediation61* **Artifacts Required (Deliverables)**:62 - Executive summary of findings63 - Technical vulnerability details64 - Evidence screenshots and logs65 - Risk assessment and ratings66 - Remediation recommendations67 - Proof of concept code or demonstrations68 - Testing methodology and timeline69* **Acceptance Evidence**:70 - All findings documented with severity ratings71 - Evidence preserved for verification72 - Vulnerabilities validated and reproducible73 - Remediation recommendations actionable74 - Report delivered to stakeholders75 - Scope respected throughout testing76* **Success Criteria**:77 - All high/critical vulnerabilities identified78 - Risk assessment completed with ratings79 - Remediation verified effective80 - Report comprehensive and actionable81 - Testing completed within agreed timeline82 - No systems taken offline during testing8384## Skill Composition85* **Depends on**: [owasp-top-10](file://24-security-practices/owasp-top-10/), [vulnerability-management](file://24-security-practices/vulnerability-management/), [security-audit](file://24-security-practices/security-audit/)86* **Compatible with**: [incident-response](file://24-security-practices/incident-response/), [secrets-management](file://24-security-practices/secrets-management/), [secure-coding](file://24-security-practices/secure-coding/)87* **Conflicts with**: None88* **Related Skills**: [web-application-security](file://03-backend-api/web-application-security/), [api-security](file://03-backend-api/api-security/)8990---9192## Quick Start93#9495## Assumptions / Constraints / Non-goals9697* **Assumptions**:98 - Development environment is properly configured99 - Required dependencies are available100 - Team has basic understanding of domain101* **Constraints**:102 - Must follow existing codebase conventions103 - Time and resource limitations104 - Compatibility requirements105* **Non-goals**:106 - This skill does not cover edge cases outside scope107 - Not a replacement for formal training108109110## Compatibility & Prerequisites111112* **Supported Versions**:113 - Python 3.8+114 - Node.js 16+115 - Modern browsers (Chrome, Firefox, Safari, Edge)116* **Required AI Tools**:117 - Code editor (VS Code recommended)118 - Testing framework appropriate for language119 - Version control (Git)120* **Dependencies**:121 - Language-specific package manager122 - Build tools123 - Testing libraries124* **Environment Setup**:125 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)126127128## Test Scenario Matrix (QA Strategy)129130| Type | Focus Area | Required Scenarios / Mocks |131| :--- | :--- | :--- |132| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |133| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |134| **E2E** | User Journey | Critical user flows to test |135| **Performance** | Latency / Load | Benchmark requirements |136| **Security** | Vuln / Auth | SAST/DAST or dependency audit |137| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |138139140## Technical Guardrails & Security Threat Model141142### 1. Security & Privacy (Threat Model)143* **Top Threats**: Injection attacks, authentication bypass, data exposure144- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII145- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager146- [ ] **Authorization**: Validate user permissions before state changes147148### 2. Performance & Resources149- [ ] **Execution Efficiency**: Consider time complexity for algorithms150- [ ] **Memory Management**: Use streams/pagination for large data151- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks152153### 3. Architecture & Scalability154- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection155- [ ] **Modularity**: Decouple logic from UI/Frameworks156157### 4. Observability & Reliability158- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`159- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`160- [ ] **Error Handling**: Standardized error codes, no bare except161- [ ] **Observability Artifacts**:162 - **Log Fields**: timestamp, level, message, request_id163 - **Metrics**: request_count, error_count, response_time164 - **Dashboards/Alerts**: High Error Rate > 5%165166167## Agent Directives & Error Recovery168*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*169170- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.171- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.172- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.173- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.174175176## Definition of Done (DoD) Checklist177178- [ ] Tests passed + coverage met179- [ ] Lint/Typecheck passed180- [ ] Logging/Metrics/Trace implemented181- [ ] Security checks passed182- [ ] Documentation/Changelog updated183- [ ] Accessibility/Performance requirements met (if frontend)184185186## Anti-patterns187#188189## Reference Links & Examples190191* Internal documentation and examples192* Official documentation and best practices193* Community resources and discussions194195196## Versioning & Changelog197198* **Version**: 1.0.0199* **Changelog**:200 - 2026-02-22: Initial version with complete template structure201202---203> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.204<!-- tomevault:4.0:skill_md:2026-04-13 -->