Notes
What a pentest is
A penetration test is a simulated attack on a system whose owner has asked you to test it. The goal is to find weaknesses that a real attacker could use, and to prove how far they lead. It is time-boxed, usually one to three weeks. The product is not the hack; the product is a report the owner can act on. And the difference between a penetration tester and a criminal is exactly one thing: written permission.
- a simulated attack on a system the owner asked you to test
- goal: find weaknesses a real attacker could use, and prove their impact
- time-boxed: days or weeks
- output: a report the owner can act on without permission it is not a pentest; it is a crime
Scan, pentest, red team
Four things are often confused. A vulnerability scan is automated and broad; it lists possible problems. A penetration test adds people, who verify those problems and chain them together inside an agreed scope. A red team exercise is quieter and goal-based, such as reach the payment database, and it tests whether the defenders notice. A bug bounty invites outside researchers and pays per valid finding. Companies use all four, for different purposes.
- vulnerability scan: automated, broad, lists possible issues
- penetration test: humans verify and chain issues in an agreed scope
- red team: a quiet, goal-based attack that tests people and detection too
- bug bounty: outside researchers, paid per finding
Phase 1: scope
Phase one is scoping, and it happens before any tool is run. What is in scope: which domains, address ranges, applications and accounts. What is explicitly out of scope. Which techniques are allowed, and at what hours. A signed authorisation letter. Emergency contacts on both sides in case something breaks. And how any sensitive data you come across will be handled. The next episode covers scope and rules of engagement in detail.
- what is in scope: domains, IP ranges, apps, accounts
- what is out of scope
- allowed techniques and times
- a signed authorisation letter
- emergency contacts on both sides
- how data found is handled
- next episode covers this in detail
Phase 2: reconnaissance
Phase two is reconnaissance: learning as much as possible before touching the target. Passive recon uses only public sources, such as DNS records, certificate logs, search engines, code repositories, staff names and old password leaks. Active recon starts talking to the target. The output is a list of assets and technologies. For defenders there is a sobering point here: passive reconnaissance does not touch your systems, so you cannot see it happening.
- passive: public sources only; DNS, certificates, search engines, code repos, staff names, leaked passwords
- active: talking to the target; DNS queries, web requests
- output: a list of assets and technologies
- defender view: passive recon is invisible to you
Phase 3: scanning
Phase three is scanning and enumeration. A port scan finds which services are reachable. Version detection identifies the software behind them. Enumeration pulls out detail: user names, file shares, web directories, API endpoints. A vulnerability scan matches versions against known weaknesses. The output is a list of candidates that still have to be verified. For defenders, this phase is noisy: firewalls, intrusion detection and web logs should all show it.
- port scan: which services are reachable
- service and version detection
- enumeration: users, shares, directories, API endpoints
- vulnerability scan: match versions to known CVEs
- output: a list of candidate weaknesses, to be verified
- defender view: very noisy
Phase 4: exploitation
Phase four is exploitation: turning a candidate into proof. Proof might be a login, a file you should not be able to read, or code running on the server. The usual ways in are unglamorous: weak or reused passwords, missing patches, web application flaws and misconfiguration. A professional exploits with care: nothing that could take the service down or destroy data, only as far as the rules allow, and with every step and its time written down.
- turn a candidate into proof: a login, a file read, code running
- common ways in: weak or reused passwords, missing patches, web flaws, misconfiguration
- care: no denial of service, no data destruction
- record every step and time
Phase 5: post-exploit
Phase five is post-exploitation. One foothold is only a start; the real question is what it leads to. What can this account see? Can a normal user become an administrator, which is privilege escalation? Can you move from this machine to the next, which is lateral movement? Can you reach the agreed goal, such as customer data or cloud keys? This phase shows the real business impact. And at the end, the tester removes every account, file and tool they added.
- what can this account see?
- privilege escalation: user to administrator
- lateral movement: one machine to the next
- reach the agreed goal: domain admin, customer data, cloud keys
- shows real business impact
- then: clean up everything
Phases 6 and 7
Phases six and seven. The report is the actual product. It has an executive summary in plain language, and for every finding: what it is, where, the evidence, a severity rating and how to fix it. It shows the attack path step by step. A debrief walks the teams through it. Then, after the fixes, a retest confirms each finding is closed. As a security engineer inside a company, you will be on the receiving end of these reports, and you turn them into work.
- executive summary: risk in plain language
- each finding: what, where, evidence, severity, how to fix
- the attack path, step by step
- a debrief with the teams
- retest after fixes: closed, or still open
- findings go into the backlog
Box colours
Tests differ in how much the tester is told. Black box: nothing, which simulates an outsider but spends most of the time on discovery. Grey box: some access and documentation, such as a normal user account. White box: source code, architecture diagrams and administrator access, which finds the most per day of testing. Most tests today are grey box, because you are paying for findings, not for the tester to guess what you could simply tell them.
- black box: no information; realistic outsider, but slow and shallow
- grey box: some access and documentation, e.g. a normal user account
- white box: source code, designs, admin access; deepest coverage per day
- most tests today are grey
Standards
Professional tests follow named methods, so the work is repeatable. PTES, the penetration testing execution standard, defines the phases we just covered. The OWASP web security testing guide lists what to test in a web application. NIST special publication eight hundred one fifteen covers technical security testing. And MITRE ATT and CK is the catalogue of real attacker techniques that both testers and defenders use as a common language. Expect interviewers to name these.
- PTES: Penetration Testing Execution Standard
- OWASP WSTG: the web security testing guide
- NIST SP 800-115: technical security testing
- OSSTMM
- MITRE ATT&CK: the catalogue of attacker techniques
- reports reference these
The defender view
Now the defender's view, which this course adds to every attack. Recon leaves almost nothing. Scanning should light up firewall, intrusion detection and web logs. Exploitation shows as web firewall alerts, failed logins and crashes. Post-exploitation shows as new processes, unusual administrator logins and odd connections between machines. If a penetration test produces no alerts at all, that is itself a finding: your detection has a gap.
- recon: little; watch CT logs and your own exposure
- scanning: firewall, IDS and web logs light up exploitation: WAF alerts, failed logins, crashes
- post-exploitation: new processes, admin logins, unusual connections
- no alerts in a test is a finding too
Common mistakes
Mistakes. Testing without written permission, which is illegal however good your intentions. Drifting outside the agreed scope. Selling or buying an automated scan as a penetration test. Testing production with no emergency contacts. A report with no evidence, or no advice on fixing. On the company side: fixing each finding individually without asking what root cause produced them all, and never retesting.
- testing without written permission
- drifting out of scope
- treating a scan as a pentest
- testing production blind, with no contacts
- a report with no evidence or no fixes
- fixing findings one by one, not the root cause
- never retesting
Say it like this
In the interview: it starts with scope and written authorisation, including rules of engagement. Then reconnaissance to map the attack surface, scanning and enumeration to find candidate weaknesses, exploitation to prove them, and post-exploitation to show the real impact, such as privilege escalation and lateral movement. Then cleanup, a report with evidence, severity and remediation, and a retest. I would add that I map findings to MITRE ATT and CK and check what our detection saw.
- "It starts with scope and written authorisation. Then recon, scanning and enumeration, exploitation to prove impact, post- exploitation to show how far
- it goes, cleanup, a report
- with evidence and fixes, and a retest."