Penetration
Testing
The methodology, mental models, and technical vocabulary of offensive security — from legal framework and reconnaissance through exploitation, Active Directory attacks, and professional reporting. Every technique presented from both the attacker's perspective and the defender's view. Fifteen chapters building the foundation for practical pentesting work.
What Is Penetration Testing?
The discipline defined, pentesting vs red team vs vuln assessment vs bug bounty, the attacker mindset, and what the career actually looks like
Penetration testing is the practice of attacking systems with permission — simulating what a real attacker would do in order to find vulnerabilities before they do. That single sentence contains the two things that matter most: attacking (this is genuinely adversarial work, not passive scanning) and with permission (without which it is simply crime). Everything else in this module builds on those two foundations.
A penetration test is a time-limited, scoped, authorised security assessment in which a tester actively attempts to compromise systems and achieve defined objectives — in order to identify vulnerabilities, demonstrate their exploitability, and provide evidence-based recommendations for remediation.
Four Things That Are Not the Same
The industry uses overlapping terminology carelessly. Understanding the real distinctions matters for setting client expectations, scoping engagements correctly, and choosing the right assessment type for a given security objective.
| Type | What It Is | Output | Realistic Adversary? |
|---|---|---|---|
| Vulnerability Assessment | Automated scanning of systems for known vulnerabilities. Nessus, OpenVAS, Qualys. Little to no manual exploitation — just detection and scoring. | List of CVEs with CVSS scores and remediation guidance | No — discovers known exposures, doesn't chain them into attacks |
| Penetration Test | Manual, goal-oriented attempt to compromise specific systems within a defined scope. Testers exploit vulnerabilities and demonstrate real impact. | Detailed findings with evidence, exploited vulnerabilities, business impact, remediation | Partially — simulates a motivated external attacker but is time-limited and scoped |
| Red Team | Full adversary simulation against a specific objective (exfiltrate data, achieve domain compromise, physical facility access). Long-duration, stealth-focused, tests detection and response as much as prevention. | Campaign narrative, detection gaps, dwell time, blue team response evaluation | Yes — the closest simulation of a real targeted attacker |
| Bug Bounty | Continuous, crowd-sourced vulnerability disclosure programme where independent researchers report vulnerabilities for rewards within a defined scope. | Individual vulnerability reports submitted by researchers | No — no lateral movement, no physical testing, highly scoped |
The Attacker Mindset
The most valuable thing a penetration tester develops is not knowledge of specific tools or techniques — it is a way of thinking. Defenders ask "what have I protected?" Attackers ask "what can I reach from here?" The difference is orientation: defensive thinking maps controls to assets; offensive thinking maps access to possibilities.
The attacker mindset has three practical components:
- Assume there's a way in. Experienced testers start every engagement with the belief that they will find something — not arrogance, but the empirical observation that every system has weaknesses, and the job is finding them. This assumption prevents premature abandonment of promising attack paths.
- Think in chains, not individual findings. A single exposed SMB port is an informational finding. SMB + weak credentials + the same credentials reused on the domain controller is a critical finding. Real attacker value comes from combining individually low-severity issues into high-impact attack chains.
- Ask "what could this lead to?" at every step. Every piece of information revealed by the target — a version number, a username, an error message, a response timing difference — is a potential stepping stone. Defensive instinct filters information as noise; offensive instinct evaluates every detail for leverage.
Why Organisations Hire Pentesters
The honest answer is that organisations hire pentesters for several reasons — not all of them equally good:
- Regulatory compliance — PCI-DSS requires annual penetration testing. SOC 2 Type II auditors expect evidence of regular testing. ISO 27001 implementations include penetration testing as a control. Many organisations treat pentesting primarily as a compliance checkbox — this produces scoped, limited engagements optimised for report production rather than genuine risk discovery.
- Genuine risk reduction — the more mature motivation. Finding and fixing vulnerabilities before real attackers find them reduces the probability and impact of breaches. Organisations that use pentesting as a genuine risk management tool invest in realistic scoping, meaningful objectives, and remediation verification.
- M&A due diligence — acquiring companies assess the security posture of acquisition targets. A hidden active breach or a compromised infrastructure dramatically changes the deal value.
- Incident response context — post-breach testing to understand how an attacker moved and what else might have been missed during remediation.
What the Career Actually Looks Like
Penetration testing has several career paths with meaningfully different day-to-day realities:
- Consultancy / Agency — the most common entry point. You work for a security firm and are assigned to client engagements. Each engagement is different: different environments, different objectives, different clients. Heavy travel in some firms. Fast skill development because of the variety. Income is usually good; lifestyle depends heavily on the firm's culture.
- In-house red team — typically found only at large enterprises (banks, tech companies, defence contractors). Deep knowledge of one environment; longer campaign timelines; better lifestyle. Harder to get into without prior consultancy experience.
- Bug bounty hunter — independent, self-directed, fully remote. Income is highly variable — exceptional researchers earn six figures; most earn far less. Works best as a supplement to other income while building skills, or for those who have already reached senior consultancy level.
- Government / military — national security agencies, law enforcement, and military branches all employ offensive security practitioners. More stable than consultancy; work may be classified; requires security clearance and citizenship eligibility.
- Penetration testing is active, adversarial, authorised — all three qualifiers matter; remove any one and the definition breaks down
- Vulnerability assessments find known issues; pentests demonstrate exploitable impact; red teams simulate realistic adversaries; bug bounties are continuous and crowd-sourced — these are not interchangeable
- The attacker mindset thinks in chains, treats every data point as potential leverage, and assumes a path exists before finding it
- Most penetration testing careers start in consultancy — variety of environments and engagements accelerates skill development faster than any lab environment
Legal, Ethical, and Professional Framework
Computer crime law, authorisation requirements, rules of engagement, responsible disclosure, and what happens when pentesters get it wrong
Written, explicit, documented authorisation from someone with the legal authority to grant it is the prerequisite for every offensive security action in every chapter of this module. Enthusiasm is not authorisation. Verbal permission is not authorisation. An assumption that you probably have permission is not authorisation. A scope document with a signature is authorisation.
Read this chapter before the technical ones. The technical content is useless — and dangerous — without this foundation.
Computer Crime Law — The Legal Landscape
Most countries have statutes that criminalise unauthorised access to computer systems. The intent is almost entirely irrelevant — it is the authorisation, or lack of it, that determines legality.
- US — Computer Fraud and Abuse Act (CFAA, 18 USC §1030) — the primary US federal statute. Prohibits accessing a computer "without authorisation" or "in excess of authorisation." The scope of "access" is intentionally broad and has been interpreted to include port scanning, sending unexpected network packets, and accessing resources the owner hasn't explicitly prohibited. Multiple security researchers have faced CFAA prosecution for activities that were technically legal under any common-sense reading of the statute. The law was written in 1986 and has not kept pace with the modern internet.
- UK — Computer Misuse Act 1990 (CMA) — the UK equivalent. Three tiers: unauthorised access (section 1, up to 2 years); unauthorised access with intent to commit further offences (section 2, up to 5 years); unauthorised modification of computer material (section 3, up to 10 years). The 2015 amendment added serious crime provisions that affect tool possession — owning hacking tools with intent to use them for unauthorised access can itself be an offence.
- EU — Directive on Attacks Against Information Systems (2013/40/EU) — harmonises criminal law across EU member states for computer crimes. Member states implement it with varying severity.
What Constitutes Authorisation
Authorisation for a penetration test requires three things: the right person, the right scope, and the right form.
- The right person — only someone with legal authority over the target system can authorise testing. For a company's own systems: the CISO, CTO, or CEO. For cloud environments: the account owner, not just a system administrator. For systems hosted by a third party: both the client and the hosting provider may need to authorise (AWS requires notification for certain types of testing; Azure and GCP have similar policies). A developer who "gives permission" to test their employer's production environment without executive sign-off has not given authorisation.
- The right scope — authorisation must specify what is in scope: IP ranges, domains, applications, physical locations, social engineering targets. "Test whatever you want" is not adequate scope — it creates ambiguity that can expose the tester to liability when they access something they shouldn't have. Explicit exclusions (production databases, third-party systems, specific business-critical servers during certain hours) are as important as inclusions.
- The right form — written, signed, and retained. A Statement of Work (SoW) or contract that explicitly authorises the testing activities is the minimum. Some engagements also use a separate Rules of Engagement document for operational details. Verbal permission is worthless if you're later prosecuted.
Testing a system that is partially owned or operated by a third party — a SaaS application, a cloud hosting provider, a CDN — requires authorisation from that third party, not just your client. Your client owns their data and their application; they do not own the infrastructure running it. Testing a client's AWS environment without notifying AWS, for example, may violate AWS's Penetration Testing Policy even if your client has authorised you. Always check hosting provider policies before testing.
Rules of Engagement in Depth
The Rules of Engagement (RoE) document is the operational specification of the penetration test. It answers the questions that the legal contract doesn't:
- Time windows — when can testing occur? Business hours only? 24/7? Certain systems only during maintenance windows?
- Excluded systems — what is explicitly out of scope? Production payment systems? Specific IP ranges? Third-party systems?
- Emergency contact — who to call if you accidentally cause an outage, find an active breach by a real attacker, or discover evidence of serious criminal activity?
- Safe word / pause protocol — a predetermined signal that either party can use to pause all testing immediately. Essential when the client's incident response team detects testing activity and needs to confirm it's authorised before escalating.
- Evidence handling — what happens to captured credentials, sensitive data found on systems, and screenshots of confidential information? These must be handled and disposed of appropriately.
- Deconfliction — how does the client's SOC know when activity is from the pentest versus a real attacker? Some engagements are fully announced (the SOC knows a test is happening); some are partially announced (executives know, SOC does not); some are black box (no one at the client knows). Each has different operational implications.
Responsible Disclosure
When vulnerability research is conducted outside of a formal engagement — independent security research, bug bounty programmes, or accidental discovery — the question of disclosure arises. The spectrum:
- Coordinated disclosure (preferred) — notify the vendor privately, give them a reasonable time to develop and release a patch (typically 90 days, per Google Project Zero's standard), then publish. The vendor gets time to fix the issue; users eventually get the information they need to protect themselves.
- Full immediate disclosure — publish everything immediately without vendor notification. Sometimes justified when the vendor is unresponsive, the vulnerability is already being exploited, or the vendor has a history of ignoring reports. High impact on affected users; high pressure on the vendor; high reputational risk for the researcher.
- Non-disclosure — report to the vendor and agree to never publish. Common in coordinated disclosure arrangements with large enterprise vendors who require NDAs. Protects no one except the vendor's reputation.
When Pentesters Get It Wrong — Real Cases
Understanding how legal situations go wrong is as important as understanding the law itself:
- Going out of scope — a tester hired to assess a web application who compromises a server not in scope, even in pursuit of a legitimate attack chain, may have committed a computer crime against that server. Scope discipline is not bureaucracy — it is legal protection.
- Retaining client data — a tester who captures credentials or sensitive documents during an engagement and retains them after the engagement closes has mishandled client data and potentially violated data protection law.
- The wrong client contact — in 2019, two contractors hired to conduct a physical penetration test of an Iowa courthouse were arrested and charged with third-degree burglary after being discovered by police. The authorisation letter they carried was from the state judicial agency — but county officials who owned the facility had not been notified. The case was eventually resolved, but they spent weeks fighting criminal charges despite having genuine authorisation from the entity they believed was responsible.
- Written, signed authorisation from the right person is the legal prerequisite for every testing action — verbal permission and assumptions do not count
- Third-party systems (cloud hosting, CDNs, SaaS platforms) require authorisation from the third party, not just the client
- Rules of Engagement are the operational specification — time windows, exclusions, emergency contacts, evidence handling, and safe word protocols
- Coordinated disclosure with a 90-day notice period is the industry-standard approach to independently discovered vulnerabilities
- Scope discipline is legal protection — going out of scope is a criminal risk even if unintentional
The Penetration Testing Methodology
PTES, OWASP Testing Guide, NIST SP 800-115, black/grey/white box, the engagement lifecycle, and defining objectives in business terms
A methodology is what separates a professional penetration test from a disorganised attack. Without a framework, testers miss things — not because they lack skill, but because they lack a systematic approach that ensures complete coverage. A methodology also makes the engagement defensible: when a client asks "how did you test for X?", the answer is rooted in a recognised framework rather than personal preference.
Major Frameworks
- PTES (Penetration Testing Execution Standard) — the most comprehensive open standard for penetration testing. Covers seven phases: pre-engagement, intelligence gathering, threat modelling, vulnerability analysis, exploitation, post-exploitation, and reporting. Detailed technical guidelines for each phase. The de facto reference for methodology.
- OWASP Testing Guide — specifically for web application testing. Extremely detailed per-vulnerability testing procedures with test cases, tools, and expected results for each OWASP Top 10 category and many others. Essential reference for web application testers.
- NIST SP 800-115 — the US federal government's technical guide to information security testing. More conservative and process-oriented than PTES. Required reference for engagements serving US federal clients.
- OSSTMM (Open Source Security Testing Methodology Manual) — focuses on measuring security through operational metrics. Less used in commercial pentesting but influential in security research contexts.
Black Box vs Grey Box vs White Box
| Type | Information Provided | Simulates | Best For |
|---|---|---|---|
| Black Box | Target name only — no credentials, no architecture documentation, no source code | External attacker with no insider knowledge | External perimeter testing; realistic adversary simulation |
| Grey Box | Some information — network diagrams, low-privilege credentials, documentation — but not full access | Attacker with some prior reconnaissance or insider knowledge; or a compromised user | Most internal network and application tests; efficient coverage with realistic constraints |
| White Box | Everything — full source code, architecture diagrams, admin credentials, infrastructure details | Auditor with full access; insider with legitimate access; thorough code and config review | Code review, configuration audit, comprehensive coverage where missed findings are costly |
Grey box is the most common commercial engagement type. It is more efficient than black box (less time wasted on reconnaissance that could be done internally) without sacrificing the realistic adversarial perspective. White box is appropriate when the objective is thoroughness — catching everything — rather than simulating a realistic attacker.
The Engagement Lifecycle
- Pre-engagement — scoping call, Statement of Work, Rules of Engagement, authorisation letters, NDA, kickoff meeting. Nothing technical happens yet. The success of the engagement is significantly determined by the quality of this phase.
- Reconnaissance — passive and active information gathering about the target. Attack surface mapping. The attacker learns everything possible about the environment before touching it.
- Scanning and enumeration — active probing of in-scope systems. Port scanning, service version detection, vulnerability scanning, web application fingerprinting. Building the target inventory.
- Exploitation — attempting to leverage identified vulnerabilities to achieve defined objectives. The "breaking in" phase — but only after thorough preparation.
- Post-exploitation — after initial access is established: privilege escalation, lateral movement, persistence, data access, achieving the defined objective. This is where the actual impact is demonstrated.
- Reporting — documenting everything: methodology, findings, evidence, business impact, remediation guidance. The deliverable the client pays for.
- Remediation verification — retesting to confirm that fixes work. Not always included in the engagement scope, but should be.
Defining Objectives in Business Terms
The most common scoping mistake is defining a pentest in purely technical terms — "test all systems in the 10.0.0.0/8 range." Better scoping defines objectives in business terms: "determine whether an external attacker could access the customer database," or "assess whether a compromised employee workstation could be used to reach the payment processing environment."
Business-oriented objectives produce better tests because they guide the tester's choices when multiple attack paths are available. Faced with a choice between spending time on a finding that would only affect an internal development server versus one that could lead to the payment database, the business-oriented objective makes the prioritisation obvious.
- PTES is the comprehensive methodology reference; OWASP Testing Guide is the web application standard; NIST SP 800-115 is required for federal work
- Grey box is the most common commercial engagement — efficient coverage with realistic attacker constraints
- The engagement lifecycle is sequential and deliberate — jumping from scope to exploitation without thorough reconnaissance misses findings and wastes time
- Business-oriented objectives drive better testing decisions than technical scope alone — they guide prioritisation and make findings more actionable for stakeholders
Reconnaissance and OSINT
Passive reconnaissance, Shodan, Google dorking, LinkedIn intelligence, job postings, certificate transparency, subdomain enumeration, and building the attack surface map
Reconnaissance is the phase where patience pays off disproportionately. A tester who spends three hours on thorough reconnaissance before touching the target will be more effective than one who immediately launches nmap scans. Reconnaissance reduces wasted effort, reveals attack paths that direct scanning would never surface, and — in the case of passive reconnaissance — generates zero logs on the target's systems.
Passive reconnaissance (searching public sources, looking up public records) generally does not require the target's authorisation. Active reconnaissance (connecting to the target's systems, sending DNS queries directly to their nameservers, port scanning) does. The boundary is whether your actions generate traffic that reaches the target.
Shodan — The Search Engine for Exposed Infrastructure
Shodan continuously scans the internet and indexes the banners and metadata returned by devices on open ports. It is, in effect, a searchable database of everything exposed to the internet — servers, routers, cameras, industrial control systems, printers, and anything else with an internet-reachable port.
Shodan reveals: what services an organisation exposes, what software versions are running, what certificates are in use, and — critically — whether those versions have known critical vulnerabilities. The Pulse Secure VPN in the example above is an immediate high-priority lead: CVE-2019-11510 allows unauthenticated file read including VPN session files containing plaintext credentials. Finding this in Shodan before active scanning is pure intelligence value with zero network contact with the target.
Useful Shodan Filters
org:"Company Name" # by organisation name registered with IP allocator
hostname:domain.com # by hostname pattern
net:203.0.113.0/24 # by IP range (requires paid account)
ssl.cert.subject.cn:domain # by certificate subject
product:"Apache httpd" # by software product
vuln:CVE-2021-44228 # by CVE (shows hosts with known-vulnerable versions)
port:3389 country:GB # RDP exposed in UK
"default password" port:80 # look for default credentials pages
Google Dorking — Advanced Search for Exposed Data
Google's search operators allow targeted queries that surface information organisations have inadvertently exposed publicly. These are sometimes called "Google dorks" — search strings that find specific types of sensitive content indexed by Google's crawler.
LinkedIn — Organisational Intelligence
LinkedIn provides two types of intelligence: organisational structure (who reports to whom, who are the decision-makers, who works in IT security) and technology stack (what tools does the company use, inferred from employees' skills sections and job history). This intelligence drives social engineering pretexts and helps build realistic phishing emails.
Certificate Transparency — Subdomain Enumeration
Every TLS certificate issued by a publicly trusted CA is logged in Certificate Transparency logs — and those logs are publicly searchable. Every subdomain a certificate has been issued for is visible. This is one of the most reliable subdomain enumeration techniques because it captures subdomains that don't appear in DNS searches or web crawls.
The findings above tell a story immediately: jenkins.acme-corp.com is a CI/CD server (high value — often contains credentials, deployment pipelines, and production access). staging.acme-corp.com is a staging environment (often less secured than production but connected to the same infrastructure). old-hr.acme-corp.com is a legacy system (potentially unpatched, forgotten, but still resolving to a live IP).
GitHub and Source Code Intelligence
Developers routinely commit secrets to public GitHub repositories — API keys, database connection strings, AWS access keys, and private keys. GitHub's secret scanning notifies maintainers, but detection is not instant and not all secrets are caught. Historical commits can contain secrets even after they've been removed from the current version (git history persists).
GitHub is a treasure chest. Automated tools scan all public commits continuously. A secret committed for five minutes before being removed is still in git history and may already be indexed. A single AWS key found here can mean full account compromise.
Deploy pre-commit hooks (git-secrets, detect-secrets) to prevent secret commits. Use GitHub's secret scanning. Monitor for commits from your org in BreachWatch, GitGuardian. Any exposed credential must be rotated immediately — removing from HEAD is not enough.
- Shodan indexes internet-exposed services with version banners — often reveals critical unpatched vulnerabilities before any direct contact with the target
- Google dorking surfaces accidentally indexed sensitive files, open directory listings, and exposed admin interfaces that standard scanning misses
- Certificate Transparency logs provide comprehensive subdomain enumeration including subdomains that don't appear in web crawls or DNS brute force
- GitHub historical commits persist even after removal — TruffleHog and similar tools find and verify live credentials from old commits
- Job postings are intelligence: they reveal technology stack, internal tooling, and security controls in place
TryHackMe: Passive Reconnaissance and OhSINT — both use real-world OSINT techniques against intentionally designed targets. For Shodan practice, explore their free tier against your own public IP or open-source projects.
Scanning and Enumeration
nmap in depth, vulnerability scanning, web application fingerprinting, directory enumeration, SMB/LDAP/SNMP enumeration, and what scanning looks like to defenders
Scanning is the transition from passive intelligence gathering to active probing. You are now sending packets to the target and generating logs on their systems. Every scan generates evidence — in firewall logs, in IDS alerts, in web server access logs. Skilled testers balance thoroughness against detectability, choosing techniques that gather the required information with the minimum noise.
nmap — The Foundation Tool
nmap (Network Mapper) is the standard tool for host discovery, port scanning, service version detection, and OS fingerprinting. Its NSE (Nmap Scripting Engine) extends it to vulnerability detection, brute-force attacks, and protocol-specific enumeration.
Reading this output: OpenSSH 7.6p1 is an older version and worth checking against CVE databases. The SMTP server exposes VRFY — which allows username enumeration (send VRFY username and the server confirms if the account exists). Tomcat 8.5.23 is significantly out of date and has known critical vulnerabilities including CVE-2017-12617 (remote code execution via PUT request). These are the leads that drive the next phase.
Essential nmap Flags
| Flag | Meaning | Notes |
|---|---|---|
-sS | SYN scan (half-open, stealthy) | Default when run as root; faster than connect scan; doesn't complete TCP handshake |
-sV | Service version detection | Probes open ports to identify service and version |
-sC | Default NSE scripts | Runs safe default scripts: banner grabbing, SSL enum, SMB detection |
-O | OS detection | Attempts to identify operating system via TCP/IP stack fingerprinting |
-p- | All 65,535 ports | Don't miss services on non-standard ports |
-T4 | Timing (aggressive) | Faster scanning; T1-T5 range from paranoid to insane |
-oA filename | Output all formats | Saves .nmap, .xml, and .gnmap — always save output |
--script vuln | Vulnerability scripts | Runs NSE vulnerability detection scripts — noisy but finds obvious CVEs |
Directory and File Enumeration
Web applications expose endpoints that aren't linked from the visible interface — admin panels, backup files, API endpoints, configuration pages. Directory enumeration uses wordlists to brute-force paths and discover these hidden resources.
SMB Enumeration
SMB is the Windows file sharing protocol and one of the richest sources of information during an internal pentest. From an unauthenticated or low-privilege position, SMB can reveal: system information, share names and permissions, domain information, user lists, and password policies.
This output contains several critical findings: the Finance share has anonymous read/write access, the domain has no account lockout policy (password spraying is possible without locking accounts), and we now have a list of valid usernames including service accounts. All of this was obtained without credentials.
- No lockout threshold = free password spraying with zero risk
- Anonymous Finance share = immediate data access
- Service accounts visible = Kerberoasting targets identified
- Domain name = can query LDAP for more details
- Lockout threshold of 3-5 attempts dramatically raises spray cost
- Restrict anonymous SMB:
RestrictAnonymous = 2in GPO - SMB signing prevents relay attacks on authenticated sessions
- SIEM alert: many failed logons spread across many accounts
- nmap's -sV -sC combination gives service versions and default script output — always the starting point for understanding a target's exposed services
- Old software versions are leads, not findings — Tomcat 8.5.23, OpenSSH 7.6, outdated nginx all need CVE cross-referencing to determine exploitability
- Directory enumeration finds admin panels, backup files, and .env files that aren't linked from the visible site — critical for web application work
- SMB enumeration without credentials can reveal: OS version, domain info, share names, user lists, and password policies — all essential attack planning data
- No account lockout policy removes the primary risk from password spraying — find this early and note it as a finding
HackTheBox: Blue (nmap + EternalBlue), Legacy (SMB enumeration). TryHackMe: Further Nmap for comprehensive nmap skill building.
Exploitation Fundamentals
Why vulnerabilities exist, Metasploit architecture, payload types, msfvenom, catching shells, shell stabilisation, and the risk of untrusted exploits
Exploitation is the phase that most people imagine when they think of "hacking" — the moment of actual compromise. In reality, by the time a skilled tester reaches this phase, they already know with reasonable confidence that something is exploitable. The reconnaissance and enumeration phases have identified the target; exploitation is the confirmation and the mechanism for establishing access.
Why Vulnerabilities Exist — Classes of Errors
Understanding vulnerability classes — the categories of programming and design errors that create exploitable conditions — is more durable than memorising specific CVEs. New vulnerabilities will be discovered; the underlying error classes remain consistent.
- Memory safety errors — buffer overflows, use-after-free, format string bugs. When a program writes more data to a memory buffer than the buffer was allocated to hold, the excess overwrites adjacent memory — potentially including function return addresses, allowing an attacker to redirect execution to their own code. These errors are most common in C and C++ code.
- Injection flaws — when user-supplied input is interpreted as code rather than data. SQL injection, OS command injection, LDAP injection, XPath injection. The pattern is always the same: user input reaches an interpreter without adequate sanitisation or parameterisation.
- Authentication and authorisation failures — missing authentication checks, weak credential policies, broken session management, insecure tokens. The application fails to verify that the user is who they claim to be, or fails to verify that they're permitted to perform the requested action.
- Logic errors — the application works as programmed but the programming is wrong. A price calculation that can be manipulated to produce negative totals, a password reset flow that can be bypassed, a workflow that can be reversed in an unintended order. No automated scanner finds logic errors — only a tester who understands the intended behaviour can identify deviations from it.
- Configuration errors — software correctly installed but incorrectly configured. Default credentials, unnecessary services enabled, overly permissive file permissions, debug interfaces left enabled in production. Often the easiest vulnerabilities to exploit.
Metasploit Framework
Metasploit is the industry-standard exploitation framework — a platform that organises and automates many aspects of the exploitation workflow. Understanding its architecture helps you use it efficiently and understand what it's doing at each step.
Payload Types
Understanding payload types determines how you catch connections and what you can do once you have a session.
| Type | How It Works | Pros | Cons |
|---|---|---|---|
| Reverse shell | Compromised system connects back to attacker's listener | Works through NAT/firewall (outbound is usually allowed) | Requires attacker to have a reachable public IP or listen on VPN |
| Bind shell | Compromised system opens a port; attacker connects to it | Simple; attacker initiates connection | Blocked by most firewalls inbound; noisy |
| Staged | Small initial payload (stager) connects back; downloads and executes the full payload (stage) | Small initial payload evades size limits | Requires network access to stage server; two-step process |
| Stageless | Full payload delivered in a single transmission | Works in air-gapped or restricted network access scenarios | Larger payload size; more likely to trigger AV signatures |
| Meterpreter | Advanced in-memory payload; runs in target process; encrypted comms | Feature-rich (file transfer, keylogging, pivoting); runs in memory (less disk forensics) | Well-known AV signature; detected by most EDR |
msfvenom — Payload Generation
msfvenom generates standalone payloads in various formats for scenarios where Metasploit's built-in payload handling isn't used.
Shell Stabilisation
Raw netcat shells are fragile — they have no tab completion, CTRL+C kills the connection, interactive programs like vim don't work, and they don't have terminal width settings. Shell stabilisation converts a dumb shell into an interactive, fully functional terminal.
Meterpreter's in-memory operation and encrypted comms are valuable against basic logging. However, modern EDR (CrowdStrike, SentinelOne, Defender) detects Meterpreter reliably. For red team work, custom C2 frameworks (Cobalt Strike, Havoc, Sliver) with malleable profiles are more evasive.
Meterpreter generates distinctive network traffic patterns (staging requests, heartbeat packets) detectable in PCAP and proxy logs. EDR behavioural detection catches the process injection patterns even without Meterpreter signature. Memory scanning catches in-memory payloads. Network segmentation limits where reverse shells can call back to.
- Vulnerability classes (memory safety, injection, auth failures, logic errors, configuration) are more durable knowledge than specific CVEs
- Metasploit organises exploitation into modules (exploit, payload, post, auxiliary) — understanding the architecture makes the tool predictable
- Reverse shells work through most firewalls; bind shells usually don't — reverse is the default in real engagements
- Shell stabilisation with python pty + stty raw is essential for productive post-exploitation work in a Linux environment
- Meterpreter is detectable by modern EDR — valuable for CTF and basic pentests, insufficient for mature red team work
TryHackMe: Metasploit Introduction covers the full framework workflow. HackTheBox: Lame is a classic Metasploit introduction. Practice shell stabilisation on any Linux CTF machine.
Web Application Penetration Testing
OWASP Top 10, Burp Suite workflow, SQL injection in depth, XSS, IDOR, authentication attacks, SSRF, and business logic testing
Web application testing is the most common engagement type in commercial penetration testing. Nearly every organisation has web-facing applications, and those applications collectively represent an enormous attack surface. The OWASP Top 10 provides the canonical framework for web application vulnerability testing — not as an exhaustive list but as a prioritised coverage guide for the most impactful and prevalent vulnerability classes.
Burp Suite — The Central Web Testing Tool
Burp Suite is the standard platform for manual web application testing. It acts as an intercepting proxy between your browser and the target application, allowing you to view, modify, and replay every HTTP/HTTPS request. Understanding Burp's core tools is a prerequisite for web application testing.
SQL Injection in Depth
SQL injection remains one of the most impactful web vulnerabilities — it can lead to authentication bypass, data theft, and in some configurations, remote code execution. Understanding the different types helps you recognise them during testing and explain them clearly in reports.
Insecure Direct Object Reference (IDOR)
IDOR is the most commonly found high-impact vulnerability in bug bounty programmes — and it is entirely invisible to automated scanners. It occurs when an application uses a predictable identifier to reference a resource without verifying that the requesting user is authorised to access that specific resource.
Authentication Testing
Server-Side Request Forgery (SSRF)
SSRF tricks the server into making HTTP requests on behalf of the attacker — to internal services that are not directly accessible from the internet. In cloud environments, SSRF is particularly dangerous because the EC2/Azure/GCP metadata service is reachable from any process on the instance.
- SSRF to metadata service → IAM credentials → full AWS privilege escalation if role has broad permissions
- IDOR requires zero technical exploitation — just changing a number
- SQLi + no WAF + database credentials = direct database access, potential OS command execution via INTO OUTFILE
- IMDSv2 requires a PUT request for a session token — simple SSRF attacks can't reach it
- IDOR fixed by authorisation checks that verify the requesting user owns the requested resource
- Parameterised queries (prepared statements) eliminate SQL injection — not input validation, not WAF
- WAF as defence-in-depth, not primary SQLi defence
- Burp Suite Proxy + Repeater + Intruder covers the vast majority of manual web testing workflows — invest time in learning all three tools deeply
- SQLi authentication bypass works by commenting out the password check —
admin'--is the simplest test case for login forms - IDOR is found by substituting your own identifiers with other users' identifiers — entirely manual, entirely invisible to scanners
- SSRF to cloud metadata service yields temporary IAM credentials — mitigated by requiring IMDSv2 (token-based metadata access)
- Business logic flaws require understanding how the application is supposed to work before you can identify where it doesn't — no automated tool finds them
OWASP WebGoat and DVWA (Damn Vulnerable Web Application) for foundational SQL injection and XSS. PortSwigger Web Security Academy (portswigger.net/web-security) is the definitive free web testing lab — comprehensive labs for every OWASP Top 10 category with detailed explanations.
Network Penetration Testing
LLMNR/NBT-NS poisoning with Responder, NTLM relay, network device attacks, pivoting and tunnelling, firewall evasion, and password attacks
Internal network penetration testing starts the moment you're placed on the target network — whether through a physical port, a VPN, or a compromised edge device. The internal network has a different character from the external perimeter: there is more implicit trust, more legacy protocols, more misconfiguration, and usually far less monitoring of east-west traffic. Some of the most impactful findings in enterprise pentests come from the internal network.
LLMNR/NBT-NS Poisoning with Responder
LLMNR (Link-Local Multicast Name Resolution) and NBT-NS (NetBIOS Name Service) are Windows fallback name resolution protocols. When DNS fails to resolve a hostname, Windows broadcasts an LLMNR/NBT-NS query to the local network asking "does anyone know where
NTLM Relay Attack
Rather than cracking captured NTLMv2 hashes (which requires the password to be in a wordlist), relay attacks use the captured authentication in real time — forwarding it to another system that accepts NTLM authentication. The attacker authenticates to a target as the victim without ever knowing the password.
Pivoting and Tunnelling
Pivoting uses a compromised host as a jump point to reach network segments that are otherwise inaccessible from the attacker's position — the compromised host has access that the attacker's machine doesn't.
- Responder + no lockout policy + weak passwords = domain credentials in 30 minutes on most enterprise networks
- NTLM relay works against any host without SMB signing — check with
crackmapexec smb targets.txt --gen-relay-list - Chisel runs over HTTP/HTTPS — bypasses most firewall egress rules
- Disable LLMNR via GPO: Computer Configuration → Administrative Templates → Network → DNS Client → Turn off multicast name resolution
- Enable SMB signing on all domain hosts — prevents relay attacks regardless of captured hashes
- DNS logs show LLMNR poisoning attempts as unexpected name resolutions from unusual sources
- Responder captures NTLMv2 hashes passively — within minutes on most internal networks with no active exploitation
- NTLM relay bypasses the need to crack hashes — authentication is forwarded live to another host
- SMB signing (enabled on all hosts) prevents NTLM relay — a single GPO setting eliminates the entire attack class
- Chisel creates SOCKS5 tunnels over HTTP/HTTPS — bypasses firewall egress rules that would block direct pivoting
- ProxyChains routes tool traffic through a SOCKS proxy — enables scanning and exploitation of pivoted-to networks
TryHackMe: Breaching AD covers LLMNR poisoning comprehensively. HackTheBox Pro Labs "Offshore" includes full internal network pivoting scenarios. PentesterLab: Pivoting module for tunnelling practice.
Active Directory Attacks
BloodHound enumeration, Kerberoasting, AS-REP Roasting, Pass-the-Hash, lateral movement, ACL abuse, DCSync, and Golden Tickets
Active Directory is the identity and access backbone of the vast majority of enterprise Windows environments. Compromising AD — or specific privileged accounts within it — means compromising everything it governs. This makes AD the primary objective in most internal penetration tests, and AD attacks are the techniques that matter most for demonstrating realistic enterprise impact.
BloodHound — Attack Path Discovery
BloodHound collects AD relationship data (group memberships, ACLs, trusts, session information) using SharpHound, then visualises attack paths — chains of AD relationships that a low-privilege attacker could follow to reach Domain Admin. It turns what would be hours of manual enumeration into an interactive graph that immediately reveals the shortest path to compromise.
Kerberoasting
Service accounts in Active Directory that have a Service Principal Name (SPN) registered can have their Kerberos service tickets requested by any authenticated domain user. These tickets are encrypted with the service account's password hash. An attacker requests the ticket and takes it offline for cracking — if the service account has a weak password, it yields domain credentials.
Pass-the-Hash
Windows NTLM authentication allows authentication using a password hash rather than the plaintext password — by design, for pass-through authentication scenarios. An attacker who obtains an NTLM hash (via Mimikatz, Responder, or SAM database extraction) can authenticate as that user to any system that accepts NTLM authentication, without ever cracking the hash.
DCSync — Extracting All Domain Hashes
DCSync abuses the Directory Replication Service (DRS) protocol — which domain controllers use to replicate with each other — to pull all account hashes from Active Directory without needing to log into a domain controller. An account with the DS-Replication-Get-Changes-All right (held by Domain Admins and any account explicitly granted it) can perform this.
- BloodHound turns complex AD analysis into a visual graph — find the path to DA in seconds rather than hours of LDAP queries
- Kerberoasting is entirely passive, logs as legitimate Kerberos activity, and the ticket cracking happens offline with no further domain interaction
- Golden Ticket survives password changes — the KRBTGT hash must be reset twice (every 24 hours due to Kerberos ticket lifetime) to invalidate it
- Service accounts should use Group Managed Service Accounts (gMSA) — automatically rotated, 120-character random passwords make Kerberoasting cracking computationally infeasible
- DCSync is detected via Event ID 4662 with specific GUIDs — requires DS Access auditing on DCs
- LAPS (Local Admin Password Solution) randomises local admin passwords per machine — eliminates hash reuse across hosts
- Tiered AD model prevents non-DA accounts from having sessions on sensitive Tier-0 assets
- BloodHound maps AD attack paths visually — always run it first on an internal engagement to understand the landscape before deciding where to invest effort
- Kerberoasting requests are indistinguishable from legitimate Kerberos traffic — detection requires baseline analysis of service ticket requests
- Pass-the-Hash without LAPS turns one compromised workstation into lateral movement across the entire fleet sharing that local admin password
- DCSync requires replication rights and generates Event ID 4662 — detectable with proper DC auditing and SIEM alerting
- Golden Ticket provides indefinite access — KRBTGT must be reset twice after any suspected compromise
TryHackMe: Attacktive Directory covers Kerberoasting and AS-REP Roasting end-to-end. HackTheBox Pro Labs: RastaLabs and Offshore for full AD engagement simulation. CRTP (Certified Red Team Professional) labs are purpose-built for AD attack chains.
Social Engineering
Cognitive biases, phishing campaigns with GoPhish, vishing, physical testing, USB drops, pretext development, and ethical considerations
Every technical control in a security programme can be circumvented if an attacker can convince a person with legitimate access to take an action on their behalf. Social engineering is the discipline of that manipulation — exploiting human psychology rather than software vulnerabilities. It is consistently one of the most effective attack vectors in real-world compromises and the hardest to defend against through purely technical means.
Why Social Engineering Works — Cognitive Biases
Effective social engineering exploits cognitive shortcuts that are rational under normal conditions but become vulnerabilities when deliberately triggered. Understanding these is what separates a social engineer from someone who just lies:
- Authority — people comply with requests from perceived authorities (executives, IT support, auditors, law enforcement) without verifying identity. "This is James from IT security, I need your credentials to update your account" works because the authority framing bypasses the verification instinct.
- Urgency — time pressure degrades careful decision-making. "Your account will be locked in 15 minutes unless you verify now" creates urgency that prevents the target from pausing to question the request.
- Social proof — people follow what others are doing. "The rest of your team has already completed this security verification" implies that compliance is the norm and non-compliance is unusual.
- Reciprocity — people feel obligated to return favours. An attacker who provides something helpful first (resolves a minor issue, shares useful information) creates a felt obligation that is then exploited.
- Liking — people comply more readily with requests from people they like or find similar to themselves. Building rapport through shared interests, mutual acquaintances, or simply being friendly significantly increases compliance rates.
- Scarcity — perceived scarcity increases value and urgency. "This security update is only available today" triggers action that "update your software when you have time" doesn't.
Phishing Campaign Management with GoPhish
GoPhish is the standard open-source phishing simulation framework. It manages the operational elements of a phishing campaign: sending phishing emails to a target list, hosting credential-capturing landing pages, and tracking who clicked, who submitted credentials, and who reported the email.
A 21% credential submission rate is sobering but realistic for a well-constructed pretext against an untrained population. The CFO and IT administrator credentials captured represent immediate critical-severity findings — those accounts, if compromised in a real attack, would provide either financial fraud capability or full technical access to the environment.
Vishing — Voice Phishing
Vishing uses phone calls as the attack vector. The attacker impersonates a trusted entity — IT support, the CEO's assistant, a vendor, an auditor — and manipulates the target into taking an action (revealing credentials, installing software, transferring funds, granting access).
Physical Security Testing — Tailgating and USB Drops
Physical penetration testing assesses whether an attacker could gain physical access to secure areas — server rooms, executive offices, network closets — through social engineering at physical entry points.
Tailgating — following an authorised person through a secure door without using your own credentials. Effective pretexts: carrying heavy boxes (people hold doors without thinking), wearing high-visibility vests or uniforms associated with maintenance or delivery, timing entry during busy periods when badge checking is lax.
USB drop attacks — placing USB drives in locations where target employees will find and plug them in. The drives contain payloads that execute automatically when connected. A well-documented experiment found that 48% of drives dropped in a university car park were plugged into computers within 24 hours.
Social engineering findings must be reported without identifying or shaming individual employees. The finding is an organisational security failure — insufficient training, culture, or detection capability — not a personal failing of the employee who submitted credentials. Naming specific employees in reports (beyond necessary operational detail) is poor practice that creates hostility toward the security programme.
USB drops require particularly careful scoping — the payload must be genuinely safe, the devices must be recovered, and employees who plug in the device should be directed to training rather than disciplinary action.
- Social engineering exploits rational cognitive shortcuts — authority, urgency, social proof, reciprocity, liking, scarcity — that become vulnerabilities when deliberately triggered
- GoPhish manages phishing campaigns end-to-end — tracking opens, clicks, submissions, and reports; finance teams typically have higher submission rates than technical teams
- Vishing combines spoofed caller ID with carefully scripted pretexts — IT support impersonation works because employees are conditioned to comply with IT requests
- Physical testing findings are organisational failures, not individual ones — reports should never humiliate specific employees
- The detection metric matters as much as the compromise metric — a 6% report rate alongside a 21% credential submission rate shows both the vulnerability and the detection gap
Set up GoPhish locally against a test email account to understand the campaign mechanics. TryHackMe: Phishing Emails series covers pretext analysis and detection. For vishing practice, Antisyphon Training offers live social engineering courses with real call scenarios.
Wireless Penetration Testing
WPA2-PSK cracking, PMKID attack, WPA2-Enterprise and EAP testing, evil twin with hostapd-wpe, Bluetooth, and wireless assessment methodology
Wireless penetration testing assesses whether an attacker positioned in physical proximity to the target — in the car park, a neighbouring office, or public space — can gain access to the wireless network and from there to internal systems. The realistic attacker model matters here: a nation-state may use directional antennas from hundreds of metres; a casual attacker needs to be within typical Wi-Fi range (30–100 metres).
WPA2-PSK — 4-Way Handshake Capture and Cracking
The most common wireless attack against WPA2-Personal networks captures the 4-way handshake exchanged during client authentication and cracks it offline against a wordlist. The network password is never transmitted — but the handshake contains enough information to verify password guesses without further network interaction.
PMKID Attack — No Client Required
The PMKID attack (discovered 2018) extracts a PMKID value from a single EAPOL frame sent by the access point, without needing to capture a client handshake. This makes it viable even when no clients are currently connected to the network.
WPA2-Enterprise — EAP Credential Capture with hostapd-wpe
WPA2-Enterprise uses 802.1X authentication — each user authenticates with their own credentials rather than a shared key. This is more secure than PSK but creates a different attack surface: the EAP exchange between client and RADIUS server can be targeted with an evil twin access point that captures credential material.
- Wordlist quality determines success — rockyou.txt + hashcat rules covers most human-chosen passwords
- PMKID attack is fully passive and clientless — perfect for off-hours when no users are connected
- EAP capture only works when clients don't validate the RADIUS cert — very common in BYOD environments
- WPA2-PSK minimum 15-character random passphrase makes cracking computationally infeasible
- WPA3-SAE eliminates PMKID and handshake attacks — upgrade access points where possible
- Validate RADIUS server certificate on all 802.1X clients via MDM/GPO — eliminates EAP capture attacks
- Wireless IDS detects deauth storms and rogue AP with matching SSID
- 4-way handshake capture requires a deauth packet to force a client reconnection; PMKID attack requires no client at all — making it stealthier and more reliable
- WPA2-PSK cracking is entirely offline after capture — the network sees nothing after the handshake is obtained
- EAP credential capture with hostapd-wpe only works when clients don't validate the RADIUS server certificate — a misconfiguration corrected by MDM/GPO policy
- WPA3 eliminates the PMKID and 4-way handshake offline cracking attacks entirely — it is the long-term defence
TryHackMe: Wi-Fi Hacking 101. For hands-on practice, a dedicated wireless lab requires two wireless adapters (one for monitor mode, one for internet) and a practice access point — use your own home network with a dedicated test SSID and explicit self-authorisation.
Post-Exploitation and Persistence
Situational awareness, Windows and Linux privilege escalation, persistence mechanisms, Mimikatz credential harvesting, data exfiltration, and living-off-the-land
Post-exploitation is what happens after the initial shell. Having a shell on a system is not the objective — it is the beginning. The objective is to demonstrate the real-world impact an attacker could achieve: access to sensitive data, privilege escalation to administrator or domain admin, lateral movement to additional systems, or persistent access that survives reboots and password changes.
Situational Awareness — First Steps After a Shell
The first minutes after gaining access are critical. Before doing anything else, understand where you are, who you are, and what you can reach.
Linux Privilege Escalation — SUID and Sudo
Windows Privilege Escalation — Token Impersonation
Mimikatz — Credential Harvesting
Persistence Mechanisms
- Mimikatz requires SYSTEM or debug privilege — gaining these is the first privilege escalation goal
- Scheduled tasks with system-like names ("WindowsTelemetry") blend into the noise on unmonitored systems
- SSH authorized_keys persistence survives password resets — a critical finding to demonstrate in reports
- Credential Guard (Windows 10+) prevents Mimikatz from reading credentials from LSASS memory
- EDR detects Mimikatz via process injection patterns, LSASS access, and known signatures
- Scheduled task creation logged in Event ID 4698 — SIEM alert on new tasks created outside change windows
- Audit authorized_keys files on all Linux systems as part of incident response
- Situational awareness immediately after shell access — user context, network interfaces, sudo rights, local admins — drives all subsequent decisions
- LinPEAS and WinPEAS automate privilege escalation enumeration; SUID binaries, sudo misconfigurations, and weak service permissions are the most common findings
- Mimikatz requires SeDebugPrivilege — gaining SYSTEM first is the prerequisite for credential dumping
- SSH authorized_keys persistence survives password resets — always include it as a critical demonstration of post-compromise persistence
- Scheduled tasks blending into legitimate system tasks are a primary EDR evasion technique — creativity in naming matters in mature environments
TryHackMe: Linux PrivEsc and Windows PrivEsc are comprehensive. HackTheBox: Beep and Bounty both require privilege escalation chains. GTFOBins (gtfobins.github.io) is the reference for SUID binary exploitation.
Reporting and Communication
Report structure, finding anatomy, CVSS scoring, severity calibration, evidence quality, writing for multiple audiences, debrief meetings, and remediation verification
The penetration test report is the deliverable that clients actually pay for. Every finding you discovered, every shell you caught, every hash you cracked — none of it has value to the client unless it is communicated in a way that drives remediation. A technically brilliant engagement with a poorly written report is a waste. A thorough, clearly written report that accurately conveys risk and provides actionable remediation guidance has lasting value. Reporting is a craft, not an afterthought.
Report Structure
A professional penetration test report has four major sections, each serving a different audience:
- Executive Summary — written for non-technical decision-makers (CISO, CEO, board). No jargon. Business impact language. Three to five paragraphs covering: overall security posture, most critical findings in plain English, risk to the business, and the three to five remediation priorities that matter most. A CFO should be able to read this and understand whether the business has a serious problem.
- Scope and Methodology — what was tested, when, from what perspective (black/grey/white box), using what frameworks. Establishes the context for interpreting the findings.
- Findings — the technical core. Each finding documented with consistent structure. Ordered by severity (critical first).
- Appendices — tool output, full nmap scans, raw evidence that supports findings but is too detailed for the main body.
The Anatomy of a Good Finding
CVSS Scoring — How to Use It Correctly
CVSS (Common Vulnerability Scoring System) provides a standardised numerical score for vulnerability severity. The v3.1 base score considers: Attack Vector (network/adjacent/local/physical), Attack Complexity (low/high), Privileges Required (none/low/high), User Interaction (none/required), Scope (unchanged/changed), Confidentiality/Integrity/Availability Impact (none/low/high).
Writing the Executive Summary
- The executive summary is the most important section — non-technical decision-makers read it; use business impact language, no jargon, three to five remediation priorities
- Every finding needs: title, severity, CVSS, description, evidence, business impact, specific remediation steps, and references — vague findings don't get fixed
- CVSS scores are a starting point, not the final word — adjust severity up or down based on business context with explicit justification in the report
- Remediation guidance must be specific and actionable — "fix the SQL injection" is not guidance; "replace string concatenation with parameterised queries using PDO prepared statements" is
- Debrief meetings require translating technical findings into business consequences — practice explaining each finding in one sentence to a non-technical executive
Specialised Testing Areas
Cloud penetration testing, API security testing, mobile application testing, and IoT penetration testing — tools, methodology, and unique considerations
The core penetration testing methodology applies across all domains, but certain environments require specialised tools, techniques, and knowledge. Cloud infrastructure has a fundamentally different attack surface from on-premises. APIs have vulnerabilities unique to their architecture. Mobile applications require different tooling than desktop software. This chapter provides substantive coverage of each specialisation — enough to begin work in each area and to understand where specialised training is needed.
Cloud Penetration Testing
Cloud pentesting targets the customer's security configuration — not the cloud provider's infrastructure. The cloud provider's infrastructure is out of scope by definition (and by provider policy). What is in scope: IAM configurations, storage bucket permissions, network security groups, Lambda functions, Kubernetes cluster security, and the inter-service trust relationships that create privilege escalation paths.
API Penetration Testing
Modern applications expose functionality through APIs — REST, GraphQL, gRPC. API vulnerabilities follow the same classes as web vulnerabilities but have distinct manifestations. The OWASP API Security Top 10 provides the framework: BOLA (Broken Object Level Authorisation — the API equivalent of IDOR), Broken Authentication, Broken Object Property Level Authorisation, Unrestricted Resource Consumption, Broken Function Level Authorisation, Unrestricted Access to Sensitive Business Flows, SSRF, Security Misconfiguration, Improper Inventory Management, and Unsafe Consumption of APIs.
Mobile Application Testing
Mobile application testing combines static analysis (examining the application package without running it), dynamic analysis (testing the running application), and network traffic analysis (intercepting API calls between the app and its backend).
- Cloud pentesting targets the customer's IAM configuration and resource settings — never the cloud provider's infrastructure
- IAM privilege escalation via iam:CreatePolicyVersion requires only a single misconfigured permission to achieve full account compromise
- GraphQL introspection exposes the entire API schema including mutations not visible in the application UI — always test it first
- Certificate pinning bypass with Objection is the prerequisite for intercepting mobile app API traffic — without it the app's network calls are invisible to Burp
- Hardcoded API keys in mobile APKs are common — decompile with apktool and grep for common secret patterns before dynamic testing
Cloud: CloudGoat (intentionally vulnerable AWS environment). API: crAPI (Completely Ridiculous API — OWASP vulnerable API). Mobile: InsecureBankv2 for Android testing practice with Objection.
Career, Certifications, and Building the Skill
OSCP, PNPT, eJPT, OSEP and specialist certs, CTF platforms, bug bounty, home lab setup, the job market, and staying current
Reading about penetration testing builds vocabulary and mental models. Actual penetration testing skill comes from hours of practice — breaking intentionally vulnerable machines, building and breaking lab environments, working through real CVEs, and eventually taking on real engagements. This chapter maps the most efficient path from knowledge to employable skill, including the certifications that signal competence to employers and the resources that build it most efficiently.
Certifications — The Honest Assessment
| Cert | Body | Format | Value | Path Fit |
|---|---|---|---|---|
| eJPT | eLearnSecurity (INE) | Online lab exam, beginner | Excellent starting point; proves genuine hands-on basics; affordable | First cert before OSCP |
| PNPT | TCM Security | 5-day practical exam + report | Practical, respected, affordable ($400). Requires a real pentest report. Growing industry recognition. | Good OSCP alternative; excellent for building report writing |
| CEH | EC-Council | Multiple choice exam | Controversial — broad but no practical component. Required by some government contracts. Expensive. | Only if a specific employer requires it |
| OSCP | Offensive Security | 24-hour practical exam | The industry standard for pentesting competence. Highly respected. Genuinely difficult. Proves you can root machines under time pressure. | The primary goal for most aspiring pentesters |
| OSEP | Offensive Security | 48-hour practical exam | Advanced — antivirus evasion, custom C2, advanced AD. Post-OSCP specialist cert. | After 1–2 years of pentesting experience |
| OSWE | Offensive Security | 48-hour practical exam | Web application specialist — source code review, chaining vulnerabilities. Highly respected. | Web application specialist track |
| CRTP | Altered Security | 24-hour practical exam | Active Directory specialist — Bootcamp + exam. Excellent value; complements OSCP well. | AD specialist track; before or alongside OSCP |
Preparing for OSCP — The Realistic Path
OSCP requires rooting a set of machines in 24 hours and writing a professional report within the following 24 hours. The exam is genuinely difficult and has a meaningful failure rate. The preparation path that produces the highest success rate:
- TryHackMe — "Jr Penetration Tester" path — 6–8 weeks. Builds foundational knowledge across every domain covered in this module.
- HackTheBox — complete 30+ machines including retired machines with official writeups. Focus on Linux and Windows privilege escalation, Active Directory, and web applications.
- OffSec PEN-200 course materials — the official OSCP preparation material. Read everything, complete all exercises.
- OffSec Proving Grounds — 70+ practice machines provided with OSCP enrollment. Do all of them.
- TJ_Null's OSCP-like machine list — a curated list of HackTheBox/VulnHub machines that closely resemble OSCP exam machines. Work through as many as possible.
CTF Platforms — Building Real Skill
| Platform | Style | Best For |
|---|---|---|
| HackTheBox | Realistic machines, competitive ranking | Intermediate–Advanced; OSCP preparation; career signalling |
| TryHackMe | Guided rooms with explanations | Beginners through intermediate; structured learning paths |
| VulnHub | Downloadable VMs | Offline practice; older machines; good for lab building |
| PentesterLab | Web application focus | Web testing skill building; excellent structured progression |
| PortSwigger Web Academy | Web application labs | The definitive free web testing resource; lab for every OWASP category |
| CyberDefenders | DFIR + blue team with red team elements | Understanding the defender side of attacks you're learning |
Bug Bounty — Real-World Experience and Income
Bug bounty programmes pay independent researchers for discovering and reporting vulnerabilities within defined scope. The major platforms are HackerOne, Bugcrowd, and Intigriti. The realistic picture:
- Top researchers earn six figures annually from bug bounty — this is exceptional, not typical
- Most researchers earn sporadically and unpredictably — it is not a reliable income replacement until you have a track record of significant findings
- Bug bounty is excellent as a supplement to other income and as a mechanism for building skills on real systems with real scope
- Start with large programmes with broad scope and a history of paying reasonable amounts (Google VRP, Apple Security Bounty, Microsoft MSRC) rather than small programmes that may dispute or not pay
- IDOR and information disclosure bugs are the highest-probability findings for new researchers — practise web application testing before beginning bounty work
Staying Current
The penetration testing landscape changes continuously — new techniques, new tools, new CVEs, new defensive controls to bypass. The practitioners who stay sharp:
- Blogs and write-ups — 0xdf.gitlab.io (HackTheBox write-ups), ired.team (red team notes), harmj0y.net (AD attacks), s3cur3th1s.github.io, posts on Medium's InfoSec community
- Twitter/X security community — follow practitioners who share techniques: @harmj0y, @_dirkjan, @gentilkiwi (Mimikatz author), @orange_8361, @TomNomNom
- Conferences — DEF CON (Las Vegas, August) and its CFP villages; Black Hat USA/Europe; BSides events (local, affordable, community-focused)
- Podcasts — Darknet Diaries (attack stories); Smashing Security; Risky Business (security news)
- Practice continually — the most important factor is simply spending time breaking things; reading about techniques without practising them produces knowledge, not skill
- OSCP is the industry-standard pentesting certification — prepare with 3–6 months of HackTheBox practice, TJ_Null's machine list, and the official course materials before attempting
- PNPT is an excellent affordable alternative that requires a real report — it develops skills that OSCP alone doesn't emphasise
- Bug bounty is real-world practice with real consequences — start with information disclosure and IDOR on large programmes; don't rely on it for income until you have consistent findings
- HackTheBox rank and write-up quality are the most credible signals for early-career pentesting job applications — more credible than most certifications to experienced hiring managers
- The skill is built through hours of practice, not hours of reading — use this module as the framework that makes your lab time more efficient, not as a substitute for it