Bookmarks

Penetration testing

A test of a system’s defences in which specialists imitate the attacks of a real adversary and try to bypass its security controls, just as an attacker would.

Also: pentest, pen test, penetration test

checked 9 Nov

All terms

A pentest asks a different question from vulnerability scanning: not “which known weaknesses are visible in the system” but “what could an attacker actually do”. Specialists attack the system under agreed rules: they look for chains of weaknesses, gain access and show how far they could get. The methodology is described in NIST SP 800-115.

How the test is carried out

NIST SP 800-115 describes four phases. The first is planning: the parties agree the rules of engagement, set the goals of the test and obtain written permission from the system owner; no testing takes place in this phase. Then comes discovery — gathering information about the targets, scanning ports and services and matching the findings against vulnerability databases. The third phase is attack: hypotheses are tested with exploits and every successful attack confirms a vulnerability; after the breach the attack often continues from inside the system, in search of the next step. The report is written in parallel with all the phases.

PhaseWhat happens
Planningrules and scope of the test, goals, written permission from the system owner
Discoveryinformation gathering, port and service scanning, vulnerability analysis
Attackhypotheses tested with exploits, vulnerabilities confirmed, access expanded
Reportinglogging throughout the test, a final report with threats and protective measures

How it differs from vulnerability scanning

A scanner finds known weaknesses using vulnerability databases and can run as often as every night in CI. A pentest is carried out by people, rarely — usually once a year and after major changes — and it shows how weaknesses add up to a real attack path: through a chain of several vulnerabilities an attacker gains more access than any one of them would give on its own. A pentest therefore complements scanning rather than replacing it.

Types of pentest

  • White box — the specialists know everything about the system: source code, diagrams and configuration.
  • Black box — only the address is known and the team finds out everything else itself, like an external attacker.
  • Gray box — something in between: for example, a regular user account.

The scope is chosen separately: a single test usually covers external infrastructure, web applications or a wireless network. For web applications, the test methodology is built on the OWASP Web Security Testing Guide (WSTG).

Example

A team is preparing an online shop for launch and orders a pentest covering the external perimeter and the web application — gray box, with a customer account. The testers discover that an old administration panel on a subdomain allows a file to be overwritten with an arbitrary name and use this to run their own code on the server. The report contains a confirmed attack, the risk and remediation: move the panel to the internal network and remove the outdated version.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • SASTStatic Application Security Testing

    SAST looks for weaknesses in source code before the application runs, while a pentest attacks a running system from the outside.

  • DASTDynamic Application Security Testing

    DAST also tests a running application, but with an automated scanner working from known patterns, with no people and no attack chains.

  • red team and blue team

    A red team imitates a specific adversary and tests the organisation’s defences as a whole; a pentest tests a single system under rules agreed in advance.

In depth in the references

where the topic is covered in detail

Appears in the references