Penetration testing is a controlled, authorised attempt to break into a system in order to find its weaknesses before real attackers do, and it is one of the most direct ways to test whether security defences actually work. A penetration test, often called a pen test, uses the same techniques an attacker would use, but with permission, agreed limits and a report at the end. In short, penetration testing answers a simple question: if someone tried to break in, could they, and how far would they get?
The key word is authorised. Without written permission and a clear scope, the same activity is a crime in most jurisdictions. With permission, it is a professional service that helps organisations find flaws that scanners and checklists miss.
A good pen test does more than list vulnerabilities. It shows which ones can actually be exploited, what an attacker could reach through them, and what to fix first. That evidence is what makes the findings hard to ignore.
Key takeaways
- Penetration testing is an authorised, simulated attack that finds and exploits real weaknesses before criminals do.
- It differs from vulnerability scanning: a scan lists possible flaws, while a pen test proves which ones can be exploited.
- Tests vary by how much the tester knows in advance: black-box, white-box and grey-box.
- The Penetration Testing Execution Standard defines seven phases, from pre-engagement to reporting.
- A useful report ranks findings by risk, shows the impact of each exploit, and gives clear remediation steps.
What penetration testing actually is
A penetration test is a planned exercise in which security professionals attempt to compromise systems, applications or networks, working within rules agreed in advance. The testers, sometimes called ethical hackers, probe defences, try to exploit weaknesses, and document exactly what they could do. The goal is not to cause damage, but to show where damage is possible.
Penetration testing differs from vulnerability scanning in an important way. A scanner checks a system against a list of known flaws and reports matches, many of which may not be exploitable in practice. A pen test goes further by attempting the exploit, which separates real risk from noise and often uncovers flaws that no scanner knows about, such as broken business logic.
It also differs from a security audit. An audit checks whether controls exist and policies are followed, while a pen test checks whether those controls hold up under attack. Both have value, but only a pen test shows what an attacker could actually achieve. Our guide to AI security testing tools teams actually need to know covers the tooling that supports both kinds of work.
Best for: any organisation that wants evidence, rather than assumptions, about how its defences perform under attack.
Why organisations run penetration tests
The most common reason is risk reduction. A pen test finds the weaknesses that matter most, before an attacker finds them, and gives the team a prioritised list to fix. It is far cheaper to fix a flaw found in a test than to recover from a breach that exploited it.
Compliance is another driver. Many standards and regulations expect regular testing, and some, such as the payment card industry standard, require it outright. A pen test report provides the evidence auditors ask for, and it shows that the organisation takes its obligations seriously.
Testing also validates investment. An organisation that has spent money on firewalls, monitoring and training needs to know whether those controls work together. A pen test exercises them as a system, and the results often surprise teams that assumed they were protected. It also prepares incident response teams, who learn how a real attack looks in their own environment.
Black-box, white-box and grey-box testing
Black-box, white-box and grey-box describe how much knowledge the tester starts with. In a black-box test, the tester knows almost nothing about the target, just as an outside attacker would. The test is realistic, but it can be slow, because the tester must discover everything from scratch.
In a white-box test, the tester is given full information: source code, architecture diagrams, credentials and network maps. This lets the test go deeper and cover more ground in the same time, and it is the best choice when the goal is thorough coverage rather than realism. Grey-box testing sits between the two, with partial knowledge such as a standard user account, which mirrors an attacker who has already gained a foothold or an insider threat.
Neither approach is universally better. Black-box tests suit organisations that want to know what an outsider can achieve, while white-box tests suit teams that want the deepest possible review of an application or system. Many programmes use a mix, and the choice should follow the question the test is meant to answer.
Best for: black-box testing for realistic external attack simulation, white-box for deep application review, and grey-box for insider-threat scenarios.
The seven phases of a penetration test
The Penetration Testing Execution Standard, known as PTES, defines seven phases: Pre-engagement Interactions, Intelligence Gathering, Threat Modelling, Vulnerability Analysis, Exploitation, Post Exploitation, and Reporting. The standard gives tests a consistent structure, so results can be compared and repeated.
Pre-engagement is where the scope, rules and legal basis are agreed, including which systems are in bounds and what the testers must never do. Intelligence gathering follows, as testers collect public information about the target, and threat modelling uses that information to decide which attack paths are most likely. Vulnerability analysis then identifies weaknesses, which exploitation attempts to prove by actually using them.
Post exploitation explores what an attacker could do after the first break-in, such as reaching other systems or sensitive data, and reporting turns everything into findings with evidence and remediation advice. NIST SP 800-115, a widely used guide to penetration testing, covers the same ground in four stages: planning, discovery, attack and reporting. Our practical AI incident response playbook shows what happens when the weaknesses a pen test finds are left unfixed.

