What a Penetration Test Is (and Isn't)
A company asks for "a pentest" and receives a 300-page PDF exported from a scanner, with every finding rated by the tool's defaults and no proof that any of them is real. Another company asks for "a pentest" and gets a team that phished the finance department, which nobody had agreed to. Both are failures of the same kind: nobody agreed what the engagement was supposed to answer. The words vulnerability scan, penetration test, red-team exercise, bug bounty and audit name different services with different questions, methods and risks. Choosing the right one, and saying which one you are delivering, is the first professional skill.
Five services, five questions
| Service | The question it answers | Method | Typical length | Who knows it is happening |
|---|---|---|---|---|
| Vulnerability scan | Which known weaknesses are visible on these hosts right now? | automated tools (Greenbone/OpenVAS, Nessus, Qualys), signatures matched against versions and responses | hours, repeated weekly or monthly | the operations team |
| Vulnerability assessment | Which of those weaknesses are real, and which matter most here? | a scan plus human triage, validation and prioritisation | days | the operations team |
| Penetration test | Within this scope, how far can a skilled attacker get, and what should we fix first? | manual testing guided by a methodology, controlled validation, impact assessment, a report and a retest | 1–4 weeks | the client's contacts; often the blue team too |
| Red-team exercise | Would we detect and stop a realistic adversary pursuing a goal ("read the payroll database")? | objective-driven, stealthy, may include phishing and physical access if agreed, emulates a named threat's techniques | weeks to months | a small "white cell" only; the defenders are being tested |
| Bug bounty | What can many independent researchers find in these public assets over time? | crowd testing under a published policy, paid per valid finding | continuous | everyone; the policy is public |
An audit (ISO/IEC 27001, SOC 2, PCI DSS) is different again: it checks that controls exist and are operated as documented, by sampling evidence. An audit may require a penetration test (PCI DSS does, for example), but it does not perform one.
A penetration test sits between the automated breadth of a scan and the stealthy depth of a red team. Its distinguishing features are a human who reasons about the target, controlled validation of what is found, an impact assessment in the client's context, and a report whose findings are reproducible and retested.
Variations of the penetration test
- Knowledge given to the tester: black box (only a name or an address range), grey box (accounts, documentation, network diagrams) and white box (source code, configuration, architecture). Grey box gives the most findings per day; black box mostly measures how much time the tester wasted on discovery.
- Position: external (from the Internet, as an outsider), internal (from a laptop on the office network or a VPN account, as a compromised employee or visitor), assumed breach (starting from a given low-privileged account or host).
- Target type: network, web application, API, mobile app, cloud tenant, wireless, Active Directory. Each has its own methodology; this course covers the common engagement frame and the network side, and Web Application Security the web side.
Choosing the service, as code
The decision follows from the question the client asks and the constraints it states. This small function makes the reasoning explicit; the inputs are what a good scoping call establishes.
def recommend(question, *, detection_tested=False, public_assets=False, need_proof=True, days=10):
if question == "known weaknesses, regularly":
return "vulnerability scan (scheduled), then triage: a vulnerability assessment"
if question == "would we notice an attack":
if days < 20:
return "purple-team exercise: too short for a red team; test detections openly with the defenders"
return "red-team exercise with a white cell; requires board-level authorization"
if question == "find bugs continuously" and public_assets:
return "bug bounty or vulnerability disclosure programme, with a published scope"
if question == "how far can an attacker get":
kind = "penetration test"
if detection_tested:
kind += " with blue-team observation (record which steps were detected)"
if not need_proof:
kind += "; note: without validation it degrades to an assessment"
return kind
return "clarify the question before buying anything"
calls = [
("known weaknesses, regularly", {}),
("how far can an attacker get", {"detection_tested": True}),
("how far can an attacker get", {"need_proof": False}),
("would we notice an attack", {"days": 10}),
("would we notice an attack", {"days": 40}),
("find bugs continuously", {"public_assets": True}),
("make us secure", {}),
]
for question, opts in calls:
print(f"{question:<29} {opts!s:<27} -> {recommend(question, **opts)}")known weaknesses, regularly {} -> vulnerability scan (scheduled), then triage: a vulnerability assessment
how far can an attacker get {'detection_tested': True} -> penetration test with blue-team observation (record which steps were detected)
how far can an attacker get {'need_proof': False} -> penetration test; note: without validation it degrades to an assessment
would we notice an attack {'days': 10} -> purple-team exercise: too short for a red team; test detections openly with the defenders
would we notice an attack {'days': 40} -> red-team exercise with a white cell; requires board-level authorization
find bugs continuously {'public_assets': True} -> bug bounty or vulnerability disclosure programme, with a published scope
make us secure {} -> clarify the question before buying anything
The last line is the most common real case. "Make us secure" is not a question a test can answer; a scoping call turns it into one of the others.
How a mislabelled engagement is detected
Clients and reviewers can spot a scan sold as a penetration test:
- No manual findings. Every finding has a scanner plugin id; there are no access-control, logic or chained findings, which tools can't find.
- No validation evidence. Findings say "the version suggests…" with no request, response or screenshot showing the weakness is real.
- Default severities. Ratings never deviate from the tool's, and nothing is said about the client's context.
- No methodology or limitations section. A real report says what was tested, how, and what was not tested.
- No retest. Nobody comes back to check the fixes.
The opposite mislabel, a red-team exercise run as a "pentest", shows up as activity outside the agreed techniques: phishing, physical entry or stealth that nobody authorised.
How it is prevented
Write the engagement type, the question it answers and the methods into the statement of work and the rules of engagement. Ask for a sample report from a test provider before buying; check that its findings have evidence and that a methodology and limitations section exists. Standards bodies help: CREST (UK and international) and similar schemes accredit testing companies and their testers, and the PCI Security Standards Council publishes penetration-testing guidance for card-data environments.
Pitfalls
- Calling a scan a test to meet a compliance requirement. Auditors increasingly read the report, and the weaknesses remain.
- Black box by default. It feels realistic, but a real attacker has months; a tester has days. Give the tester the documentation an insider would have.
- Testing production without a rollback plan, or testing a copy that differs from production so much that the results don't transfer.
- A red team without detection goals: if nobody records what the defenders saw, the client learns only that the red team won.
Practice
- A hospital wants to know whether its new patient portal, going live in three weeks, can be abused by a logged-in patient to see another patient's records. Which service, which knowledge level, and why?
- A board member asks: "If a criminal gang targeted us, would our SOC notice?" The budget is two weeks. What do you recommend?
- A scan report lists "Apache 2.4.49 path traversal (CVE-2021-41773)" against a host. What has to happen before this belongs in a penetration test report?
Answers
- A grey-box web application penetration test with at least two patient test accounts (authorization testing needs two users) and access to the API documentation, before go-live, plus a retest after fixes.
- Two weeks is short for a stealthy red team. A purple-team exercise (testers run agreed techniques openly while defenders watch their detections) answers the question faster and teaches the SOC more; the function above says the same.
- Validation: confirm the version from more than the banner, check the configuration conditions the CVE needs, and prove the weakness safely (or show why it is not exploitable here), then assess the impact in context. Unvalidated, it belongs in an appendix of scanner results, marked as such.
Test yourself
What distinguishes a penetration test from a vulnerability scan?
- It uses more tools
- A human reasons about the target, validates findings in a controlled way, assesses impact and reports reproducibly
- It is always black box
- It never uses scanners
Which service primarily tests whether the defenders detect and respond to a realistic adversary?
- Vulnerability scan
- Bug bounty
- Red-team exercise
- Compliance audit
Why is grey box often the best value for a time-boxed penetration test?
- It is cheaper because no report is needed
- The tester spends the limited days testing instead of rediscovering what any insider knows
- It avoids the need for authorization
- It makes findings easier to fake
A report has only scanner plugin findings with default severities and no evidence. What is it?
- A thorough penetration test
- A vulnerability scan, whatever it is called
- A red-team report
- An audit