--- id: security-pen-testing title: Pen Testing — Manual / Tool / Bug Bounty category: Coding status: draft source_trust_level: B verification_status: conceptual created_at: 2026-05-09 updated_at: 2026-05-09 tags: [security, pen-testing, bug-bounty, vibe-coding] tech_stack: { language: "Various", applicable_to: ["Security"] } applied_in: [] aliases: [pen testing, penetration testing, bug bounty, OWASP, Burp Suite, recon] --- # Pen Testing > 의도적 attack — 보안 약점 발견. **Internal team / external firm / bug bounty**. OWASP methodology + Burp Suite + 자동 + manual. ## 📖 핵심 개념 - Recon: 정보 수집. - Scanning: vulnerability 자동 검색. - Exploitation: 실제 attack. - Reporting: severity + remediation. ## 💻 코드 패턴 ### OWASP Testing Guide ``` 1. Information gathering 2. Configuration / deployment 3. Identity management 4. Authentication 5. Authorization 6. Session management 7. Input validation 8. Error handling 9. Cryptography 10. Business logic 11. Client-side 12. API testing ``` → Systematic checklist. ### Burp Suite (가장 인기) ``` Free / Pro version. Features: - Proxy (HTTPS intercept) - Scanner (auto vulnerabilities) - Repeater (manual replay) - Intruder (fuzz / brute) - Decoder - Comparer - Extensions (마켓플레이스) ``` ``` Workflow: 1. Configure browser → Burp proxy 2. Browse app — Burp 가 capture 3. Send request to Repeater — 수정 + replay 4. Active scan — 자동 vulnerability ``` ### OWASP ZAP (free alternative) ```bash # Quick scan docker run -t owasp/zap2docker-stable zap-baseline.py -t https://example.com # Full scan docker run -v $(pwd):/zap/wrk owasp/zap2docker-stable \ zap-full-scan.py -t https://example.com -r report.html ``` → [[DevSec_DAST_SAST]]. ### Recon tools ```bash # Subdomain enum subfinder -d example.com amass enum -d example.com # Port scan nmap -sV -sC example.com # Web tech whatweb https://example.com wappalyzer (browser ext) # Wayback gau example.com waybackurls example.com ``` ### Hidden endpoints (fuzz) ```bash ffuf -w wordlist.txt -u https://example.com/FUZZ # 또는 dirsearch / gobuster dirsearch -u https://example.com -e php,html,js # JSON API ffuf -w wordlist.txt -u https://api.example.com/v1/FUZZ -mc 200,201 ``` ### Authentication test ``` - Default credentials (admin/admin) - Weak password policy - Brute force (lockout?) - Account enumeration (다른 응답 — exists / not) - Password reset (token guessable?) - 2FA bypass - Session fixation - JWT 문제 (alg=none, secret weak) ``` ```bash # Brute force test hydra -L users.txt -P passwords.txt example.com http-post-form "/login:user=^USER^&pass=^PASS^:Invalid" # JWT jwt-cracker -t $JWT ``` ### Authorization (IDOR / privilege escalation) ``` - /api/users/123 — User 1 가 User 2 의 data 봄? - Admin endpoint — regular user 가 호출? - Forced browsing - 다른 HTTP verb (DELETE 가 차단 X?) ``` ```bash # Burp — response 비교 # Request 1: User A 의 data # Request 2: 같은 endpoint, User B 의 token # 같은 응답 = IDOR ``` ### Input validation (SQLi, XSS, etc) ```bash # SQLi sqlmap -u "https://example.com/products?id=1" --dbs # XSS # Burp Intruder 가 payload list # Command injection ; ls && cat /etc/passwd | whoami $(id) ``` ### XSS payload ```html javascript:alert(1) # Bypass filter