Sovra Recon·Glossary · Black box, gray box, white box

Black Box, Gray Box, or White Box Penetration Testing: What Are the Differences?

By Solan Barlet, co-founder of Sovra Recon
Updated October 29, 2026

In short

The terms “black box,” “gray box,” and “white box” describe the level of information provided to the penetration tester before a penetration test. In a black box test, the pentester starts from scratch, like an external attacker; in a gray box test, the pentester has access to user accounts or documentation; in a white box test, the pentester has access to the source code and architecture. The more the pentester knows, the further the test can go within the allotted time; for a web application, the gray box approach is often the best compromise.

The three approaches

Black boxGray boxWhite box
Information ProvidedNone, except for the scopeTest accounts, roles, documentationSource code, architecture, configurations
Simulated ScenarioAnonymous external attackerMalicious client, employee, or partner, or a stolen accountIn-depth review covering all key aspects
StrengthsMeasure what an unknown attacker can achieveTest the separation between users and rolesFind hidden vulnerabilities and their causes in the code
LimitationsTime spent on discovery rather than testing; limited coverage of authenticated areasDepends on the quality of the accounts providedIt takes longer to conduct and requires access to the source code

How to Choose

  • To assess the vulnerability of a showcase website or an external scope: black box testing.
  • For an application with customer areas, roles, or sensitive data: gray box testing, with at least two accounts per role to test access to other users’ data.
  • For a critical component, such as an authentication or payment module: white box testing, or gray box testing supplemented by a targeted code review.

A common misconception is that the black box approach is more “realistic.” But a real attacker has all the time in the world, whereas the penetration tester works within a limited timeframe: providing the tester with information compensates for this difference rather than skewing the test.

Frequently asked questions

Why provide two accounts per role?

This is because some of the most serious vulnerabilities, such as IDOR, involve accessing another user’s data: at least two accounts are needed to verify that one user cannot read or modify data belonging to the other.

Sources

Find out where an attacker would get in.

Our AI agents actually attack your scope, fully automated, and hand you the proof of every vulnerability.