Common Penetration Testing Techniques, Phase by Phase With Commands

A penetration test follows a sequence: agree scope and authorisation, gather information, find and verify vulnerabilities, exploit them to show real impact, escalate privileges and move further where allowed, then report clearly with fixes. The techniques are the same ones attackers use, applied with written permission, inside a defined scope, and with every step recorded.

Oct 11, 2026 - 07:29
Updated: 
104.7k

Penetration Testing in Cybersecurity & Ethical Hacking · Explainer

Common Penetration Testing Techniques

Quick answer: A penetration test follows a sequence: agree scope and authorisation, gather information, find and verify vulnerabilities, exploit them to show real impact, escalate privileges and move further where allowed, then report clearly with fixes. The techniques are the same ones attackers use, applied with written permission, inside a defined scope, and with every step recorded. What separates a professional test from running tools is judgement: knowing what a finding means, what to try next, and when to stop.

Key takeaways

  • Authorisation and scope come before any technique. Without them, none of this is legal.
  • Reconnaissance usually takes the most time and decides how good the test is.
  • Exploitation is about proving impact safely, not causing it.
  • Privilege escalation and lateral movement show how far one weakness really reaches.
  • The report is the product. A finding nobody understands does not get fixed.

Table of Contents

What Are the Phases of a Penetration Test?

Several public methodologies describe the same broad sequence. NIST SP 800-115 covers planning, discovery, attack and reporting; the Penetration Testing Execution Standard breaks it into pre-engagement, intelligence gathering, threat modelling, vulnerability analysis, exploitation, post-exploitation and reporting.

PhaseGoalTypical tools
Pre-engagementAgree scope, rules and authorisationContract, scope document
ReconnaissanceMap what exists and what is exposedwhois, dig, subfinder, search engines
Scanning and enumerationFind live hosts, services, versions and usersNmap, enum4linux-ng, ldapsearch
Vulnerability analysisIdentify likely weaknessesScanners, manual review, searchsploit
ExploitationProve a weakness is realMetasploit, Burp Suite, custom scripts
Post-exploitationEscalate, move and show business impactlinpeas, winPEAS, BloodHound, NetExec
ReportingExplain risk and how to fix itWritten report, debrief

A signed authorisation from someone with authority over the systems, stating the exact scope, exclusions, test window, permitted methods and emergency contacts. Testing outside that is unauthorised access under the Information Technology Act, 2000. Our article on ethical hacking laws sets out what the document should contain.

What Happens During Reconnaissance?

Reconnaissance finds the attack surface before touching it. Passive reconnaissance uses public sources and does not interact with the target's systems; active reconnaissance does, and must be within scope.

# who owns the domain and which name servers it uses
whois example.com
dig +short NS example.com

# mail servers and published text records, including SPF
dig +short MX example.com
dig +short TXT example.com

# subdomains from public sources such as certificate transparency logs
subfinder -d example.com -silent

Each subdomain found is a possible target, but only the ones listed in scope may be tested. Old forgotten subdomains are often where the interesting findings are, which is why recon deserves time.

How Are Services Scanned and Enumerated?

Scanning finds live hosts and open ports; enumeration pulls detailed information from the services found, such as users, shares and versions. The Nmap reference guide documents every option used here.

# all TCP ports with service and version detection and default scripts
nmap -sC -sV -p- -oA initial 192.168.56.101

# SMB shares and users from a Windows host (lab only)
enum4linux-ng -A 192.168.56.110

# anonymous LDAP query to a domain controller, if allowed
ldapsearch -x -H ldap://192.168.56.110 -s base namingcontexts

Our guide to enumeration in cyber security covers this phase in depth.

How Are Web Applications Tested?

Web testing is largely manual, with an intercepting proxy such as Burp Suite or OWASP ZAP between browser and application. The OWASP Web Security Testing Guide is the reference checklist, covering authentication, session management, access control, input validation and business logic.

# discover hidden directories and files with a wordlist
ffuf -u https://app.example.lab/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301,403

# check security headers on the response
curl -sI https://app.example.lab | grep -iE 'strict-transport|content-security|x-frame'

The most valuable web findings, such as one user reading another user's data by changing an ID, come from understanding the application, not from tools.

