Penetration testing methodology: black, grey or white box depending on what you share.

Bonbay Updated 4 min read

Black box.

The testers know what a stranger knows: a domain name, an address, the name of the application. They start with lengthy reconnaissance, then look for a way in. This is the closest situation to an opportunistic attacker.

Its value: measuring what is genuinely visible from outside, and checking whether your teams or your provider spot the activity. Its limitation: much of the time goes on discovering what you could have described in a page. If nothing gives way in the time allowed, that doesn’t prove there is no flaw, only that none was found within that time.

Grey box.

The testers are given one or more accounts, usually one per profile: customer, employee, manager, service administrator. They also receive a short description of the application or network. This is the most common approach for a web application or an internal test.

It checks what no test without an account can see: a customer who reads another customer's invoices by changing a number in the URL, an employee who gains a manager's rights, a closed account that still works. These vulnerabilities are common and serious, because they expose data directly.

For it to deliver results, provide test accounts for each profile, realistic dummy data and a contactable person who knows the application well.

White box.

The testers have access to everything they need to understand the system: source code, architecture diagrams, configurations, discussions with the developers. The tests then combine attacking the running application with a targeted code review of sensitive functions, such as login, payments and permissions management.

This is the most in-depth approach. It suits an application that handles sensitive data, software that you develop and sell, or a major go-live. It requires the development team to stay available during the test.

Cost and depth compared.

ApproachWhat you provideDepthRelative costUsed for
Black boxThe name of the targetThe surface visible from outsideHigh for the same depth, as reconnaissance takes timeMeasuring exposure and detection
Grey boxAccounts per profile, brief documentationPermissions, data between users, internal pathsThe best ratio of days to resultsWeb applications, internal tests
White boxCode, diagrams, configurationsThe greatestThe most days, but each day goes furtherSensitive applications, software products

For the same number of days, the price is the same; what changes is the depth reached. Giving testers information isn’t cheating: a patient attacker often ends up getting it.

Which approach suits your case.

  • Internet exposure: black box, to see what a stranger sees.
  • Web application with customer accounts: grey box, one account per profile.
  • Internal test: grey box, starting from a standard employee’s account; choosing the starting point is covered in internal or external pentest.
  • Software you develop, or health data: white box.

Whatever the approach, the tester records the time spent and the steps taken: you know how long it would have taken an attacker to reach the same point. The approaches can be combined in a single campaign. The process, written authorisation and retest are common to all three, and described on the penetration testing page. If you’re still unsure whether to test or audit, read audit or pentest: the difference.

Bonbay. Updated 15 November 2026.

Your questions.

Which of the three approaches is the most realistic?

Black box most closely resembles the start of an attack. But a real attacker has more time than a tester and often ends up obtaining an account, through phishing for example. Grey box therefore simulates the more likely next stage. Realism depends on the scenario chosen, not just on the information given.

Is it risky to share our source code with the testers?

Sharing is governed by the contract and a non-disclosure agreement. The code is reviewed in an environment set aside for the test, or at your premises if you prefer. It is never copied to a personal computer, and access is withdrawn when the test ends. Only the testers named in the authorisation have access.

Can we switch from black box to grey box during the test?

Yes, and it’s often useful. If black box reconnaissance doesn’t succeed within the planned time, you can provide an account so the remaining days go on testing inside the application. This switch is planned at the scoping stage, so no time is lost along the way.

Do we need to provide real accounts?

No. We ask for test accounts, created specially with the same permissions as the real profiles, and dummy data where possible. They are deleted after the retest. Testing with real accounts would needlessly expose customer or employee data.

Does the report differ depending on the approach?

The format stays the same: each flaw with its severity, its evidence and its fix. White box adds precise references in the code, which speeds up your developers’ work. Black box adds what outsiders were able to learn about you during reconnaissance.