30 November 2026

Black Box Penetration Testing vs Grey Box: What Each Finds

Black Box Penetration Testing vs Grey Box: What Each Finds
11 min. readBy Borg

Black Box vs Grey Box Penetration Testing: What Each Finds

Somewhere in the scoping call for a penetration test, the vendor asks: "Black box or grey box?" One person says black box sounds more realistic. Another asks whether grey box costs more. Nobody is sure what would change in the report either way.

The short answer: in black box penetration testing, the tester starts with nothing but a target. In grey box penetration testing, the tester starts with some inside knowledge, usually test accounts and API documentation. The choice decides which parts of your product get tested at all.

Our own pentests start from the source code, so we can describe both plainly, including the cases where black box is the right call.

What is black box penetration testing?

NIST's glossary defines black box testing as "A test methodology that assumes no knowledge of the internal structure and implementation detail of the assessment object." (NIST, from SP 800-53A Rev. 5, where it is listed under "basic testing", as of 30 November 2026). The UK's National Cyber Security Centre calls the same thing "Opaque or Closed box testing", in which "No information is shared with the testers about the internals of the target." (NCSC, as of 30 November 2026).

In practice a black box pentest begins with very little: a URL, an IP range, sometimes only a company name. The tester starts where a real outsider starts, with reconnaissance. MITRE ATT&CK describes that tactic in one line: "The adversary is trying to gather information they can use to plan future operations." (MITRE ATT&CK TA0043). They enumerate subdomains, look for exposed services and probe whatever answers.

That makes black box testing good at the external perimeter: forgotten hosts, an admin panel left on the public internet, anything that leaks without an account. The NCSC notes that this approach "more accurately models the risk faced from attackers that are unknown or unaffiliated to the target organisation."

A black box test answers one question: what can an outsider with nothing do?

What is grey box penetration testing?

NIST's glossary entry for the middle option reads: "A test methodology that assumes some knowledge of the internal structure and implementation detail of the assessment object. Also known as focused testing." (NIST, citing CNSSI 4009-2022, as of 30 November 2026). American sources spell it "gray"; it is the same thing.

For a web application or API, "some knowledge" usually means the tester gets a test account for each role (a member, an admin, ideally two separate customers), an API schema such as an OpenAPI file, a short description of how sign-in works, and sometimes a role hierarchy that says who should be able to do what. They do not get the source code.

The real-world equivalent is an attacker with a valid account. MITRE ATT&CK lists this as its own technique: "Adversaries may obtain and abuse credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion." (MITRE ATT&CK T1078). That attacker might hold a phished password, or be a paying customer who is curious about the customer next door.

A grey box test answers a different question: what can a signed-in user, or someone with a stolen account, do?

What does each one find, and what does each one miss?

ApproachStarting knowledgeWho it simulatesStrong atLikely to missWhat you hand overGood fit
Black boxA target: URL, IP range or company nameAn outsider with no accountExposed services, forgotten hosts, sign-up and login flows, anything that leaks without an accountMost of what sits behind sign-in: role checks, object ownership, tenant boundariesScope and permission to testPerimeter checks, products you cannot open up, detection and response exercises
Grey boxTest accounts per role, API schema, how sign-in worksA signed-in user, or an attacker with a stolen accountAccess control between users, roles and tenants; business logic in signed-in flowsRoutes nobody documented, checks that only fail on unusual code pathsAccounts, schema, sign-in notes, role hierarchyMost SaaS applications and APIs
White boxAll of the above, plus source codeAn attacker with time to study the system, or an insiderFollowing each route to the check that is missing; coverage of routes that are hard to discover from outsideLittle by design, though code-only work needs a live test to confirm runtime and configuration issuesRepository access, plus the grey box inputs for live testingCustom applications that change often

A penetration test is time-boxed. Every hour a black box tester spends discovering that your API exists and guessing parameter names is an hour not spent testing it. The NCSC says so directly in its description of closed box testing: "the lack of information can also result in vulnerabilities remaining undiscovered in the time allocated for testing."

The standards bodies lean the same way. NIST SP 800-115 dates from September 2008, and its age shows in places, but on this point it is direct: "White box techniques still tend to be more efficient and cost-effective for finding security defects in custom applications than black box techniques." (NIST SP 800-115, Appendix C). The same passage adds that working from the code does not catch problems introduced by installation-time configuration or by how components interact, and it describes grey box testing as the combination of the two. The OWASP Web Security Testing Guide says "It is possible to discover vulnerabilities within the application source that would be missed during a black-box engagement." (OWASP WSTG v4.2, "Use Source Code When Available").

Put simply: the less a tester knows, the more the result describes your perimeter, and the more they know, the more it describes your product.

Why does what happens behind sign-in decide most of the result?

Because most of a SaaS product sits behind sign-in, and so do most of its serious bugs. Broken access control is first in the OWASP Top 10:2025, and OWASP's own page opens with this: "Maintaining its position at #1 in the Top Ten, 100% of the applications tested were found to have some form of broken access control." (OWASP, as of 30 November 2026). That figure is OWASP's.

Access control failures are relational. They are about what user A can do to user B's data, or what a member can do that only an admin should. MITRE's definition of CWE-639 shows the shape: "The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data." (CWE-639). Its broader parent is CWE-284, improper access control.

