Lesson 6 / 10
Module 6Lesson 1⏱ 50 min study

Lesson 6: Black-Box Penetration Testing & Web Application Assessment

Execute structured penetration testing workflows, exploit runtime application vulnerabilities across the OWASP Top 10, and deploy dynamic analysis proxies.

✦ Key Architectural Takeaways
  • •Black-box assessments test systems from the perspective of an external attacker with zero prior inside knowledge.
  • •The penetration testing methodology follows Reconnaissance, Scanning, Exploitation, Post-Exploitation, and Reporting.
  • •Server-Side Request Forgery (SSRF) allows attackers to coerce backend servers into querying internal metadata APIs (such as AWS 169.254.169.254).
  • •Cross-Site Scripting (XSS) executes arbitrary JavaScript in a victim's browser, leading to session hijacking and credential theft.
  • •Dynamic Application Security Testing (DAST) analyzes live HTTP request-response patterns using intercepting proxies like OWASP ZAP and Burp Suite.

1. The Methodological Penetration Testing Workflow

Professional penetration testing must adhere to rigorous industry standards (such as the Penetration Testing Execution Standard - PTES):

ARCHITECTURE DIAGRAMSYSTEM SCHEMATIC
1. Reconnaissance & OSINT
   (DNS enumeration, sublist3r, certificate transparency logs)
           |
           v
2. Attack Surface Mapping & Vulnerability Scanning
   (Nmap port scanning, tech stack fingerprinting via Wappalyzer)
           |
           v
3. Active Vulnerability Exploitation
   (Testing injection points, authentication bypasses, SSRF, IDOR)
           |
           v
4. Post-Exploitation & Lateral Movement
   (Privilege escalation, token harvesting, persistence validation)
           |
           v
5. Comprehensive Reporting & Remediation Roadmap
   (CVSS v3.1 scoring, executive summary, reproduction steps)
§

2. Exploiting Server-Side Request Forgery (SSRF)

In cloud-native environments, Server-Side Request Forgery (SSRF) is one of the most critical vulnerabilities. It occurs when a web server fetches a remote resource (such as downloading a profile image from a URL) based on user-supplied input without validating the destination IP address:

ARCHITECTURE DIAGRAMSYSTEM SCHEMATIC
Attacker                                 Vulnerable Cloud Web Server
   |                                                  |
   | HTTP POST /api/fetch-avatar                      |
   | url: "http://169.254.169.254/latest/meta-data/"  |
   +------------------------------------------------->|
                                                      | Outbound GET to
                                                      | Local Cloud Metadata
                                                      v
                                       [ AWS / GCP Link-Local Metadata Service ]
                                       (169.254.169.254)
                                                      |
                                                      | Returns IAM Credentials
                                                      | (AccessKey, SecretKey, Token)
                                                      v
   |<-------------------------------------------------+
   | Attacker extracts Cloud Admin Credentials!

Remediation Best Practices:

  1. 1Network Segmentation: Block outgoing connections from application tiers to link-local metadata addresses (169.254.169.254/32) via host firewalls or Kubernetes NetworkPolicies.
  2. 2IMDSv2 (Session-Oriented Metadata): Enforce AWS IMDSv2, which mandates generating a cryptographic session token via HTTP PUT before metadata can be queried—neutralizing simple SSRF queries.
  3. 3Strict Whitelisting: Validate input URLs against an explicit allowlist of domain names; reject all internal IP ranges (RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.1).