What a penetration test is, and what it is not
A penetration test consists of attacking a system with its owner’s consent, under conditions set in advance, to establish what a malicious person could obtain from it: reading data, altering content, taking control of a server or a device.
It is not an inventory. An automated detection tool lists possible weaknesses; the test, by contrast, attempts to exploit them and to chain them together. A weakness judged minor when viewed in isolation can open up full access once combined with another. That is what the test brings to light, and what an inventory does not show.
Nor is it a guarantee. A test is carried out within a limited time, on a limited scope. It proves what was found; it does not prove the absence of flaws.
The legal framework: written authorisation
In France, accessing or remaining in an information system without authorisation is a criminal offence under Article 323-1 of the French Criminal Code. The only thing that distinguishes a penetration test from an attack is the consent of the system’s rightful owner.
This consent takes the form of a document signed before any testing, often called a letter of authorisation or an audit agreement. It must state:
- the precise targets: addresses, domain names, applications, devices;
- the dates and time windows;
- what is prohibited: denial of service, destructive actions, phishing unless it has been agreed;
- the people to notify on each side in the event of an incident;
- what happens to any data encountered during the test.
Take care with systems that do not belong entirely to you. A website hosted by a provider, an application rented online or a network operated by a third party requires that third party’s consent, or compliance with its testing conditions. The major hosting providers publish theirs.
Defining the scope
The scope answers a simple question: what would harm you most if it were compromised? That is the starting point, not the complete list of your systems.
| Target | What the test examines |
|---|---|
| Web or mobile application | Authentication, access rights, handling of user input, business logic |
| API | Object-by-object access control, excessive data exposure, rate limits |
| Internet-facing services | Remote access, email, administration interfaces, forgotten services |
| Internal network | What a compromised workstation or a visitor plugging in can reach, all the way to the directory service |
| Industrial installation | Segregation between office IT and the shop floor, programmable logic controllers, supervisory workstations |
| Product or device | Maintenance ports, firmware, radio links, update mechanism |
A narrow scope tested in depth is better than a broad scope skimmed over. If the budget forces a choice, it is made on what is at stake, not on what is easiest.
Black, grey or white box
These three terms describe what the tester knows at the outset.
- Black box No information: the position of an unknown party on the Internet.
- Grey box An ordinary account, sometimes documentation.
- White box Documentation, configuration, sometimes the source code.
- Black box: no information. The test reproduces the position of an unknown party on the Internet. It is realistic, but part of the time is spent discovering what you could have provided.
- Grey box: an ordinary user account, sometimes documentation. This is the most common level for an application: it measures what a customer, a partner or an employee could obtain.
- White box: access to the documentation, the configuration and sometimes the source code. It is the most thorough for the same amount of time, and the closest to an audit.
There is no right level in absolute terms. An application in which every user has an account is best tested in grey box; a service exposed without authentication is tested first in black box. The two are often combined.
The process, step by step
- Scoping
- Authorisation
- Reconnaissance
- Exploitation
- Lateral movement
- Report
- Retest
- Scoping. A meeting sets the objectives, the scope, the level of information, the schedule and the contacts. This is where the value of the test is decided.
- Authorisation. The letter of authorisation is signed. Test accounts and any access required are prepared.
- Reconnaissance. The tester records what is exposed: services, versions, functions, entry points.
- Discovery and exploitation. Weaknesses are sought, then exploited where this can be done without risk, to establish their real extent.
- Lateral movement ("pivoting"). From an initial point of access, the tester looks at what becomes reachable, within the limits of the scope.
- Report and debrief. The report is delivered and presented to the technical teams, with a summary for senior management.
- Retest. Once fixes have been applied, the findings are replayed to verify that they are closed.
A serious flaw is reported immediately, through the channel agreed at scoping, without waiting for the report.
What the report must contain
The report is what remains of the test. It is judged on one thing: can your teams fix the issues on the basis of it, without calling the tester back?
- a summary that a senior executive can read: what was obtained, and what it means for the business;
- the scope and conditions of the test, including what was not tested;
- for each finding: the description, the path followed, the evidence, the severity and the recommended fix;
- a ranking of the findings by order of priority.
Severity is often expressed using the CVSS scale, which scores from 0 to 10. It is useful for comparison, but it is no substitute for judgement: a flaw rated medium on the server that runs your invoicing weighs more than a critical flaw on an isolated test machine.
What you need to prepare on your side
- a technical contact who can be reached during testing;
- test accounts representative of real user profiles;
- a recent backup whose restoration has been verified;
- notice to your hosting provider and to your monitoring team — or an informed decision not to warn the latter, in order to measure its response;
- a staging environment for the most sensitive tests, provided it faithfully mirrors production.
After the test
A report that is not followed by fixes has served no purpose. At the debrief, settle who fixes what, and by when; the retest closes the loop.
A test describes a state at a given date. A new version, a change of hosting provider or the opening of a new service makes it out of date. Most organisations repeat a test after every significant change, and at regular intervals for whatever is most exposed.
Frequently asked questions
How long does a penetration test take?
It depends on the scope: a few days for a simple application, several weeks for an extensive information system or a hardware product. The duration is set at scoping, together with the quotation.
Should you warn your teams?
The technical contact and senior management, always. For the monitoring team, it is a choice: warning it avoids a false alarm; not warning it makes it possible to measure whether it detects the activity. Both are legitimate, provided the decision is made at scoping.
Can a test disrupt production?
The risk exists and can be reduced: no denial-of-service testing, no destructive actions, agreed hours, an emergency contact on each side, and the staging environment for the most sensitive tests.
Isn’t an automated scan enough?
It is useful, and easy to repeat. But it lists known weaknesses without saying which are exploitable, and it does not see logic flaws: a user who can read another user’s invoice, for example.
Sources
- French Criminal Code, Article 323-1 (fraudulent access to an automated data processing system)
- FIRST — CVSS severity scale
- OWASP — Web Security Testing Guide
This guide provides general information, up to date on the date shown at the top of the page. It replaces neither the official texts nor advice tailored to your situation.
