Black box penetration testing gives the tester no inside information about the target. White box gives full access to source code and architecture, and grey box sits in between with user accounts and some documentation. The box you choose decides how much of the test budget goes to discovery and how much goes to finding flaws.

This guide is for the person writing the pentest scope. It defines the three approaches and compares them on access, depth, effort and evidence. It then maps each box to a goal, such as an ISO/IEC 27001 audit or a pre-release check, and separates the box choice from authenticated testing, which is a different decision. For the method behind a full test, see our penetration testing guide.

TL;DR

Pick the box by the question the test must answer. The box sets how much the tester knows at the start, not how good the test is. For an application that customers log in to, grey box is the sensible default: the tester spends the days on access control and business logic instead of on reconnaissance.

  • Black box penetration testing fits an external perimeter test. It shows what an outsider with no inside knowledge can find, and part of the budget goes to reconnaissance.
  • Grey box penetration testing fits web applications, APIs and SaaS. Test accounts per user role let the tester check whether one customer can reach another customer’s data.
  • White box penetration testing fits code-level assurance before a release. Source code and architecture access add code review to dynamic testing, at the cost of extra review days.
  • Authenticated testing is a separate choice. Login credentials do not make a test white box, and one scope can combine a black box perimeter test with an authenticated grey box application test.

What is the difference between black, white and grey box pentesting?

The difference between black, white and grey box pentesting is how much the tester knows about the target before testing starts. The UK National Cyber Security Centre (NCSC) calls the two ends closed box testing, where no information about the internals is shared, and open box testing, where full information is shared. Grey box is the name for everything in between. The tester’s skill, tools and reporting standard can be the same in all three. What changes is where the test days go.

Spectrum of tester knowledge in black, grey and white box penetration testing
How much the tester knows at the start decides where the test days go.

Black box penetration testing

Black box penetration testing starts with no prior knowledge: the tester receives a company name, a domain or an IP range and nothing else. Reconnaissance is part of the job, so the test shows what an external attacker can learn and exploit from public information. The trade-off is coverage. Within a fixed number of days, a closed box test can leave vulnerabilities undiscovered. Black box suits external perimeter tests of internet-facing servers, VPN gateways, exposed admin panels and public websites.

Grey box penetration testing

Grey box penetration testing gives the tester user accounts and some documentation, such as an API specification or a list of user roles. With that access the tester goes straight past the login screen. The test then shows what someone with a registered or stolen account could do: open another customer’s invoices, change a price, or call an admin function from a normal account.

These are access control flaws, and they only show up from inside the application. Broken access control holds first place in the OWASP Top 10:2025, and OWASP reports some form of it in every application in its contributed test data. That makes grey box the sensible default for web applications, APIs and SaaS products where customers log in.

White box penetration testing

White box penetration testing gives the tester source code, architecture diagrams and, where needed, admin access. The tester combines dynamic testing of the running application with review of the code behind it. Each flaw can be traced to the function that causes it, and paths that are hard to reach from outside become visible. White box gives the deepest coverage per asset and needs the most review days. It overlaps with secure code review: a pentest proves what can be exploited in the running system, while a code review examines authorisation, input handling, secrets and dependencies in the code itself.

Black, grey and white box compared: access, depth, time, cost and evidence

The three approaches trade realism against coverage. Table 1 compares them for one asset, such as a single web application. How the test type changes the price covers the cost side in more detail.

Black boxGrey boxWhite box
Tester knowledgeTarget name, domain or IP rangeUser accounts per role, API documentation, role listSource code, architecture, admin access where needed
Typical targetsInternet perimeter, public websitesWeb applications, APIs, SaaS, customer portalsCritical modules, new releases, login and payment code
DepthWhat is reachable from outsideAccess control and business logic inside the applicationRunning application plus the code behind it
Relative test daysExtra days for reconnaissanceBaselineExtra days for code review
Relative costHigher than grey box for the same coverageBaselineHighest per asset
Evidence valueWhat an outsider can reach on the test dateWhether role and customer separation holdFlaws traced to code; release reviewed at code level
Main limitationLogged-in functions largely untestedNo view of what an outsider can discover from scratchNeeds code access and developer time; less like a real attack
Table 1. Black, grey and white box penetration testing compared for one asset

Which box fits your goal?

The right box follows from the question the test must answer, not from which approach sounds most realistic. If two of the situations below apply, split the scope by asset instead of choosing one box for everything.

Which box fits your goal?

Proving to an auditor or customer that controls work

Grey box fits when the test must produce evidence for an ISO/IEC 27001 audit or a customer security questionnaire. The reviewer’s question is whether your controls work, and access controls can only be tested from inside the application.

