Penetration testing from A to Z
Scans, pentests, red teams and bug bounties: how penetration testing works, its legal framework, steps, reports, costs and France’s PASSI scheme.
What you will learn
- Tell the difference between a vulnerability scan, a penetration test, a red team and a bug bounty
- Choose the right scope and level of knowledge: black, grey or white box
- Make a test legally safe: contract, written authorisation and article 323-1 of the French Criminal Code
- Follow the stages of an engagement, from scoping to the retest
- Read a report and prioritise fixes with CVSS, EPSS and the KEV catalogue
- Know when to insist on a PASSI-qualified provider and how to choose a provider
A penetration testPenetration testing (pentest)A simulated attack, carried out by authorised specialists, to find the weaknesses in a system before a real attacker exploits them. (or pentest) means asking specialists to play the attacker, with your written consent, to find out what a real criminal could reach in your organisation. It is not an exam you pass or fail. It is a dress rehearsal, arranged so that your weaknesses are found by allies before anyone else finds them.
What is a penetration test for?
A penetration test answers a simple question: “If someone skilled and malicious took an interest in us, how far would they get?” It delivers three things that no automated tool provides on its own.
- Proof. Instead of a list of theoretical flaws, you get a verified scenario: “from the internet, we gained access to the mailbox, then to customer invoices”.
- Priorities. The test shows which weaknesses, combined, actually lead to your data or could halt your business.
- A measure of your defences. Did anyone notice the simulated attack? Who was alerted, and how long did it take?
It also reassures third parties: customers who ask for a recent report in their security questionnaires, insurers, auditors and financial supervisors.
Scan, pentest, red team, bug bounty: four different tools
These terms are often mixed up, sometimes deliberately in sales pitches. They do not answer the same question.
| Approach | Question asked | Who does it | Typical duration |
|---|---|---|---|
| Vulnerability scan | Which known flaws are visible? | An automated tool | Minutes to hours, repeated often |
| Penetration test | How far would an attacker get within this scope? | Experts with tooling | A few days to a few weeks |
| Red team | Would we detect a realistic attack, and could we respond? | A discreet offensive team | Several weeks to several months |
| Bug bounty | What do diverse researchers find, continuously? | A community paid per valid flaw | Ongoing or in campaigns |
A scan is basic hygiene: quick and cheap, it spots outdated versions and known misconfigurations, along with its share of false positives. A penetration test adds human judgement: it confirms flaws, chains them and measures the impact. A red teamRed teamAn exercise in which a team of authorised attackers imitates a realistic adversary over several weeks to test the organisation’s ability to detect and respond to an attack. pursues a specific goal (reaching the payment system, for instance) without warning the defenders, to test detection and response as much as prevention. Finally, a bug bountyBug bountyA programme in which an organisation invites security researchers to look for flaws within a defined scope, and rewards them for each valid vulnerability reported. opens a scope to independent researchers who are paid only for valid findings, under contractual terms set by a platform.
Between the scan and the human-led audit sit orchestrated penetration tests: automated, non-destructive scenarios launched only once authorisation has been verified, such as those KrakenShield offers. They make it possible to test more often, but they do not replace an experienced tester on a critical scope.
Black, grey or white box
Before starting, you decide what the testers know at the outset. This is the level of knowledge, or black, grey or white boxBlack, grey and white box testingHow much information testers receive before an audit: nothing (black box), a user account or partial documentation (grey box), or everything, source code included (white box)..
- Black box: no information, like an outside attacker. It is realistic, but part of the budget goes on discovery and some areas remain unexplored.
- Grey box: a standard user account and some architecture details. This is often the best value for money, as it also simulates a malicious customer or an already compromised workstation.
- White box: access to documentation, configuration and sometimes source code. Less realistic, but coverage is as complete as it gets.
The French PASSI framework, published by ANSSI (the French national cybersecurity agency), actually requires this mode, and the attacker profiles to simulate, to be written down before the engagement starts.
Which scope should you test?
A scope is a precise list: IP addresses, domain names, applications, accounts, premises. The usual categories are:
- External testing: everything exposed to the internet (website, VPN, email, extranet). This is the most common way in.
- Internal testing: simulating a compromised workstation or an intruder plugged into the network. The classic target is the company directory, which holds the keys to everything else.
- Web applications and APIs: authentication, access rights, injection flaws, business logic. Testers rely on OWASP’s reference material.
- Cloud: account configuration, excessive permissions, exposed storage. The major providers publish their own testing rules, which must be followed.
- Social engineering: fake phishing emails, phone calls, attempts at physical entry. These need to be agreed with management, HR and legal counsel, as employees are directly involved.
A narrow scope tested thoroughly beats a huge scope skimmed over.
Reference methodologies
A serious test follows a published method, which makes it repeatable and comparable. The four most cited references:
| Reference | Publisher | What it provides |
|---|---|---|
| PTES (Penetration Testing Execution Standard) | A community of practitioners | Seven phases, from pre-engagement discussions to reporting |
| OWASP WSTG (Web Security Testing Guide) | OWASP Foundation | The catalogue of web application tests; version 4.2 stable, version 5 in preparation |
| OSSTMM 3 | ISECOM | A way to measure operational security, including human and physical aspects |
| NIST SP 800-115 | NIST (United States), 2008 | Four stages: planning, discovery, attack, reporting |
Ask your provider which one they follow, and how they adapt it to your context.
The legal framework: no authorisation, no test
Article 323-1 of the French Criminal Code. Fraudulently accessing or remaining in a computer system is punishable by 3 years’ imprisonment and a €100,000 fine; 5 years and €150,000 if data is deleted or modified or the system’s operation is impaired; 7 years and €300,000 for a personal data system run by the State. Remaining in a system is an offence even if access was technically open (French Court of Cassation, 20 May 2015). Article 323-3-1 also punishes possessing attack tools “without legitimate reason”.
In practice, the only thing that separates a penetration tester from a criminal is authorisation. It must be in writing, signed by someone with genuine authority over the systems, and must specify the scope, dates, hours, the addresses the tests will come from and the forbidden actions. If part of the scope is hosted by a third party (hosting company, SaaS vendor, cloud provider), check its terms: you can only authorise testing of what you own or what your contract allows you to have tested.
How an engagement unfolds, step by step
- Scoping. Objectives, scope, mode (black, grey or white box), timetable, emergency contacts reachable at any hour, excluded actions (denial of service, deleting data). All of this goes into a scoping note.
- Agreement and written authorisation. The service agreement sets out responsibilities, confidentiality and what happens to the data; the authorisation form sets the rules of engagementRules of engagement (scope and mandate)A signed document setting out what a tester is allowed to do: target systems, dates, permitted and forbidden techniques, emergency contacts and what to do if something unexpected happens.. A recent backup of the systems under test is strongly recommended.
- Reconnaissance. Testers map what is visible: subdomains, exposed services, technologies, public information about the company and its staff (OSINTOSINT (open-source intelligence)Collecting and analysing publicly available information (websites, social media, public registers, published leaks) to understand a target.).
- Analysis and controlled exploitation. They check which weaknesses are real and exploit them just enough to prove the impact, without breaking anything or taking real data away. A critical flaw found along the way is reported to you immediately, without waiting for the report.
- Post-exploitation. From that first foothold, they show what an attacker would do next: privilege escalationPrivilege escalationThe stage of an attack where an intruder who got in with limited rights obtains higher ones, up to administrator level., lateral movementLateral movementThe techniques an attacker uses to move from a first compromised machine to others on the network, until reaching the real targets. to other servers, access to sensitive data. Everything is logged, then cleaned up at the end.
- Report. An executive summary for management, followed by technical details of each vulnerability, with evidence and recommendations.
- Debrief. A closing meeting presents the findings to management and technical teams and answers their questions.
- Retest. Once fixes are in place, the testers check that the flaws really are closed. Without this step, you do not know whether the fix works.
Reading a report without drowning
Start with the executive summary: in one page, it should say what an attacker could reach and which three or four workstreams come first. Next come the attack scenarios, then each vulnerability, usually rated with CVSSCVSS (severity score)A scoring system from 0 to 10 that measures the technical severity of a vulnerability, based on criteria such as how easy it is to exploit and its impact on data and service. (Common Vulnerability Scoring System, version 4.0 since November 2023):
| CVSS score | Severity |
|---|---|
| 0.0 | None |
| 0.1 to 3.9 | Low |
| 4.0 to 6.9 | Medium |
| 7.0 to 8.9 | High |
| 9.0 to 10.0 | Critical |
A word of caution: CVSS measures technical severity, not your risk. To prioritise, cross-check it against three questions.
- Is it exposed? A flaw reachable from the internet comes before an internal one.
- Is it being exploited? The EPSSEPSS (exploit prediction)A score published by FIRST that estimates, between 0 and 1, the probability that a published vulnerability (CVE) will be exploited in the next 30 days. score estimates the probability of exploitation within 30 days, and the KEVKEV (known exploited vulnerabilities)A public catalogue run by CISA, the US cybersecurity agency, listing the vulnerabilities that attackers are confirmed to have exploited. catalogue from the US agency CISA lists flaws already exploited.
- What sits behind it? A flaw on payroll or production weighs more than one on a test server.
How often?
The common-sense rule, echoed for example by the payment card security standard PCI DSS (requirement 11.4), is at least once a year, and after any significant change (a new application, a move to the cloud, a network redesign). In finance, the EU’s DORA regulation requires entities designated by their supervisor to carry out threat-led penetration testing (TLPT) at least every three years. Between tests, regular scanning of your exposed surface avoids leaving a flaw open for eleven months.
What does it cost?
A penetration test is billed in expert working days. The price therefore depends on the scope (number of addresses, applications and user roles), the mode (black box requires more discovery), the depth expected and the level of qualification. A targeted external test takes days; a full internal and application audit takes weeks.
For a public benchmark: in its January 2023 information sheet, the cyber-defence diagnostic scheme run by the French Ministry of the Armed Forces capped eligible spending on an SME cybersecurity audit by a PASSI provider (risk analysis and remediation plan) at €8,000 excluding VAT, for at least seven days of work. That is an order of magnitude, not a market rate.
Be wary of “pentests” costing a few hundred euros and delivered in 24 hours. They are almost always an automated scan under another name. Ask for a quote broken down in days per activity, the name of the methodology, an anonymised sample report and a retest included in the price.
France’s PASSI qualification
PASSI stands for prestataire d’audit de la sécurité des systèmes d’information, or information systems security audit provider. It is a qualification awarded by ANSSI after assessment by an approved evaluation centre. Its framework (version 2.2, published on 29 November 2024) covers five activities: architecture audit, configuration audit, source code audit, penetration testing, and organisational and physical audit. It has two levels: substantial, recommended against systemic, hacktivist or isolated threats, and high, recommended where risks are high or the threat is strategic.
A PASSI provider commits to things you should expect from any provider: a signed agreement, a scoping note, a test authorisation form, prior consent for any action that could interrupt a service, a report with an executive summary, a closing meeting and destruction of the engagement data.
When should you require it? The qualification is mandatory in certain regulatory settings, such as inspections of the critical information systems of France’s operators of vital importance (OIV). It is strongly advisable for a sensitive system, a public body or when a customer requires it by contract. For an SME with no particular constraint, it is a mark of seriousness, not an obligation. ANSSI publishes the list of qualified providers on cyber.gouv.fr.
How to choose a provider
- Skills: PASSI qualification or, failing that, named auditors with recognised hands-on certifications and experience of your kind of scope.
- Method: a stated methodology, an anonymised sample report, and a procedure for critical flaws found during the engagement.
- Trust: a confidentiality clause, engagement data kept in the European Union and then destroyed, professional liability insurance.
- Independence: avoid having an infrastructure audited by the company that built it.
- Follow-up: an oral debrief and a retest included in the quote.
Prepare the engagement like a project. Appoint an internal point of contact, inform your hosting provider, check your backups and decide in advance whether your monitoring teams will be told. A well-prepared test costs less and yields more.
Key takeaways
- A penetration test simulates a real attacker to prove what they could reach; a scan merely lists known weaknesses.
- Without authorisation from the person in charge of the systems, a test is unauthorised access under article 323-1 of the French Criminal Code: always get it in writing.
- Good scoping (objectives, scope, hours, emergency contacts, forbidden actions) matters as much as technical skill.
- A CVSS score measures technical severity; priority depends on exposure, real-world exploitation (EPSS, KEV) and business value.
- Test at least once a year and after every major change, then have the fixes checked in a retest.
Were you paying attention?
Three questions to check, no score, no account.
Sources
- Légifrance, French Criminal Code, articles 323-1 et seq. (offences against automated data processing systems)
- ANSSI, qualification requirement frameworks (PASSI v2.2, activities and levels)
- ANSSI, update of the PASSI (version 2.2) and PRIS (version 3.0) frameworks, 29 November 2024
- Regulation (EU) 2022/2554 (DORA), article 26 on threat-led penetration testing
- NIST SP 800-115, Technical Guide to Information Security Testing and Assessment (2008)
- OWASP, Web Security Testing Guide
- Penetration Testing Execution Standard (PTES)
- ISECOM, OSSTMM 3
- FIRST, CVSS v4.0 Specification Document
- FIRST, Exploit Prediction Scoring System (EPSS)
- CISA, Known Exploited Vulnerabilities Catalog
- PCI Security Standards Council, PCI DSS v4.0.1 (requirement 11.4)
- French Ministry of the Armed Forces (DGA), Action PME cyber-defence diagnostic, January 2023
- Mandiant (Google Cloud), M-Trends 2026