External web app to an internal foothold
A classic external penetration test: from internet-facing recon, through a web-application flaw, to a web shell and a pivot into the internal network.
Scenario
You have a signed scope covering a company's public web application and its external IP range. The goal is to demonstrate whether an internet-based attacker can reach the internal network. Nothing is assumed — you start with only the in-scope domain.
- 1
Reconnaissance
Map the external attack surface
T1595.002 Active Scanning: Vulnerability ScanningT1592 Gather Victim Host InformationT1593 Search Open Websites/DomainsEnumerate subdomains, resolve hosts, fingerprint the web stack and run a focused service scan over the in-scope range. Catalogue every app, login page, API and exposed admin panel, and note software versions for later.
DetectionBursts of DNS lookups, port scans and 404/robots probing from a single source show up in WAF and perimeter IDS logs and in web-server access logs.
MitigationReduce external surface: retire stale subdomains, hide version banners, rate-limit and geo/WAF-filter noisy scanning, and keep an accurate asset inventory.
- 2
Initial Access
Exploit a public-facing application flaw
Probe the highest-value inputs for the common server-side classes — injection, unrestricted file upload, SSRF, deserialization. Confirm a single reliable, in-scope vulnerability rather than chaining risky payloads blindly.
DetectionWAF signatures, spikes of 500 errors, and anomalous query patterns in application logs; file-integrity monitoring on web roots flags newly written files.
MitigationValidate and parameterize all input, constrain uploads by type/with out-of-webroot storage, patch frameworks, and run a WAF in blocking mode.
- 3
Execution / Persistence
Gain command execution via a web shell
Where the flaw allows it, place a minimal authenticated web shell to turn the web vulnerability into interactive command execution on the server, documenting exactly what was dropped and where for clean-up.
DetectionNew or modified files in the web root, web-server processes spawning shells, and outbound connections from the web tier are strong signals in EDR and web-server logs.
MitigationRead-only/immutable web roots, least-privilege service accounts, egress filtering from the web tier, and alerting on web-server child processes.
- 4
Discovery
Understand the host and find reachable internal systems
T1046 Network Service DiscoveryT1083 File and Directory DiscoveryT1552.001 Unsecured Credentials: Credentials In FilesFrom the foothold, enumerate the local host, configuration files and environment, and discover which internal services and segments are reachable from this DMZ host.
DetectionInternal scanning from a DMZ host, reads of sensitive config files, and unusual east-west connections appear in NetFlow and host telemetry.
MitigationSegment the DMZ from internal networks, store secrets in a vault (not config files), and monitor for internal scanning originating in the DMZ.
- 5
Lateral Movement (Pivot)
Tunnel into the internal network
Set up a controlled proxy/tunnel through the foothold so in-scope internal systems can be reached for the next phase, keeping all traffic within the authorized scope.
DetectionLong-lived encrypted tunnels, proxy software on a web server, and traffic to internal hosts that the DMZ host never normally contacts.
MitigationStrict egress and east-west firewall rules, allow-listed outbound destinations, and detection of tunneling/proxy binaries on servers.
Key takeaways
- One exploitable web flaw plus a flat network is enough to turn an external test into an internal compromise.
- Segmentation and egress control between the DMZ and internal network are what break this chain.
- Every offensive step leaves telemetry — recon, file writes, tunnels — so defenders have multiple catch points.