ISO/IEC 27001:2022 Annex A 8.8 asks you to identify technical vulnerabilities, assess your exposure and act on them; it does not prescribe a box type. For organisations in scope of NIS2, Article 21(2)(f) requires policies and procedures to assess whether cybersecurity risk-management measures are effective. A pentest is one way to produce that evidence; the directive does not name it as an obligation. Your signal: a questionnaire asks for the date and results of your latest penetration test.

Simulating an external attacker with no inside knowledge

Black box fits when the question is what an outsider with no account and no inside knowledge can reach. Typical moments are a new service going live on the internet, an acquisition, or a board asking how the company looks from outside. Limit the scope to internet-facing assets. If customers log in to your product, a black box test alone leaves most of the product untested.

Finding flaws in code and business logic before release

White box fits when a major release, a new payment flow or a rewrite of authentication is about to ship and your team owns the code. Code access lets the tester confirm a flaw and point to the line that causes it, which shortens the fix for your developers. Your signal: you can grant read-only repository access for the test period.

Getting the most findings for a fixed budget

Grey box tends to give more findings per test day than black box on a single application. The tester does not spend days working out what your documentation answers in minutes. The UK NCSC advises sharing a current vulnerability assessment with the testers at scoping and creating test accounts before testing. Ask each provider which days in the quote go to reconnaissance and which go to testing.

The box type follows from your goal. During scoping we agree the box type, the user roles and the assets with you before testing starts, so the test days match the evidence you need. See our penetration testing services.

Authenticated testing is a separate choice

Authenticated testing means the tester logs in with valid credentials. It describes access to the application, not knowledge of its internals, so a test with credentials but no source code is grey box, not white box. Credentials and box type are two separate scoping decisions, and one engagement can combine them.

For example, a scope can include a black box test of the external perimeter and an authenticated grey box test of the customer portal, reported together. For a multi-tenant SaaS product, ask for two test accounts per role in two separate customer tenants. The tester can then check whether tenant A can reach tenant B’s data. Use test accounts with test data, not real customer accounts, and remove them after the test.

How the box choice changes price and timeline

The box choice changes the number of test days, and test days drive the price. Black box adds reconnaissance days before testing reaches the application. White box adds code review days on top of dynamic testing. Grey box sits between them for the same asset.

The number of assets, user roles and API endpoints, and whether a retest is included, set the rest of the effort. How the test type changes the price covers those drivers. A quote that lists the box type, the roles to be tested and the days per activity lets you compare offers like for like.

Beyond box testing: red teaming

Red teaming is a different exercise from a box-type pentest. A pentest asks what is exploitable in a defined scope within a fixed number of days. A red team exercise is goal-based, runs over a longer period and tests whether your team detects and responds to an attacker trying to reach a set objective, such as customer data. Read red team vs blue team for how the two roles work together.

Scoping one box per asset with Sunbytes

Choosing a box is a decision per asset, not one decision for the whole test. A SaaS company with an ISO/IEC 27001 audit and a major release in the same quarter might need a black box view of its perimeter, an authenticated grey box test of the customer portal with accounts in two tenants, and code access for a new payment module. Each of those choices changes the test days and the evidence that comes back.

That is why Sunbytes starts every pentest with scoping. Before testing starts, we agree with your team the systems, the access model per asset (box type and which roles get credentials), test windows, exclusions and the evidence your auditor, customer or release manager will ask for. Our penetration testing services cover web applications, APIs, mobile applications and cloud infrastructure.

Each validated finding comes with the affected asset, reproduction evidence, severity, business impact and a remediation path your engineers can act on. You receive an executive summary, a technical report and an evidence pack. After your team fixes the findings, a retest can be scoped to confirm the fixes work, which gives a reviewer closure evidence. The work runs inside our ISO/IEC 27001-certified organisation.

If you are writing a scope now, bring your goal and asset list to a scoping call and we will agree the access model for each asset with you. Discuss your pentest scope.


Author

Thien Le Marketing Executive

Thien Le is a B2B content writer with more than four years of experience in crafting compelling B2B content for a global audience, specializing in how people, technology, and business operations come together. At Sunbytes, she plans, connects insights from HR experts, edits, and uses technology to improve content quality. Her content helps readers cut through complexity and find practical information for hiring, paying, and managing people across borders.

What can we help you move forward?

Tell us what you are working on. We will connect you with the right Sunbytes solution.

[ENG] Submission form (Homepage, Service & Contact us)

This field is for validation purposes and should be left unchanged.
Your Full Name(Required)
Drop files here or
Max. file size: 128 MB.
    untitled(Required)
    Untitled(Required)