Skip to main content

Black box vs grey box vs white box penetration testing: which one to buy

Yanis Grigy, CEO10 min read

Black box, grey box and white box penetration tests differ by how much the tester knows on day one. For most modern application security programs, grey box is the right default: it balances realism, coverage and effort. Black box is a separate outside-in perspective, and white box is the tool for deep review of critical code and architecture.

Key takeaways

  • Black box starts with no internal knowledge, grey box with partial knowledge and working access, white box with full internal visibility.
  • Grey box is usually the most practical choice for web and API testing, because it reaches authenticated attack paths faster than a pure black box test.
  • White box is strongest for code-level and design flaws; black box is strongest for external exposure and discovery issues.
  • Compliance programs usually expect grey box or white box evidence, and retesting after the fix matters more than the color you picked once a year.

Grey box is the default for most teams

If you run a web application or an API program, grey box is the right starting point. It gives the tester enough context to reach real business logic, authentication flows and role boundaries without turning the exercise into a source code review. You get more useful results per day of testing than with a pure black box exercise, and less overhead than handing over the whole stack.

The exceptions are simple. Choose black box when you specifically need an external attacker's view. Choose white box when you need deep code or architecture scrutiny before a launch or on a critical change.

HackersHub, a European pentest firm, puts it plainly: "The knowledge level you give a tester is the single scoping decision that most changes what a penetration test finds per day."

The difference is what the tester knows on day one

Black box: no internal knowledge

NIST defines black box testing as testing with no prior knowledge of the internal structure or implementation of the target. In practice, the tester may receive only a company name, a domain or an IP range, and has to discover the rest. That is useful when you want to know what an outside attacker can see without help.

Take one SaaS application and test it three ways. In black box mode, the tester starts from the public login page and the exposed services. They enumerate subdomains, probe open ports and look for reachable admin paths. They may miss deeper authenticated flaws because they never get inside.

Grey box: partial knowledge and working access

In grey box testing, which NIST also calls focused testing, the tester gets partial knowledge and usually a working account, for example a standard user role plus a short architecture note. That lets them go straight to what matters after login: permissions, state changes, session handling and role separation.

On the same application, a grey box tester signs in as a customer user and tries to read another account's invoice, abuse the invite flow, or reuse a session after a privilege change. This is the mode that usually surfaces the highest-value application findings fastest.

White box: full internal visibility

White box testing, which NIST also calls comprehensive testing, assumes substantial internal knowledge. The tester may receive source code, configuration, CI/CD details, cloud settings and design documents. That gives the deepest view of how the application works and where trust boundaries are weak.

On the same SaaS application, white box work might reveal insecure deserialization in a backend service, an overly broad IAM policy, or a logic flaw in a code path that never appears in the UI. It is powerful, and it takes more time on both sides.

What each approach finds and what it misses

What black box is good at

Black box is best at simulating an external attacker. It surfaces exposed services, missing hardening, weak discovery controls and the perimeter mistakes that show up before authentication. A VPN port left open, a forgotten staging host still live, an admin panel indexed by search engines: this is the model most likely to catch them.

Its weakness is the flip side of its realism. The tester may never reach the application paths that matter once a user is inside. Black box gives you a strong outside-in view and often a shallow inside view.

What grey box exposes faster

Once authenticated access exists, grey box pulls ahead. It exposes authorization failures, broken object-level access, session mistakes, privilege escalation and business-logic issues much faster than an external test. That is why it is the workhorse model for SaaS, fintech, e-commerce and healthcare applications, where the real risk sits behind the login page. It also maps directly onto the OWASP API Security Top 10, whose top risks are authorization flaws that only an authenticated tester can reach.

Think of it as a trade-off between realism, coverage and time to find. Black box gives the most realism at the edge, white box the most coverage inside, and grey box usually the best time to find for useful application findings.

What white box reaches deepest

White box reaches the deepest code, configuration and design flaws. It is the right choice for pre-launch assurance, critical payment paths, or a major architecture change where much of the attack surface is invisible from the browser. It also helps when the question is not "can this be reached?" but "why does this trust decision exist at all?"

That depth has a failure mode. White box can drift into pure code review if nobody validates exploitability, so it should still include attack validation, not only static reading.

How to choose by system, goal and compliance

Choose by attack path

