By Sakshi Shah · 6 November 2026 · 13 min read
Web Application Penetration Testing: Black, Grey or White Box — and How to Prepare
Web application penetration testing explained: how it differs from scanning, black vs grey vs white box, how to prepare, and how to read the report.
Introduction
The request usually arrives in one of a few ways. An enterprise customer's security questionnaire asks for "your most recent penetration test report". An insurer or auditor wants evidence of independent testing. A new product is about to launch and someone asks, reasonably, whether anyone has tried to break it. Or a security incident somewhere in the industry prompts the board to ask how exposed the company's own applications are.
At that point many businesses discover that "penetration test" covers a wide range of very different services, from an automated scan with a branded report to weeks of skilled manual testing against source code. Choosing the wrong one wastes money and, worse, produces false confidence. This guide explains what web application penetration testing actually involves, how it differs from scanning, how to choose between black-box, grey-box and white-box testing, how to scope and prepare, how to read the report, and how to choose a tester.
Scanning, Vulnerability Assessment and Penetration Testing
These terms are often used interchangeably, but they describe different levels of depth.
| Activity | What it involves | What it is good for | Its limits |
|---|---|---|---|
| Automated scan | Software checks the application for known weaknesses and misconfigurations | Frequent, cheap checks between deeper tests | Many false positives; misses logic and authorisation flaws |
| Vulnerability assessment | Scanning plus a person reviewing, confirming and prioritising the findings | A reliable list of known weaknesses, ranked by severity | Does not prove what an attacker could actually achieve |
| Penetration test | A skilled tester actively tries to exploit weaknesses and chain them together, as an attacker would | Evidence of what is really reachable and how much damage it could do | Point in time; depth depends on scope and tester skill |
The difference that matters most is the human. Scanners are good at spotting known patterns — an outdated library, a missing security header. They are poor at noticing that a user can view another customer's invoice by changing a number in the address bar, or that a discount can be applied twice by repeating a request. Those business logic and access control flaws are among the most common serious findings in real applications, and they are almost always found by people. A combined vulnerability assessment and penetration test — usually called VAPT — gives you both.
Black Box, Grey Box or White Box?
The biggest choice is how much information the tester starts with. Each option trades realism against depth.
Black-box testing starts with nothing but the application's address, the same position as an outside attacker. It is the most realistic simulation of an external attack and answers the question "what can someone with no access reach?" Its weakness is that time spent discovering how the application works is time not spent testing it, so deeper features behind the login may get little attention.
Grey-box testing gives the tester partial knowledge — usually test accounts for each user role, and sometimes API documentation. This mirrors a malicious customer, a compromised user account or a curious insider, which is the threat many business applications most realistically face. For most web applications, grey-box testing finds the most for a given budget.
White-box testing gives the tester full access to source code, architecture and design documents alongside the running application. It finds problems no external probing would reveal — subtle authorisation bugs, insecure design decisions, secrets in code — at the cost of more time and specialist skill.
A practical rule of thumb: choose black box when you specifically need to know your external exposure — for example, a public marketing site or perimeter. Choose grey box as the default for business web applications and APIs with logged-in users. Choose white box for applications handling highly sensitive data or money, before a major launch, or when previous tests keep finding similar issues and you want to address the root cause in the code. Our black-box, grey-box and white-box testing pages go into each in more detail.
What Testers Actually Look For
A good web application test works through the categories of weakness that cause real breaches. The OWASP Top 10 and the more detailed OWASP Application Security Verification Standard are the reference points most testers use. In practice, the most frequent serious findings are:
- Broken access control — one user reaching another user's data or functions, often by changing an identifier in a request.
- Authentication and session weaknesses — weak password reset flows, sessions that never expire, missing protection against repeated login attempts.
- Injection — untrusted input reaching a database query, command or template unsafely.
- Security misconfiguration — debug features left on, verbose error messages, overly permissive storage or cross-origin settings.
- Outdated components — libraries and frameworks with known, published vulnerabilities.
- Business logic flaws — workflows that can be skipped, repeated or manipulated, such as approving your own request or applying a discount twice.
- Exposed APIs and secrets — undocumented endpoints, keys in front-end code, APIs that return far more data than the interface shows.
Applications with AI features add newer categories, such as prompt injection and data leaking through model responses; these are covered in How to Build a Production-Ready AI System, Not Just an AI Prototype.
Scoping and Preparing for a Test
The quality of a penetration test depends heavily on preparation. A poorly scoped test spends days on the wrong things; an unprepared environment wastes the tester's time on access problems.
Define the scope precisely. List every web address, API and mobile back end in scope, and anything explicitly out of scope. Include the user roles that exist. If parts of the system are hosted by third parties — a payment provider, a SaaS component — confirm what you are permitted to test; you generally cannot authorise testing of systems you do not own, and cloud providers publish their own rules for testing on their platforms.
Choose the environment. A staging environment that closely mirrors production is usually the safest choice, as long as it really does match — same configuration, same version, realistic data with no real personal information. Testing production is sometimes necessary, and then needs agreed limits on timing, request rates and destructive actions.
Agree the rules of engagement. Testing windows, what the tester must not do (for example, denial-of-service attempts or modifying real records), how data found during testing will be handled, and who to call immediately if something critical is discovered or something breaks.
Write the scope
Addresses, APIs, user roles, in and out of scope, third-party components and permissions.
Prepare the environment
A representative staging setup, test accounts for every role, and test data with no real personal information.
Agree the rules
Testing windows, forbidden actions, data handling, and named contacts on both sides for urgent issues.
Plan the fixes and retest
Reserve developer time after the test, and confirm the tester will retest fixed issues.
Tell your hosting team and any monitoring provider when testing is happening, so alerts are not mistaken for a real attack — or, if you want to test whether your monitoring notices, agree that deliberately with a senior contact.
Reading the Report and Fixing What It Finds
A good report has two audiences. The executive summary tells leadership the overall risk in plain language. The technical findings give developers what they need to reproduce and fix each issue: a description, the evidence, the steps to reproduce, the impact, a severity rating and specific remediation advice.
Severity is usually expressed using CVSS, a standard scoring system for vulnerabilities. CVSS is a useful common language, but it scores a weakness in general, not in your specific context. A medium-rated issue in the part of the application that handles payments may deserve more urgency than a high-rated one on an internal page with no sensitive data. Read severity alongside the tester's description of real impact.
| Severity | Example finding | Example remediation target |
|---|---|---|
| Critical | Any user can read all customers' records through an API | Fix or mitigate within days; consider taking the feature offline |
| High | Password reset can be abused to take over accounts | Within a couple of weeks |
| Medium | Sessions do not expire after logout | Within the next release cycle or two |
| Low | Version numbers revealed in response headers | Planned as routine hardening |
The timelines above are an example policy, not a standard — set your own, write them down, and keep to them, because customers and auditors increasingly ask not just whether you test but how quickly you fix. Always ask for a retest of fixed issues, and keep both the original report and the retest results as evidence. Many issues share a root cause — for example, inconsistent authorisation checks across the code — and fixing the cause is better than patching each instance; a security hardening review is often the right follow-up when a test finds the same kind of problem repeatedly.
Choosing a Tester and How Often to Test
When comparing providers, ask to see a sample report with real (anonymised) findings, how much of the test is manual versus automated, who will actually perform the testing and what experience they have, whether a retest is included, and how they handle data they access. Recognised individual certifications such as OSCP, and schemes such as CREST in the UK or CERT-In empanelment in India, are useful signals, and some customers or regulators require a specific one — check that before you choose.
Beware the cheap "pen test" that is really a scan. If a quote is very low, the timeline is a day or two for a complex application, or the sample report is mostly automated output, you are buying a vulnerability scan with a different name.
As for frequency, a common baseline is at least once a year and after any significant change — a major release, a new authentication system, a new public API, or a move to new infrastructure — with automated scanning running continuously in between. Testing early in a product's life is far cheaper than discovering problems during a large customer's procurement, a pattern discussed in From Prototype to Production: Why Software Projects Get Stuck After the MVP.
Conclusion
A penetration test is only as useful as its fit to your application and how well it is prepared. Understand the difference between a scan, a vulnerability assessment and a real penetration test. Choose grey-box testing as the sensible default for business web applications, black box when external exposure is the question, and white box for the most sensitive systems. Scope precisely, prepare a representative environment with accounts for every role, agree the rules of engagement, read severity in your own context, fix to a written timeline and insist on a retest. Done this way, the report becomes evidence your customers trust — and, more importantly, a safer application.
Need a security test for a launch, a customer questionnaire or an audit?
We will help you choose the right type of test, scope it properly and turn the findings into fixes. See our VAPT service or start the conversation.
Frequently Asked Questions
How long does a web application penetration test take?
It depends on the size and complexity of the application, the number of user roles and APIs, and the type of test. A small application may need a few days of testing; a large platform with many roles and integrations can take several weeks, particularly for white-box testing.
Should we test in production or staging?
Staging is usually safer, provided it closely matches production in configuration and version and uses test data. Production testing is sometimes necessary, and then needs agreed limits on timing, request rates and destructive actions.
Is an automated scan enough for a customer security questionnaire?
Usually not. Most enterprise customers asking for a penetration test expect manual testing by a qualified tester, with a report showing methodology, findings and remediation. Automated scans are useful between tests, not instead of them.
What is the difference between VAPT and a penetration test?
VAPT combines a vulnerability assessment — finding and confirming known weaknesses — with penetration testing, where a tester actively tries to exploit and chain those weaknesses. The result is both a complete list of issues and evidence of what is actually reachable.
How often should we have our application tested?
A common baseline is at least annually and after significant changes such as major releases, new authentication or new public APIs, with automated scanning in between. Regulated industries and large customers may require more frequent testing.