On this page

Your vulnerability scanner came back clean on Friday. On Monday, a tester signed in as an ordinary customer, changed one number in a request and was looking at another customer’s invoices. Nothing was “vulnerable” in the way a scanner understands it. The application simply never checked who was asking.

That gap, between what tools can see and what an attacker can actually do, is why penetration testing exists. Attackers rarely need a clever zero-day. They need one missed check, one forgotten server or one reused password, and someone patient enough to find it.

So, what is penetration testing? It is an authorized, simulated attack on your applications, APIs or networks, carried out by skilled testers who try to break in the way a real attacker would, then show you exactly how they did it and how to fix it. This guide covers how a pentest works, the main types, what real findings look like, what you get at the end and how to decide whether you need one this year.

Key takeaways

  • A penetration test proves what an attacker can actually do, not just what might be wrong. Every finding should come with evidence.
  • It is not a vulnerability scan, and it is not a permanent stamp of approval. It is a point-in-time check of how well your defenses and processes hold up.
  • The most damaging findings are usually access control and business logic flaws that no scanner flags.
  • A good test ends with a prioritized report, CVSS-scored findings, specific fixes and a retest that confirms they worked.
  • AI now speeds up recon, triage and reporting. Human testers still decide what is real and what matters.

1. What is penetration testing, in plain words?

A penetration test (pentest, or pen test) is a controlled attack you commission. You agree what is in scope, the testers try to get in, and they document every weakness they could exploit along with its business impact.

The UK’s National Cyber Security Centre frames pentesting as a way to gain assurance about a system by attempting to breach it the way an adversary would. Two words in that idea matter most: assurance and adversary. You are not buying a list of possible issues. You are buying evidence about how your systems behave under attack.

Pentesting, ethical hacking and red teaming

People use these terms loosely, so here is the short version:

  • Ethical hacking is the broad skill set: hacking with permission, for defense.
  • Penetration testing applies it to a defined scope, such as one web app or an IP range, to find as many exploitable weaknesses as the time allows.
  • Red teaming is stealthy and goal-based: reach one objective, such as customer data, while your defenders try to detect it.

What separates all three from crime is written authorization. Without it, the same activity is unauthorized access.

2. Why businesses still pay for penetration testing

Attackers are getting in through weaknesses you could have found first. Verizon’s 2025 Data Breach Investigations Report found that exploitation of vulnerabilities was the initial access step in 20% of breaches, a 34% increase on the previous year’s report. It also found that third-party involvement in breaches doubled to 30%, so a supplier’s weakness can quickly become yours.

A pentest gives you four things a scanner or an internal review rarely does:

  1. Proof. A reproducible proof of concept ends the “is this really a problem?” debate.
  2. Priority. Testers show which issues chain into real damage, so you fix those first.
  3. An outside view. Builders test what they expect. Testers test what they don’t.
  4. Evidence for others. Enterprise customers ask for recent pentest results, and standards such as PCI DSS require regular penetration testing. See penetration testing for compliance.

3. How a penetration test works: the 6 phases

Providers name the phases differently, but good testing follows the same arc. Public methodologies such as NIST SP 800-115, PTES and the OWASP Web Security Testing Guide describe it in detail.

Phase 1: Scoping and rules of engagement

You agree the targets (domains, apps, APIs, IP ranges), the environment, the testing window, test accounts and what is off limits, such as denial-of-service. You also choose a black-box, grey-box or white-box approach. Everything goes in writing first.

Phase 2: Reconnaissance

Testers map what is exposed: subdomains, live hosts, technologies, API endpoints and user roles. Forgotten assets often surface here, as our subdomain enumeration guide shows.

Phase 3: Vulnerability discovery

Automated scans cover known issues quickly. Then testers work by hand through authentication, sessions, access control, input handling and business rules.

Phase 4: Exploitation

Testers confirm each suspected weakness in a controlled way, just far enough to prove impact without harming data or availability. This turns “possible” into “proven”.

Phase 5: Chaining and impact

A verbose error message, a predictable ID and a missing role check may each look minor. Together they can expose every customer record. Testers look for those chains, because attackers do.

Phase 6: Reporting, remediation and retest

Findings are written up with severity, evidence and fixes. Your team remediates, and the testers retest to confirm each fix worked. Our penetration testing methodology guide goes deeper.

4. Types of penetration testing

Tests are usually grouped by what you are testing.

Type What gets tested Typical high-impact findings
Web application Customer portals, admin panels, SaaS apps Broken access control, injection, weak session handling
API REST and GraphQL endpoints Object-level authorization flaws, excessive data exposure
Mobile Android and iOS apps plus their backend API Hardcoded secrets, insecure local storage, trusting the client
External network Internet-facing hosts, VPNs, mail, remote access Exposed admin services, unpatched edge devices
Internal network Office networks, servers, Active Directory Weak service accounts, paths to domain admin
Cloud Accounts, identities and storage configuration Over-permissive roles, public storage
Social engineering People and processes Phishing, pretexting, weak help-desk checks

You also choose how much testers know going in. Black-box testers start with nothing. Grey-box testers get user accounts and some documentation, usually the best value for SaaS, APIs and mobile apps. White-box testers get source code. See black-box vs grey-box vs white-box testing for the trade-offs, and types of penetration testing for more on each target.

5. What penetration testing is not

Most disappointment with pentests comes from buying the wrong thing.

Vulnerability scan Penetration test Red team Bug bounty
Main question What known issues exist? What can an attacker exploit here? Can we detect and stop a real attack? What can outside researchers find?
Who does it Mostly tools Skilled testers, tool-assisted Specialist team Many independent researchers
Scope Broad Defined targets One objective, wide scope Program rules
Proves impact No Yes Yes Per report
Finds logic flaws Rarely Yes Sometimes Sometimes

