BERRY9 IT Services, home +91 86868 92922

Black Box, Gray Box or White Box: Which Web App Test?

Every web application penetration test starts with one decision that changes how much you learn for the time you pay for: how much does the tester know before starting? The three standard answers are black box, gray box and white box. Most teams that ask for "a pen test" have not chosen between them, and the choice should be written into the scope.

Web applications · By Thimmagurudu Bathini · Published · 3 min read · Last reviewed

Black box: no inside knowledge

In a black box test the tester gets a URL and nothing else, the position of an outside attacker who has just found your site. It is the closest simulation of an unprepared stranger, and it is the right choice when the question is "what can someone find about us from the internet alone?".

The cost is time. A black box tester spends the first part of the engagement discovering pages, parameters and roles that your team could have listed in minutes. Anything behind a login stays out of reach unless the tester can register an account, so deep problems in signed-in features are often not reached.

Gray box: accounts and documentation

In a gray box test the tester gets what a normal user, or a determined insider, would have: test accounts for each role, API documentation and a short briefing on how the application works. This is the most common choice, and for good reason. The tester skips the discovery work and spends the time on the questions that matter most in business applications:

  • Can user A open user B's record by changing an identifier?
  • Can an ordinary user reach an admin function?
  • Can a step in a workflow be skipped, repeated or reordered?
  • Can a price, a role or a status be changed in a request that should not allow it?

These authorization and logic flaws are the ones that hurt customers and the ones scanners are worst at finding. Gray box testing reaches them directly.

White box: source code too

In a white box test the tester also reads the source code and sees the architecture and configuration. It finds the most, including flaws that are almost impossible to see from outside: weak cryptography, hardcoded secrets, unsafe deserialization, a missing check on a path nobody linked. It is usually run together with a source code review and takes longer, so it suits core applications such as payments, health records or identity.

How to choose

  • New public website, no logins: black box is enough, and gray box adds little.
  • Application with customer accounts, roles or payments: gray box, with at least two test accounts per role.
  • Core product, high-value data or a compliance requirement: gray box plus code review, or white box.
  • You want to know whether your team notices an attack: black box, with the monitoring team not told in advance, agreed in writing.

It is common to combine them: a short black box pass for the outside view, then gray box for depth.

What to prepare in each case

For gray box, create test accounts for every role and check they work before the engagement starts. Add sample data that does not belong to real customers. Provide API documentation or a Postman collection, and name one person who can answer questions. For white box, add repository access, build instructions and an architecture overview. Our preparation checklist covers the rest.

Does the box color change the price?

It changes the time needed, and time is what scope depends on. Black box can look cheaper because there is less to read, but it often finds less per day. For starting prices and what moves them, see our web application penetration testing cost guide.

Choosing with us

If you are not sure which box fits, that is a normal question for a scoping call. Describe your application, its roles and its users, and our engineers will recommend a scope. Start with web application penetration testing to see what each engagement covers, or request a scoping call.

Written by Thimmagurudu Bathini, BERRY9 IT SERVICES PRIVATE LIMITED, Hyderabad. Questions about your own systems? Request a scoping call or call +91 86868 92922.

Plan your next security test

Tell us what needs testing and when you need it done, and we will propose a scope and timeline. We respond within 24 hours. If you would rather talk first, call or write to us.