Penetration testing in software testing is an authorised, controlled attempt to exploit weaknesses in an application, network or system, the way a real attacker would. Unlike functional testing, which checks that features work, it checks whether the software can be made to do something it should not, such as leaking data or letting one user access another account.
Key takeaways
- A penetration test proves exploitability: it shows which flaws an attacker could really use, not just which ones a scanner lists.
- Black-box, grey-box and white-box tests differ in how much the tester knows, and each simulates a different attacker.
- The value is in the report and the fixes: scope it well, fix by impact, and retest the critical findings.
Functional testing proves your software works when users behave. Penetration testing proves it holds up when someone tries to break it. It is the closest thing to a rehearsal for a real attack, run safely, with permission, and with a report you can act on.
What is penetration testing in software testing?
Penetration testing, often called a pentest, is an authorised, controlled attempt to exploit weaknesses in software, networks or cloud systems. A tester thinks like an attacker, probes the system, and tries to prove that a flaw can actually be used to gain access, steal data or disrupt a service.
In software testing, it sits alongside functional, performance and usability testing, but it asks a different question. Functional testing checks that a login form accepts the right password. Penetration testing checks whether it can be bypassed, brute-forced, or used to log in as someone else.
NIST SP 800-115, the US guide to security testing, places penetration testing among the techniques used to verify how well a system withstands active attempts to compromise it. It is not a scan and not a checklist: the tester adapts, chains weaknesses together, and shows the impact.
How is penetration testing different from a vulnerability assessment?
The two are often confused, and vendors sometimes use the names interchangeably. The difference is proof. A vulnerability assessment finds and lists potential weaknesses. A penetration test tries to exploit them and shows what happens next.
| Vulnerability assessment | Penetration test | |
|---|---|---|
| Main question | What weaknesses might exist? | Which weaknesses can an attacker really exploit, and what damage follows? |
| Method | Mostly automated scanning | Automated tools plus manual, creative testing |
| Output | Long list of possible issues, often with false positives | Shorter, validated list with evidence and impact |
| Business logic | Rarely tested | Tested in depth, for example changing prices or bypassing approval steps |
| Best for | Regular hygiene checks, broad coverage | Proving risk, testing a launch, meeting an audit requirement |
Most mature teams use both. Scans run often and cheaply to catch known issues. A penetration test runs less often, usually once or twice a year, to answer the harder question: could someone actually get in?
What are the types of penetration testing?
Tests are usually grouped by what is tested. The right mix depends on what you are protecting, and most programmes combine several types over the year.
- Web application testing: authentication, authorisation, session handling, input validation and business logic in a web app. The OWASP Web Security Testing Guide is the usual reference.
- API testing: broken object-level authorisation, excessive data exposure and weak authentication in the APIs behind mobile apps and partner integrations.
- External network testing: exposed services, open ports and weak credentials on the internet-facing perimeter.
- Internal network testing: what an attacker, or a malicious insider, could reach once inside, including segmentation and privilege escalation.
- Cloud testing: misconfigured identity, storage and workloads in AWS, Azure or Google Cloud. Cloud providers have their own rules about what may be tested.
- Mobile testing: iOS and Android apps, their storage, transport and backend APIs, using the OWASP Mobile Application Security Verification Standard.
- Social engineering testing: phishing, phone calls and physical access attempts, to test people and processes as well as technology.
Start with the system that holds the most sensitive data or faces the most attackers. For most small software teams, that is the customer-facing web application and its API.
What is black-box, grey-box and white-box testing?
The second way to classify a test is by how much the tester knows before they start. Each approach simulates a different attacker, and each has a trade-off between realism and depth.
| Approach | What the tester gets | Simulates | Trade-off |
|---|---|---|---|
| Black-box | No inside information, only public sources | An outside attacker | Most realistic, but slow; testers spend time on recon |
| Grey-box | Partial access, such as a low-privilege account | A customer, employee or vendor acting maliciously | Good balance of realism and depth |
| White-box | Full access, often including source code and architecture | A deep review of internal controls | Fastest and deepest, but least like a real external attack |
Grey-box is the most common choice for web applications. It mirrors the realistic threat of a logged-in user abusing their access, and it avoids wasting the test budget on breaking in through the front door when the interesting flaws are inside.
How does OWASP fit into penetration testing?
OWASP, the Open Worldwide Application Security Project, publishes the free resources most web application tests are built on. Three of them matter most, and they play different roles.
The OWASP Top 10 is an awareness list of the most critical web application risks, updated every few years. The 2025 edition covers broken access control, security misconfiguration, software supply chain failures, cryptographic failures, injection, insecure design, authentication failures, data integrity failures, logging failures and server-side request forgery.
The Web Security Testing Guide (WSTG) is the detailed testing manual: step-by-step test cases for authentication, session management, access control, input handling, configuration, cryptography and business logic. The Application Security Verification Standard (ASVS) defines what good controls look like at three levels of depth.
Use them together: the Top 10 sets the minimum coverage, the WSTG explains how to test for each risk, and the ASVS defines what "fixed" means. OWASP does not certify testers or products, so a provider offering "OWASP testing" means its method follows OWASP guidance, not that OWASP approved it.
How does a penetration test work, step by step?
A professional test follows a clear sequence, and the paperwork matters as much as the hacking. Skipping the first two steps is how tests go wrong, cause outages or test the wrong system.
- Scope and rules of engagement. Agree in writing what is in scope, what is off limits, what times testing may run, and who to call if something breaks. Get written authorisation from the system owner.
- Reconnaissance. The tester maps the target: domains, subdomains, exposed services, technologies and user roles, using only public and authorised sources.
- Scanning and enumeration. Automated tools list open ports, known vulnerabilities and misconfigurations. Results are leads, not findings.
- Exploitation. The tester tries to exploit the leads, manually where it matters: bypassing access controls, injecting input, abusing business logic, escalating privileges.
- Post-exploitation. If access is gained, the tester shows what it leads to: other accounts, internal systems, data. This is done carefully, without damaging data or disrupting users.
- Reporting. Each validated finding gets evidence, impact, severity and fix guidance, plus an executive summary.
- Remediation and retest. Your team fixes the findings, then the tester retests the critical and high ones to confirm the fix works.
Ask for the retest in the original quote. A test without a retest leaves you guessing whether the fix actually closed the hole.
What do penetration testers usually find?
The most common findings are rarely exotic. They are ordinary mistakes repeated at scale, and they map closely to the OWASP Top 10.
- Broken access control: changing an ID in a URL shows another customer's invoice or order. This is the most common serious finding in web tests.
- Injection: untrusted input reaches a database, command or template without proper handling.
- Security misconfiguration: debug pages left on, default credentials, verbose error messages that reveal internals, or missing security headers.
- Authentication flaws: weak password rules, no rate limiting on logins, session tokens that never expire.
- Business logic abuse: changing a price in a request, applying a discount twice, or skipping an approval step. No scanner finds these; only a human tester does.
- Excessive data exposure: APIs returning full records when the screen shows only a summary.
Check your own site's basic configuration first with the free security headers checker. Fixing the simple misconfigurations before a test means the tester spends time on the flaws that actually need a human.
You can also check the certificate behind the site with the free SSL checker, which catches expired or misconfigured certificates before a tester does.
How do you choose a penetration testing provider?
Price varies widely, and the cheapest quote is rarely the best value. Judge providers on the scope, the people and the report, not on the number of "vulnerabilities found" they promise.
- Ask who will do the work. Senior testers find the business-logic flaws; juniors run scanners. Ask for the named testers and their experience with your stack.
- Ask what is in scope. A quote that covers only the login page is not a test of your application. Check the number of user roles, APIs and workflows included.
- Ask for a sample report. A good report is readable by a developer and a manager. Vague findings with no evidence are a warning sign.
- Check the retest terms. At least one retest of critical and high findings should be included.
- Confirm the rules. The provider should insist on written authorisation, a defined scope and an emergency contact. If they do not, walk away.
For a wider starting point, our small business cybersecurity checklist covers testing alongside patching, backups and access control.
What are the common penetration testing mistakes?
Teams waste test budgets in predictable ways, and the same five mistakes show up in report after report. Avoid them, and the money you spend on a test buys findings you can actually fix.
- Testing too narrow a scope. Testing the marketing site while the customer portal holds the data is security theatre.
- Treating the report as the finish line. Findings that are never fixed are worse than useless: you now know about the risk and did nothing.
- Skipping the retest. Fixes introduce new flaws, or fix only the example in the report. Retest the critical findings.
- Testing only once a year. Software changes weekly. A test from January says little about the code shipped in October.
- Confusing a scan with a test. An automated scan report is a starting point, not proof that an attacker could get in.
The bottom line
Penetration testing is how you find out what an attacker could actually do to your software, before they do it. A scan lists possibilities; a test proves them, shows the impact, and gives your developers a clear list to fix.
Scope it around your most sensitive system, use the OWASP guides as the coverage baseline, and insist on a report with evidence and a retest. You can start by checking your site's basics with the free SSL checker, then book a test for the application behind it.
Frequently asked questions
What is penetration testing in software testing?
It is a security test in which an authorised tester tries to break into or abuse an application, to find weaknesses that could be exploited. Functional testing asks whether the software does what it should. Penetration testing asks whether it can be made to do what it should not, such as showing one customer another customer data.
What is the difference between penetration testing and vulnerability scanning?
A vulnerability scan automatically lists known weaknesses, often with false positives. A penetration test goes further: a human tester tries to exploit the weaknesses, chains them together, and shows the real impact. A scan tells you what might be wrong. A test shows what an attacker could actually do.
What are black-box, grey-box and white-box tests?
In a black-box test the tester gets no inside information, like an outside attacker. In a grey-box test they get limited access, such as a low-privilege user account, like an insider or a compromised employee. In a white-box test they get full access, including source code, so they can test deeply without wasting time breaking in.
How long does a penetration test take?
A small web application test often takes one to two weeks, including reporting. A large application, network and cloud scope can take four to eight weeks or more. The time depends on the size of the scope, the number of user roles, and how much manual testing the business logic needs.
How often should you run a penetration test?
At least once a year, and after any major change: a new feature handling payments or personal data, a new API, a cloud migration, or a merger. Many teams also test before a big launch and after a security incident. Regulated industries often have a fixed annual requirement.
Is penetration testing legal?
Yes, when it is authorised in writing. Testing without permission is illegal in most countries, even with good intentions. A proper test starts with a signed scope, rules of engagement, and written permission from the system owner, and it stays inside those limits.
What should a penetration test report include?
A good report lists each finding with evidence, the impact if exploited, a severity rating, and clear steps to fix it, plus a summary for managers. It should also list what was tested, what was out of scope, and which findings were retested after the fix.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against NIST SP 800-115, the OWASP Web Security Testing Guide and the OWASP Top 10:2025.
How we write and fact-check →