Three points are worth repeating:

  • A clean scan is not a pentest. An unvalidated scanner export is a scan, whatever it is called. See penetration testing vs vulnerability scanning.
  • A pentest is a snapshot. It shows what was exploitable during the test window. New code can change that the following week.
  • It checks your process, it doesn’t replace it. The NCSC’s view is that a pentest should validate your vulnerability management, not be your main way of finding issues. Between tests, keep patching, guided by sources such as CISA’s Known Exploited Vulnerabilities catalog.

That is also why one test a year leaves long gaps, a problem we cover in why a yearly pentest won’t save your company.

6. What real pentest findings look like

These patterns turn up again and again in web, API, mobile and network tests.

A customer can read another customer’s data

The app checks that you are logged in, but not that the record belongs to you. Scanners can’t tell your data from mine, so they miss it. This class of bug, broken access control, ranks first in the OWASP Top 10:2025. Fix: enforce ownership checks on the server for every object.

The business rules can be bent

A discount code applies twice. A refund can exceed what was paid. An approval step can be skipped by going straight to the final screen. Fix: validate every step and every amount on the server, never only in the browser or app.

A forgotten server does the damage

A staging host with debug mode switched on, still reachable from the internet, exposes configuration and keys. Nobody remembered it existed. Fix: keep an asset inventory and use attack surface discovery so you know what is exposed before attackers do.

The mobile app gives away the backend

An API key sits inside the app package, and the backend trusts any request that carries it. Fix: keep secrets on the server and authorize each user, not each app.

Small issues chain into a critical one

On internal tests, a guessable service account password plus excessive privileges can be a short path to control of the whole Windows domain. Fix: strong unique credentials for service accounts, least privilege, and monitoring of privileged groups.

None of these needs an exotic technique. They need someone thinking like an attacker.

7. What you get at the end of a pentest

The report is the product. A good one includes:

  • An executive summary a non-technical leader can act on.
  • Each finding with a severity, a CVSS 3.1 score and vector, the affected assets and a reproducible proof of concept.
  • Specific remediation, not “follow best practice”.
  • Retest results showing which issues are confirmed fixed.

Compare any provider’s output with our sample pentest report (PDF), and see how to write a penetration test report for what good looks like.

8. Do you need a penetration test? A quick checklist

You probably need one if any of these is true:

  • You are launching a new web app, API or mobile app, or shipping a major change.
  • A customer, partner or investor has asked for a recent pentest.
  • You handle payments, health data or personal data at scale.
  • You have had an incident and need to confirm the hole is really closed.

If you don’t yet know which domains and servers you own, or patching is months behind, start with attack surface discovery and a vulnerability assessment. Otherwise a pentest will mostly find what basic hygiene would have caught.

How to prepare

  1. List every domain, app, API and IP range in scope.
  2. Create test accounts for each user role, including an admin.
  3. Pick the environment. Production is realistic; staging is lower risk.
  4. Name a technical contact and agree how critical findings are reported mid-test.
  5. Book developer time for fixes and the retest.

For cadence, see how often you should do a penetration test. For picking a provider, read how to choose a penetration testing company.

9. Where AI-powered pentesting fits

AI pentesting is changing how fast testing happens. AI handles the high-volume work well: mapping attack surface, adapting scan pipelines, filtering noise and drafting write-ups. It cannot know that your refund flow matters more than a missing header, or whether a finding is safe to prove on a live system. That judgment still belongs to people.

WhyXpose is an AI-powered pentesting platform built on that split:

  • AI-guided recon and scanning. AI agents plan and run recon and scan pipelines and choose the next steps based on what they find.
  • AI triage. Findings are filtered for false positives and ranked by risk before an expert looks at them.
  • AI-drafted reports and fixes, reviewed and corrected by our testers.
  • Human verification. Certified penetration testers and CVE holders verify every finding with a reproducible proof of concept and a CVSS 3.1 score, then retest after you fix it.

WhyXpose is verified under the Cyber Verification Programs for Anthropic Claude and OpenAI Codex, and also runs self-hosted open-source AI models. Findings are tracked to the fix in our vulnerability management platform, and the PDF report is one click away. We have secured 1,000+ companies to date, and our research team monitors the internet for new vulnerabilities and exposures every single day, reporting them privately through responsible disclosure. More in our guide to AI penetration testing.

Frequently asked questions

What is penetration testing in simple terms?

It is a hired, authorized attack on your own systems. Skilled testers try to break into your apps, APIs or networks the way a criminal would, then show you what they reached and how to fix it.

Yes, when the system owner has given written permission and testers stay within the agreed scope. Without that authorization, the same activity breaks computer misuse laws in most countries. If you run on third-party cloud or SaaS platforms, check their testing policies too.

How long does a penetration test take?

It depends on scope. A single web app or API is often tested over a few days to a couple of weeks, while several applications plus an internal network take longer. Reporting and the retest add time, so agree the full timeline during scoping.

Can a penetration test break my systems?

Rarely, when it is run properly. The rules of engagement exclude risky activities such as denial-of-service, testers prove impact with the least intrusive method, and many teams test on staging. Take backups anyway.

How much does a penetration test cost?

Cost follows scope: the number of applications, user roles, API endpoints and IP addresses, plus the testing approach. A fixed quote before anyone has looked at your application is a warning sign. Our penetration testing cost guide explains what drives the price.

Want to know what an attacker could do to your apps today? Get a demo of WhyXpose, or talk to a pentester about your scope.

Put this guide into practice

Web, API, mobile and network pentests by certified testers, with a verified proof of concept for every finding.

Explore pentest services