Penetration testing vs vulnerability scanning
| Feature | Vulnerability scanning | Penetration testing |
|---|---|---|
| Goal | List known flaws | Prove exploitability and impact |
| Method | Automated checks | Human-led, tools plus manual skill |
| Depth | Broad, shallow | Narrower, much deeper |
| Finds new flaws? | Rarely | Yes, including logic flaws |
| Frequency | Weekly or continuous | Typically once or twice a year |
| Output | List of possible issues | Evidence, impact and remediation |
The two are complementary, not rivals. Scanning runs often and catches known flaws quickly, while penetration testing runs less often and answers the harder question of what an attacker could really do. An organisation that does only one of them has an incomplete picture.
What a good pen test report contains
A useful report starts with an executive summary that a non-technical reader can understand, stating the overall risk and the most important findings in plain language. Technical detail follows, with each finding explained, its severity justified, and the exact steps used to exploit it so the team can reproduce the problem.
Good reports also show impact in business terms. A finding that says an attacker could read customer records is more persuasive than one that names a technical flaw without explaining what it enables. Remediation advice should be specific enough to act on, with the most urgent fixes listed first and, where possible, suggestions for preventing the same class of flaw elsewhere.
Finally, a report should be honest about limits. It should state what was in scope, what was not tested, and what the testers could not reach. A pen test that finds nothing is not proof of security, only evidence that the tested paths held up during the test. Retesting after fixes confirms that the remediation worked, and it is a step worth building into every engagement.
Choosing and scoping a penetration test: a checklist
- Define the question the test must answer, and scope it to the systems that matter most.
- Agree the rules in writing: in-scope targets, forbidden actions, and how to handle sensitive data.
- Choose black-box, white-box or grey-box based on whether realism or depth matters more.
- Check the testers’ experience with your technology stack and ask for sample reports.
- Schedule the test so findings arrive in time to act before the next release or audit.
- Plan remediation and retesting before the test starts, not after the report lands.
- Brief your monitoring team so the test is detected and handled, not mistaken for a real attack.
Frequently asked questions
Is penetration testing legal?
Yes, when it is authorised in writing by the owner of the systems being tested, with an agreed scope. Testing without permission is illegal in most jurisdictions, even if the intent is to help.
How is penetration testing different from hacking?
The techniques overlap, but the purpose and permission differ. A penetration tester works with authorisation, within agreed limits, and reports findings so they can be fixed. A criminal hacker works without permission and exploits findings for gain.
How often should penetration testing be done?
At least once a year for most organisations, and after any major change such as a new application, a migration or a merger. High-risk systems may need testing more often.
How long does a penetration test take?
It depends on scope. A single web application may take one to two weeks, while a large network or a complex environment can take several weeks. Scoping and reporting add time on either side of the active testing.
Can penetration testing damage my systems?
Reputable testers work to avoid damage, and the rules of engagement exclude dangerous actions such as denial-of-service attacks. Minor disruption is possible, which is why tests are usually scheduled outside peak hours.
What happens after a penetration test?
The team receives a report, fixes the findings in priority order, and then commissions a retest to confirm the fixes work. The findings also feed into longer-term improvements, such as secure coding training and better configuration.