You need two users to test that. For horizontal bypass, the OWASP WSTG instructs: "For each role: Register or generate two users with identical privileges." (WSTG-ATHZ-02). Its privilege escalation test has the tester record each function and then "try to access such functions as another user" (WSTG-ATHZ-03). Vertical escalation needs at least two roles: one that should be allowed and one that should not.

A black box tester may be able to register one free account if you offer self-service sign-up. They rarely get an admin or a second tenant that way. Without those, role checks, object ownership and tenant boundaries go largely untested. A clean report then means "nothing found from outside", which is easy to misread as "nothing wrong".

We cover this class of bug in our guide to IDOR testing, and about running authenticated checks in preview environments before a change reaches production.

Where does white box fit?

White box adds the source code to everything a grey box tester has. A grey box tester has to infer from responses that a check is missing. A white box tester can follow a route from the handler to the database query and see whether the ownership check exists. The code also shows routes that no schema mentions. Our guide to white box penetration testing has the detail.

How should a team that ships every week choose?

Start with what you are trying to prove, and to whom. If a customer's questionnaire asks whether an external party has tested your application, they almost always care about their data inside your product. That is a signed-in question.

Then ask what you can share. If you can create test accounts for each role and export an API schema, you can run a grey box test. If you can also grant read access to the repository, white box is available, and less of the test goes on guesswork.

Then ask how often the product changes. A test describes the code that was running on the day. If you deploy every week, a yearly test of any colour is soon describing a product that has moved on. We think the answer is continuous penetration testing: recurring tests that follow what changed. Autonomous testing makes that cadence practical, and people remain better at some things, as we set out in our comparison of manual and AI pentesting.

Finally, keep the outside-in view as a separate job. New subdomains and exposed services appear between tests, so the perimeter is better watched continuously than sampled once a year.

For most small teams that ship every week, our recommendation is recurring grey box or white box testing of the application, with continuous monitoring of what is exposed to the internet, in place of a yearly black box test.

When black box testing on its own may be enough

There are honest cases for it.

You need to know what an unauthenticated outsider sees. Before a launch, or after an infrastructure change such as a cloud migration, the question really is "what is reachable now?" Black box answers that. You give up any view of the signed-in application.

You cannot share accounts or code. If you run a third-party product you do not own, you may have no source to give and no right to create extra roles. A black box test of your deployment is then the test you can have. You give up depth.

You want to test detection and response. NIST SP 800-115 treats this as a separate axis, covert testing, carried out without the knowledge of IT staff but with management's permission, and says it "is useful for testing technical security controls, IT staff response to perceived security incidents, and staff knowledge and implementation of the organization’s security policy." (Section 2.4.2). The same section says such a test does not aim to identify every vulnerability, so it complements application testing.

A customer or contract asks for it by name. Then do it, tell them what a black box test leaves out, and offer signed-in evidence alongside.

How we approach it at Borg

We do not sell standalone black box tests. Our pentests start from a connected repository (GitHub, Bitbucket or Azure DevOps). Odin, our platform, reads the code, maps every route and how sign-in works, chooses attacks for each route, then proves them. These are autonomous whitebox pentests.

A pentest can be code only, which sends nothing to your app, or live, which also sends real requests to an app you own. For live tests we ask for the grey box inputs too: test accounts with a role, how sign-in works, and optionally an OpenAPI schema or role hierarchy. Our docs say why: "Without a test account, routes behind sign-in go untested." (Borg docs, as of 30 November 2026).

The outside-in view is handled separately, by attack surface monitoring that tracks the domains, services and cloud systems you expose to the internet and notices when something new appears. That is monitoring, not a pentest.

After a fix ships, we test it again, as described in our post on retesting a fix. Pentests repeat on a schedule agreed with our team, and our security team can run them with you as ongoing testing.

FAQ

What is black box penetration testing?

Black box penetration testing is a test where the tester is given a target and nothing else: no accounts, no documentation, no code. NIST defines black box testing as "A test methodology that assumes no knowledge of the internal structure and implementation detail of the assessment object." It shows what an outsider with nothing can reach.

What is the difference between black box and white box penetration testing?

A black box tester works from outside with no inside knowledge. A white box tester has the source code as well as accounts and documentation, so they can follow a route to the check that is missing.

What is the difference between black box and grey box testing?

The difference is what the tester starts with. A black box pentest starts with a target only. A grey box test starts with some inside knowledge, usually test accounts for each role and an API schema, which lets the tester work on the signed-in parts of the product.

What are the three types of penetration testing?

Sorted by how much the tester knows, the three types of penetration testing are black box (no inside knowledge), grey box (some, such as accounts and API documentation) and white box (the source code as well). The NCSC uses "opaque or closed box" and "transparent or open box" for the two ends.

Is white box testing better than black box testing?

For finding defects in a custom application, usually yes. NIST SP 800-115 says white box techniques "tend to be more efficient and cost-effective" for that purpose. Black box testing is still the right tool for seeing what an unauthenticated outsider can reach, and for testing detection and response.

Borg on
Social Media

Borg specializes in securing complex, high-risk digital systems.