Start with the path you care about most. If the goal is validating external exposure, black box fits. If the goal is authenticated application risk, grey box is the better default. If the goal is deep technical assurance on a critical system, white box gives the strongest evidence.

The usual methodology anchors are the OWASP Web Security Testing Guide for web applications, the OWASP API Security project for APIs, and NIST SP 800-115 as a broader technical testing framework. For a step-by-step API approach, see our guide to REST API penetration testing.

Choose by lifecycle stage

A public SaaS application in steady release mode usually needs grey box first. An internal admin portal with few exposed edges also needs grey box, with stronger coverage of roles and privileged paths. A payment flow about to go live deserves a white box review when a defect would have direct financial or regulatory impact.

Pure black box still has a place, mostly as a separate perspective rather than the whole program.

Choose by compliance evidence

PCI DSS is explicit on this point. The PCI Security Standards Council's penetration testing guidance states that PCI DSS penetration tests are typically performed as white box or grey box assessments, because they yield more accurate results and a more comprehensive test of the environment than a pure black box assessment. It adds that a black box test may require more time, money and resources to reach the same deliverables.

Compliance teams care about evidence, remediation and retesting, so the model you choose has to produce an audit trail as much as an attack simulation. The UK NCSC guidance on penetration testing makes the same point from the buyer's side: a pentest is a way to verify that your vulnerability management works, not a substitute for it. If you buy for a regulated business, match the test to the proof you will need to show later.

Why the cadence matters more than the color

The yearly color debate misses the real issue: your software changes faster than one-off tests can follow. An annual black box report tells you what was true on one date. A regular testing rhythm tells you what is still exposed after the next deploy, the next authentication change and the next API revision.

In practice, you get the most value by mixing modes over time:

  1. Run grey box assessments on every meaningful release of exposed web apps and APIs.
  2. Retest after remediation, every time, so a closed ticket means a verified fix.
  3. Reserve white box review for payment logic, identity changes or major infrastructure shifts.
  4. Keep a black box perspective in the mix, for example quarterly or before an external launch, if perimeter exposure is part of your risk model.

That rhythm is out of reach if every test is a multi-week consulting project. It is the trade-off we cover in automated vs manual penetration testing.

Where agentic pentesting fits

Fleuret runs agentic pentests on web applications, REST and GraphQL APIs and external infrastructure, with results in hours. That speed is what makes the cadence above affordable: you can test each significant release instead of picking one color once a year.

What matters for evidence is what comes out of the test. Every finding ships with a replayable proof of concept, findings are pushed to Jira, Linear or Slack, results are mapped to DORA and NIS2, and a retest runs after the fix. A signed report is available on demand. Regulated buyers do not only need findings; they need a record of what was tested, what was fixed and what was checked again.

If your main need is one deep specialist engagement a year, a consulting-led white box review still makes sense. The two approaches answer different questions.

Common mistakes when scoping these tests

Mistaking realism for usefulness

A pure black box request sounds realistic, but on a complex authenticated application it often buys less than you think. If the tester never gets meaningful access, you pay for a perimeter exercise when what you really needed was role abuse, account takeover paths or abuse of state transitions.

Scoping too narrowly

Teams treat the pentest as a single annual event, forget to prioritize findings by exploitability, skip the retest after fixes, or cut scope so tightly that the tester cannot reach the high-value paths. White box work can fail the opposite way, turning into source review without attack validation.

Stopping at the report

Before you sign a scope, run through this list:

  1. Define the main attack path you want tested, not only the asset list.
  2. Choose black, grey or white based on what the tester must know to reach that path.
  3. Ask how findings will be prioritized and retested after fixes.
  4. Make sure authenticated flows, roles and APIs are explicitly in scope.
  5. Require evidence that matches your audit or compliance needs.

What I recommend

Pick the model that matches your attack path, your release cadence and the evidence you need to produce. For most application security programs, that means grey box first, black box as a separate external perspective, and white box for critical changes or deep technical review. Then make the retest non-negotiable.

Fleuret runs agentic pentests on web apps, APIs and external infrastructure, with replayable PoCs and a retest after every fix. See Fleuret in action.

Sources


Share this postShare on LinkedIn

Your turn.
En garde.

The Free plan runs SAST, DAST, SCA and secret scanning for 2 users and 10 repos, no call needed. Several apps or an audit deadline? Book a demo instead.