How Does Exploitation Work?

Exploitation proves that a weakness is real and shows what it allows. Testers look up known exploits for the versions found, read them before running anything, and choose the least disruptive way to demonstrate impact.

# search the local copy of Exploit-DB for a service version found earlier
searchsploit vsftpd 2.3.4

# read an exploit before using it, by the EDB-ID shown in the results
searchsploit -x <EDB-ID>

Rules of thumb: never run code you have not read, avoid exploits that may crash production services unless that is explicitly allowed, and stop to inform the client immediately if you find something critical such as live access to payment data.

What Is Privilege Escalation?

Initial access is often as a low-privileged user. Privilege escalation turns that into administrator or root access by abusing misconfiguration, weak permissions or unpatched local vulnerabilities. In MITRE ATT&CK it is a tactic of its own, because real attackers rely on it.

# Linux: what can this user run with sudo?
sudo -l

# Linux: files with the SUID bit set, a classic escalation path
find / -perm -4000 -type f 2>/dev/null

# automated enumeration scripts (upload only within scope)
./linpeas.sh       # Linux
.\winPEASx64.exe   # Windows

What Is Lateral Movement?

Lateral movement uses access to one machine to reach others, usually with credentials or tokens found along the way. In Windows domains this is where tests show their biggest impact: one compromised workstation can lead to domain administrator through a chain of small weaknesses.

# check where a captured credential is valid across a lab subnet
netexec smb 192.168.56.0/24 -u labuser -p 'Lab-Password-1'

Tools such as BloodHound map the paths from one account to high-privilege groups. For defensive context, our guide to Active Directory attack methods explains each path and how to close it.

How Is a Penetration Test Reported?

A good report serves two readers. The executive summary tells leadership the overall risk and what it means for the business, in plain language. The technical section gives each finding with evidence, steps to reproduce, impact, severity and a specific fix.

  • Lead with the attack chains that matter, not a long list of low-severity items.
  • Show evidence: screenshots, commands and output, with sensitive data redacted.
  • Give fixes engineers can act on, and state what you did not test.
  • Offer a retest so fixes are verified.

How Do You Practise These Techniques Legally?

Build a lab of your own virtual machines, including deliberately vulnerable ones, on an isolated network; use legal training platforms; and enter capture-the-flag events. Our guide to setting up a penetration testing lab covers the build, and What Is Metasploit? covers the exploitation framework safely.

Talk to a WebAsha training advisor about penetration testing courses, batches and current fees.

References

Frequently Asked Questions

Pre-engagement and authorisation, reconnaissance, scanning and enumeration, vulnerability analysis, exploitation, post-exploitation such as privilege escalation and lateral movement, and reporting.

Passive reconnaissance uses public sources without touching the target, such as DNS records and certificate logs. Active reconnaissance interacts with the target, such as port scanning, and must be within the authorised scope.

Because you can only test what you find. Forgotten subdomains, old services and exposed files are often where the most serious findings are.

Pulling detailed information from discovered services, such as user names, shares, versions and configuration, which shapes which attacks are worth trying.

Turning low-privileged access into administrator or root access by abusing misconfiguration, weak permissions or unpatched local vulnerabilities.

Using access on one machine to reach others, usually with credentials or tokens found along the way. It shows how far one weakness can really reach.

No. Read the code first, prefer the least disruptive way to show impact, avoid anything that may crash production unless explicitly allowed, and stay within scope.

An executive summary in plain language, findings with evidence and steps to reproduce, severity, specific fixes, a statement of what was not tested, and an offer to retest.

Common references are NIST SP 800-115, the Penetration Testing Execution Standard and, for web applications, the OWASP Web Security Testing Guide.

In your own isolated lab with deliberately vulnerable machines, on legal training platforms, and in capture-the-flag competitions.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Anjali

I am passionate about technology, invention and big challenging tasks on my to- do list. In terms of the work I am doing also at Bunnyshell, I am most passionate about the technologies that we are using., I'm devoted to delivering content that not only informs but also inspires. Whether you need in- depth analysis pieces, educational attendants, or study- provoking opinion pieces, I draft content that resonates with tech suckers and professionals likewise.