Every competent intrusion — criminal or authorised — follows a pattern. Ethical hackers describe that pattern as a lifecycle of six stages, running from quiet information gathering to a final report. Understanding the stages helps security teams commission better tests, read reports with more insight and, above all, place defensive controls where they interrupt an attacker earliest.

Methodologies divide the journey in different ways. PTES uses seven phases that begin with pre-engagement interactions, while MITRE ATT&CK lists more than a dozen tactics. The six-stage model below is a practical middle ground that most testers and defenders recognise.

Stage 1: Reconnaissance

Reconnaissance is information gathering. The goal is to understand the target well enough to choose the most promising way in.

  • Passive reconnaissance uses public sources without touching the target: DNS records, certificate transparency logs, public code repositories, job adverts that reveal technology stacks, social media and previously leaked credentials.
  • Active reconnaissance interacts with the target directly — resolving subdomains or browsing the public website, for example — while staying inside the agreed scope.

Defender's takeaway: review what your organisation publishes. Strip sensitive details from public repositories and job adverts, monitor for leaked credentials and keep an accurate inventory of internet-facing assets.

Stage 2: Scanning and enumeration

With a list of targets, the tester probes systems directly. Port scans reveal which services are listening; fingerprinting identifies their versions; vulnerability scanners compare those versions against known weaknesses. Enumeration then extracts detail: user names from directory services, shared folders, API endpoints, software banners and configuration data. Typical tooling includes Nmap for host and service discovery, a vulnerability scanner for known weaknesses and protocol-specific utilities for directories, file shares and web content.

Defender's takeaway: minimise exposed services, suppress version banners and alert on scanning patterns from unusual sources. Run your own regular scans so you see what attackers see.

Stage 3: Gaining access

This is the stage most people picture when they think of hacking. The tester exploits a weakness to obtain an initial foothold. Common routes include:

  • Exploiting an unpatched service or edge device.
  • Abusing a web application flaw such as injection or broken access control.
  • Signing in with weak, default or previously leaked credentials.
  • Social engineering, such as a phishing email that captures credentials — only where the rules of engagement allow it.

Ethical testers prove access with minimal impact: reading a harmless file, capturing a screenshot or creating a clearly labelled marker, rather than altering data.

Defender's takeaway: patch internet-facing systems quickly, enforce multi-factor authentication and test applications before release.

Stage 4: Maintaining access and escalating

A single foothold is rarely the end goal. Attackers want persistence — a way back in — and higher privileges. During this stage the tester:

  • Escalates privileges locally, for example by abusing misconfigured services or unpatched kernels.
  • Harvests credentials from memory, configuration files or browser stores.
  • Moves laterally to other systems using those credentials.
  • Demonstrates persistence mechanisms such as scheduled tasks or new accounts, each one documented and removed afterwards.

This stage reveals the true blast radius of the initial weakness. A low-severity foothold that leads to full domain control is, in practice, a critical risk.

Defender's takeaway: apply least privilege, segment networks, protect credentials with unique local administrator passwords and tiered administration, and monitor for lateral movement.

Stage 5: Covering tracks

Real attackers clear logs, disguise their tools and blend in with normal traffic to delay detection. Ethical hackers treat this stage differently. Where it is in scope, they test whether evasion would succeed — for instance, whether clearing an event log raises an alert in the security operations centre — but they never destroy evidence the client needs. Instead, the stage becomes a disciplined clean-up:

  • Removing every tool, account, file and persistence mechanism created during testing.
  • Recording exactly what was changed, where and when, so the client can confirm the environment is back to its original state.
  • Noting which actions were detected and which went unnoticed.

Defender's takeaway: forward logs to a central, tamper-resistant platform and alert on log clearing, audit policy changes and disabled security tools. Detection gaps found here are often the most valuable output of the whole test.

Stage 6: Analysis and reporting

The final stage turns technical activity into decisions. A strong report includes:

  1. An executive summary that explains business impact without jargon.
  2. Attack narratives that show how individual findings were chained.
  3. Each finding with evidence, a risk rating and precise remediation steps.
  4. Defensive recommendations: hardening, new detection rules, configuration changes and, where useful, web application firewall rules as a short-term mitigation.
  5. A retest plan to confirm the fixes work.

Reporting is where many tests succeed or fail. Findings must be reproducible, prioritised by business impact and written so that executives and engineers can both act on them without a follow-up meeting.

Mapping the lifecycle to defence

StageWhat happensControls that disrupt it
ReconnaissanceThe target is researched and mappedAttack surface management, information hygiene
ScanningWeak points are identifiedMinimal exposure, scan detection, regular internal scanning
Gaining accessA foothold is establishedPatching, MFA, secure development, email filtering
Maintaining accessAccess persists and expandsLeast privilege, segmentation, EDR, credential protection
Covering tracksActivity is hidden or cleaned upCentral logging, integrity monitoring, alerts on tampering
Analysis and reportingImpact is explained and fixes are definedRemediation tracking, retesting, lessons learned

MITRE ATT&CK describes the same journey in much finer detail, breaking it into tactics such as initial access, privilege escalation, lateral movement and defence evasion. Mapping test findings to ATT&CK techniques helps security operations teams build detections for exactly the behaviour the testers used.

Lifecycle versus red teaming

A standard penetration test moves through these stages to find as many weaknesses as possible within a fixed scope. A red team exercise follows the same stages with a narrower aim — reach a specific objective without being caught — and measures the organisation's detection and response as much as its vulnerabilities. Our red team assessment service is built for organisations that want to test both. To practise the techniques behind each stage in a lab, see our ethical hacking and penetration testing course.

Written by

Elytrix Labs Offensive Security Team

Field notes from the Elytrix Labs consultants, analysts and instructors who run our engagements and teach our courses. Every article is reviewed by a practising specialist before publication.

Meet the team behind Elytrix Labs

Get the monthly security briefing

One concise email a month with new threats, practical defences and upcoming courses. No spam — unsubscribe anytime.

Subscribe to the security briefing