How a penetration test works: scope to report
Permission, rules, four phases and a report someone can act on
Follow one authorized penetration test from the first scoping call to the final report. Learn what the rules of engagement say, what the four phases are, and why the report is the thing the client buys.
beginner level, 15 minutes, 16 slides.
How a penetration test works: scope to report
Welcome. Follow one authorized penetration test from the first scoping call to the final report. Learn what the rules of engagement say, what the four phases are, and why the report is the thing the client buys. This talk runs about 15 minutes.
A penetration test is permission to attack, on paper
NIST describes penetration testing as security testing in which evaluators mimic real-world attacks to find ways around the security features of a system. The UK NCSC calls it a method for gaining assurance in the security of an IT system by trying to breach it, using the same tools and techniques an adversary might.
This talk is about authorized testing only: Everything here assumes a signed agreement from the owner of the systems. Testing anything you do not own, or have no written permission to test, is not penetration testing.
Welcome. A penetration test is a controlled attack. Someone who owns a system pays a skilled person to try to get in, so the weak spots are found by a friend before an enemy finds them. Two official definitions say the same thing: mimic a real attack, using the same tools and techniques. The word that matters most is authorized. Everything in this talk assumes the owner has agreed in writing.
Scan or penetration test?
Vulnerability scan
- Checks only for the possible existence of a weakness
- Mostly automatic
- Quick to repeat
Penetration test
- Tries to exploit the weakness to confirm it is real
- Tester judgement, not just tools
- Labor-intensive and needs real expertise
From NIST SP 800-115: Vulnerability scanners check only for the possible existence of a vulnerability, while the attack phase of a penetration test exploits it to confirm that it exists.
People mix up two jobs. A scan asks, does this system look like it has a known weakness? A penetration test asks, can I actually use that weakness, and what could I reach next? NIST puts it plainly: scanners check for the possible existence of a vulnerability, the attack phase confirms it by exploiting it. That is why a test costs more and needs more skill.
Permission comes first: the rules of engagement
NIST defines the Rules of Engagement (ROE) as detailed guidelines and constraints for running a security test. They are set before testing starts and give the test team authority to conduct defined activities without needing extra permissions.
What that means in practice: The paper is what separates a tester from an intruder. Activities outside the paper are not authorized, even if they would be easy.
- Signed before the first scan
- Names the people on both sides
- States what is in and out of bounds
The rules of engagement are the heart of the job. NIST says they are written before the test and give the team authority to do defined activities without asking again. Notice the word defined. If it is not defined, it is not allowed. The final line on this slide, that the paper separates a tester from an intruder, is our way of saying it, not a NIST quotation.
What goes into the rules of engagement
| Section (NIST template) | What it settles |
|---|---|
| Scope and risks | Test boundaries, assumptions, and the risks of intrusive tests |
| Personnel and schedule | Named people on both sides, and the hours testing may run |
| Target systems | What may be tested, plus an exclude list of what may not |
| Communication and incident handling | Who talks to whom, and the criteria for halting the test |
| Testing execution | Allowed and unallowed activities, and the methodology |
| Data handling | How test data is gathered, stored, sent and destroyed |
| Reporting | What reports are due, and when |
The exclude list: NIST calls any system not authorized for testing the exclude list. Fragile or off-limits systems belong on it.
NIST gives a template for the rules of engagement in an appendix. We have condensed it. It covers scope and risks, who the people are, when testing can happen, which systems are in and which are on the exclude list, how to communicate, what to do if something goes wrong, how test data is handled, and what reports are expected. You do not need to memorize the headings. You need to see that every one of them answers a question that will otherwise be argued about at the worst moment.
Scoping: the conversation before the contract
The UK NCSC says scoping a penetration test should involve all the relevant risk owners, technical staff who know the target system, and a representative of the penetration test team.
- Risk owners point out areas of special concern
- Technical staff explain the boundaries of the estate
- The test team says what testing would give a full picture
- Special needs are raised early, such as out-of-hours testing or critical systems that need special handling
Before anything is signed there is a scoping conversation. The NCSC says three kinds of people should be in it: the people who own the risk, the technical people who know the system, and someone from the test team. Each brings something the others lack. Special requirements, like testing outside office hours or protecting a critical system, are raised here so nobody is surprised later.
How much do the testers know?
| Approach | What testers are told | What it shows |
|---|---|---|
| Open box (transparent) | Full information about the target | Known weaknesses and common misconfigurations (NCSC) |
| Closed box (opaque) | Nothing about the internals | Ways in from an outside view; may miss things in the time allowed (NCSC) |
Outsider scenario (NIST)
- Little or no specific knowledge of the target
- Starts from target addresses and open-source research
Insider scenario (NIST)
- Starts inside the network with some access
- Tries to gain more access through privilege escalation
Two choices shape a test. How much do the testers know? Open box means they are told everything, which is efficient for finding known weaknesses. Closed box means they know nothing, which is closer to how an unknown attacker works but may leave things undiscovered in the time available. And where do they start? NIST describes an outsider scenario with little knowledge and an insider scenario that starts behind the firewall with some access.
Four phases
NIST SP 800-115 Figure 5-1. Attack findings feed back into discovery.
- Planning: Rules set, approval documented, goals chosen
- Discovery: Information gathering, scanning, vulnerability analysis
- Attack: Verify weaknesses by trying to exploit them
- Reporting: Written up alongside every phase
No testing in planning: NIST says no actual testing occurs in the planning phase. It sets the groundwork.
NIST breaks a test into four phases. Planning, where rules are set and approval is documented, and no testing happens. Discovery, where the testers gather information and look for weaknesses. Attack, where they try to verify those weaknesses are real. And reporting, which runs alongside the others. NIST notes this is one acceptable way of grouping the work, not the only one. There is also a loop: what you learn in attack sends you back to discovery.
Discovery: learn the target
- Port and service identification finds potential targets
- Host names and addresses come from sources such as DNS and WHOIS queries
- Banner grabbing records application and service versions
- Vulnerability analysis compares what was found with vulnerability databases, such as the National Vulnerability Database, and with the testers' own knowledge
Scoped addresses only: NIST says if you are given a list of target addresses, verify that public addresses belong to the organization before testing begins.
Discovery has two parts. First, information gathering and scanning: which ports are open, which services answer, what names and addresses exist, what version numbers are announced. Second, vulnerability analysis, which compares those findings with databases of known weaknesses. One more NIST point worth remembering: check that the public addresses you were given really belong to your client before you touch them.
Attack: prove it without breaking it
In the attack phase testers verify the weaknesses they found by attempting to exploit them. If an attack works, the weakness is confirmed and the fix can be described.
- Penetration testing is an iterative process that uses minimal access to gain greater access
- NIST warns that systems may be damaged or made inoperable during a test, a risk that can never be fully eliminated
- A test can be designed to stop when an extra action would cause damage
Check yourself: Why do the rules of engagement set criteria for halting a test?
Answer: Because real attacks on real systems can cause harm, and the client wants it to stop before that happens. NIST notes that penetration testing uses real attacks and can damage systems, so tests can be designed to stop when more action would cause damage, and the ROE sets the halting criteria.
This is the exciting part, and also the dangerous part. Testers try to exploit what they found to prove it is real. NIST is honest that this can damage systems, and the risk cannot be removed completely. So tests are designed to stop at the point where one more step would cause harm. Notice also that testers use small access to get bigger access. That chain, rather than any single flaw, is often what a client most needs to see.
What testers commonly exploit
| Category (NIST) | In plain words |
|---|---|
| Misconfigurations | Settings left insecure, especially insecure defaults |
| Insufficient input validation | A program trusts what users type, for example SQL injection |
| Incorrect file and directory permissions | Files readable or writable by people who should not touch them |
| Buffer overflows | A program does not check input length |
| Race conditions | An attack timed to catch a program while it holds extra privileges |
Lots of boring, fixable causes: Misconfigurations and weak permissions are plain mistakes. That is why reports spend so much time on how to fix, not just what broke.
NIST lists the kinds of weakness testers most often use. Many are ordinary: a setting left at an insecure default, a file with the wrong permissions, a program that does not check what a user types. A few are subtler, like buffer overflows and race conditions. The useful lesson for a beginner is that a lot of this is fixable housekeeping, which is why the report matters so much.
Safety rails: contacts, physical tests and stop rules
- The ROE should say what happens if a test hurts the network or a real adversary attacks during the test
- It should include the organization's incident response contacts in a quick-reference form
- For physical testing, NIST says security guards should be able to verify tester activity through a point of contact or documentation
- NIST also advises a form with signatures and contacts that the team can show to law enforcement or on-site security if questioned
Two things can look alike: A real intruder and the test team can look the same in the logs. Agreed contacts and halting criteria are how the organization tells them apart.
Good tests plan for things going wrong. The rules say who to call, and when to stop. If a real attacker shows up in the middle of your test, the client needs a way to tell their activity from yours. For physical tests, where a tester may walk into a building, NIST says guards should have a way to verify who is allowed, and testers should carry a signed form to show if challenged.
The report is what the client buys
- Describe. The issues found, clearly enough to repeat
- Rate. A risk rating for each issue; the NCSC notes testers often use the Common Vulnerability Scoring System
- Advise. A way of resolving each issue
- Debrief. A meeting where the team runs through the findings and the client can ask questions
Handle the data as sensitive: NIST says results of any security test identify weaknesses an adversary could exploit, so they should be considered sensitive.
At the end, the client does not get a shell or a trophy. They get a report. NIST says it should describe the vulnerabilities, rate the risk, and give guidance on mitigation. The NCSC adds that a debrief meeting is useful. And because the report is a map of the client's weak points, it is sensitive and must be handled that way. A great test with a muddled report has wasted the client's money.
A test is a snapshot, not a shield
The NCSC says a penetration test can only validate that your systems are not vulnerable to known issues on the day of the test, and that a year or more may pass between tests.
- NIST suggests regular scanning interspersed with periodic penetration testing
- The NCSC says the quality of a test is closely linked to the abilities of the testers
- The NCSC says the client is responsible for risk assessment and decisions on fixes after the report
Check yourself: A client passed a penetration test in January. What does that tell you in November?
Answer: That they had no known issues of the kind tested on the day of the test; later changes are unchecked. The NCSC says a test validates only that systems are not vulnerable to known issues on the day of the test.
Last idea. A passed test is a snapshot. The NCSC says it only shows you were not vulnerable to known issues on that day, and a year or more can pass between tests. So it works best alongside regular scanning, which is what NIST recommends, and a client who owns the decisions about what to fix. Next, try the labs: scope a test, scan your own network, and write a report.
Practise this
- Scope a penetration test and write the statement of work
- Scan your own home network with Nmap
- Turn your own lab findings into a client-ready pentest report — with CVSS v4.0 scores and remediation
- Run a penetration test readout and handle disputed findings
Slides only get you so far. Pick one of these hands-on labs and do it today while it is fresh. Every lab is free.
Sources
- NIST glossary: penetration testing
- UK NCSC: Penetration testing
- NIST SP 800-115 (full text, sections 5.2 and Appendix B)
- NIST glossary: Rules of Engagement (ROE)
Every claim in this deck came from these pages, fetched and checked for this release. Read the originals.
Hands-on labs for this deck
- Scope a penetration test and write the statement of work
- Scan your own home network with Nmap
- Turn your own lab findings into a client-ready pentest report — with CVSS v4.0 scores and remediation
- Run a penetration test readout and handle disputed findings
Open the interactive deck or see all slide decks.
Related
- Scope a penetration test and write the statement of work
- Scan your own home network with Nmap
- Turn your own lab findings into a client-ready pentest report — with CVSS v4.0 scores and remediation
- Run a penetration test readout and handle disputed findings
- All slide decks
- What is Penetration testing?
- What is Common Vulnerability Scoring System?
- What is Internet Protocol?
- What is Port scanning?
- Free cyber labs