Skip to content
Visual explainer 2h to learn 4 steps

Pentest phases & methodologies

Describe the phases of a pentest and the standards that structure them.

By Invicly Tech, , in Ethical Hacking & Penetration Testing. About 9 minutes to read.

Topic 3 of 32

In short

A penetration test follows recognised phases so nothing is missed and work is repeatable. Standards like PTES and the OWASP Web Security Testing Guide give structure, and the test type (black, grey or white box) sets how much the tester knows upfront.

Explained simply

A penetration test is not random hacking until something breaks. It follows phases, like a doctor's check-up: first the paperwork, then gathering information, then careful tests, then a written result. Following phases means you do not skip anything and another tester could repeat your work.

Many teams follow a published standard so everyone speaks the same language. PTES (Penetration Testing Execution Standard) describes the whole engagement. The OWASP Web Security Testing Guide, called WSTG, is a detailed checklist for web apps. NIST SP 800-115 is a US government guide for security testing.

Tests also differ by how much you know before you start. In a black box test you get almost nothing, like an outside attacker. In a white box test you get source code, diagrams and accounts. A grey box test sits between, usually with a normal user login.

The habit that separates good testers from average ones is note-taking. From the first minute, write down what you ran, when, against what, and what came back. The report is built from these notes, and clients will ask you to prove every claim.

Press Play on a diagram to walk through it one step at a time.

FlowPentest phases
  1. 1
    Planning

    Scope and rules of engagement.

  2. 2
    Recon

    Gather information.

  3. 3
    Scanning

    Enumerate services.

  4. 4
    Testing

    Validate findings in lab.

  5. 5
    Reporting

    Document and remediate.

LayersWhich standard covers what
  1. 1
    PTES

    The whole engagement, from contract to report

  2. 2
    NIST SP 800-115

    Planning, discovery, attack, reporting

  3. 3
    OWASP WSTG

    Detailed web app test cases by ID

  4. 4
    MITRE ATT&CK

    Names attacker techniques for the report

In depth

The seven PTES phases

PTES splits a test into seven sections. Pre-engagement interactions cover scope, RoE and contracts. Intelligence gathering is recon. Threat modeling asks what the client's valuable assets are and who would attack them, which tells you where to focus. Vulnerability analysis finds weaknesses. Exploitation confirms them by actually using them, carefully and inside the rules. Post-exploitation asks how much an attacker could do from there, such as reaching sensitive data. Reporting turns everything into findings with fixes.

In practice the middle phases loop: a new finding during exploitation often sends you back to recon on a host you could not see before.

CycleThe testing loop inside an engagement
  1. 1
    Gather information

    Hosts, services, users, tech

  2. 2
    Find weaknesses

    Versions, misconfigurations, logic flaws

  3. 3
    Confirm safely

    Minimal proof, inside the RoE

  4. 4
    Assess new access

    What can be reached from here?

  5. Back to step 1

Black, grey and white box trade-offs

Black box feels realistic, but a real attacker has months while you have days. Much of a black box budget goes into discovery, so deep bugs may be missed. White box gives the best coverage for the money: with source code and configs you can find issues a scan never would, and confirm them faster. Grey box is the most common compromise for web apps: you get user accounts for each role, so you can test what logged-in users can do to each other.

The choice depends on the question the client is asking. "Can an outsider get in?" fits black box. "Is this app secure before launch?" fits grey or white box.

CompareHow much the tester knows
Black box
  • No accounts or docs
  • Simulates an outsider
  • Time spent on discovery
  • May miss deep bugs
Grey box
  • User accounts per role
  • Some docs or diagrams
  • Good for web apps
  • Most common choice
White box
  • Source code and configs
  • Best coverage per day
  • Finds subtle logic bugs
  • Needs code review skill

Pentest, vulnerability scan and red team

A vulnerability scan runs an automated tool that lists likely issues by version and configuration. It is fast and cheap but produces false positives and cannot judge business impact. A penetration test adds a human who confirms findings, chains small issues into bigger ones, and explains real risk. A red team exercise is goal-based and longer: it tests whether the defenders notice and respond, often with only a few people at the client knowing about it.

The OWASP WSTG fits mostly in the web part of a pentest. It groups tests by area with IDs like WSTG-ATHN (authentication) and WSTG-ATHZ (authorization), which makes it easy to show coverage in a report.

Notes and evidence from day one

Keep one folder per engagement with subfolders for scans, screenshots and notes. Save raw tool output, for example nmap -oA, so you can prove what you ran. Log your terminal: the script command records a whole shell session to a file. Name screenshots with the date, host and finding.

For each finding, note the exact request or command, the time in UTC, the target, the result, and why it matters. Treat evidence as sensitive client data: store it encrypted, never in personal cloud drives, and delete it when the contract says so. Good notes also protect you: if the client sees an outage, your timestamps show whether your traffic was the cause.

  • One folder per engagement: scans, screenshots, notes
  • Save raw output, not only summaries
  • Record times in UTC
  • Encrypt evidence and follow the retention rule

Learn it in 4 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Name the pentest phases~30m
  2. 2
    Compare black, grey and white box~30m
  3. 3
    Skim PTES and the OWASP WSTG~30m
  4. 4
    Keep notes and evidence from day one~30m

Key points

  • Phases make a test thorough and repeatable.
  • Black box knows nothing, white box knows everything.
  • PTES and OWASP WSTG give recognised structure.
  • Keep notes and evidence from the first phase.

Key terms

Tap a card to flip it. 0/4 known

Examples

Setting up an engagement folder

Before the first scan, create a clean folder structure and start a logged shell. Step 1: make folders for scans, web, screenshots and notes. Step 2: start script so every command and its output is saved with a timestamp in the file name. Step 3: save every scan in all nmap formats with -oA. Step 4: when the test ends, exit the script session and archive the folder encrypted.

bash
ENG=~/engagements/2026-03-acme
mkdir -p "$ENG"/{scans,web,screens,notes}
cd "$ENG"
# record the whole terminal session
script -a "notes/session-$(date -u +%Y%m%dT%H%MZ).log"
# every scan is saved as .nmap, .gnmap and .xml
nmap -sn -oA scans/discovery 192.168.56.0/24
exit   # stops the recording

Choosing the test type for a client

A startup will launch a new web app in four weeks and has five days of budget. Step 1: The question is "is this app safe to launch?", not "can outsiders find us?". Step 2: Black box would waste days on discovery of an app the client can simply describe. Step 3: Recommend grey box with a customer account, an admin account and the API documentation. Step 4: Use WSTG sections for authentication, authorization, input validation and business logic as the test plan, so the report can show exactly what was covered.

Quick reference

  • PTES phases: pre-engagement, intel, threat model, vuln analysis, exploitation, post-exploitation, reporting
  • Black box = no info; grey box = user accounts; white box = code and configs
  • Vulnerability scan lists likely issues; a pentest confirms and explains them
  • OWASP WSTG IDs (for example WSTG-ATHN, WSTG-ATHZ) show web test coverage
  • nmap -oA name saves normal, grepable and XML output at once
  • script -a file.log records your whole terminal session
  • Write times in UTC and keep evidence encrypted

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which PTES phase decides which assets matter most and who would attack them?

Question 2

2A client wants maximum coverage of a new app in a short time. Which test type fits best?

Question 3

3What does a red team exercise mainly test that a normal pentest does not?

Question 4

4Why save raw tool output instead of only writing a summary?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Write the PTES phases from memory, then add one example activity for each.

  2. Exercise 2medium

    Open the OWASP WSTG and pick five test IDs you would use for a login page. Write one line on what each checks.

  3. Exercise 3hard

    Create a reusable shell function that starts a new engagement: folders, a notes file with a header, and a logged session.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

What is the difference between a pentest and a vulnerability assessment?
A vulnerability assessment finds and lists likely weaknesses, often with scanners. A pentest goes further: a human confirms them, shows real impact and chains issues together.
Is PTES still used?
Yes, as a common reference for the phases, even though the site is not updated often. Many companies combine it with the OWASP WSTG for web apps and their own internal checklists.
What note-taking app do pentesters use?
Popular choices are Obsidian, CherryTree, Joplin and plain Markdown files in a Git repo. The tool matters less than the habit: timestamps, exact commands and raw output for every finding.

Go deeper

ShareXLinkedInWhatsApp