Cybersecurity

Penetration Testing vs. Vulnerability Scanning

What a vulnerability scan and a penetration test each find, what they cost in effort, and how to scope and use them well.

Key takeaways

  • Scanning gives broad, repeatable coverage of known issues and works best on a regular schedule.
  • Penetration testing adds human judgment, chaining small weaknesses into real impact and finding logic flaws.
  • Both require written authorization and a defined scope before anything is touched.
  • A report has value only when findings are assigned, fixed and verified.
  • A clean result means nothing was found within that scope and time, never that a system cannot be broken into.

A vulnerability scan is an automated check that compares your systems against a catalog of known weaknesses and reports what it finds. A penetration test is an authorized, human-led attempt to break in, showing what those weaknesses (and others a tool cannot spot) would actually let someone do. Scans are frequent, broad and cheap. Tests are occasional, focused and deeper.

Most organizations need scanning first, fixing second and testing third. Buying a penetration test while hundreds of known updates are missing mostly buys an expensive list of things you already could have found.

How vulnerability scanning works

A scanner discovers hosts and open services, identifies software and versions, and checks them against a database of known flaws, most with CVE identifiers, along with common misconfigurations such as default passwords or weak encryption settings.

There are several flavors:

  • External scans look at your internet-facing addresses, as an outsider would.
  • Internal scans run from inside the network.
  • Authenticated scans log in to systems with a read-oriented account, seeing installed packages and settings. They are far more accurate than guessing from the outside.
  • Web application scans crawl a site and probe inputs for common errors.
  • Dependency and container scans check the libraries your software is built from.

Scanners make mistakes. A false positive might report an old version number on a package whose vendor already backported the fix. A false negative happens when the tool lacks a check, cannot log in or never reaches a system. Scans can also disturb fragile equipment, so tune them and warn the owners.

How a penetration test works

Testers start from an agreed position, such as an anonymous outsider, a logged-in customer or an employee's laptop, and pursue agreed goals. They use scanners too, then go further: combining a leaked password with a missing second factor, noticing that changing an account number shows someone else's records, or finding that an overlooked file share holds administrator credentials.

Phases of an authorized penetration test
1 Scope and permission Targets, dates, rules, contacts and written authorization are agreed. 2 Reconnaissance Testers learn what exists and how it is arranged. 3 Find weaknesses Automated checks and manual review identify likely openings. 4 Demonstrate impact Selected flaws are exercised carefully within the agreed rules. 5 Report Findings, evidence, risk and fixes are written for two audiences. 6 Retest Fixed items are checked again to confirm they are closed. Scope and permission Targets, dates, rules, contacts and written authorization are agreed. 1 Reconnaissance Testers learn what exists and how it is arranged. 2 Find weaknesses Automated checks and manual review identify likely openings. 3 Demonstrate impact Selected flaws are exercised carefully within the agreed rules. 4 Report Findings, evidence, risk and fixes are written for two audiences. 5 Retest Fixed items are checked again to confirm they are closed. 6

Tests are described by how much the testers are told. In a black box test they get little information, a white box test provides documentation and perhaps source code, and a gray box test sits between, often with ordinary user accounts. More information usually means more thorough coverage for the same time.

One example, seen both ways

Picture a hypothetical company with a customer portal and an office network.

A scan reports that the web server's TLS settings allow an old protocol version, that one office printer runs outdated firmware, that a file server is missing updates and that an internal device still uses its default password. Each finding gets its own severity.

A tester starting with an ordinary customer account notices that changing a number in the address of an invoice shows another customer's invoice. No scanner signature covers that, because the software is working as written; the permission check is simply missing. Starting from an office laptop, the tester then uses the default password on that internal device, finds a stored account name and password in its settings, and discovers that the same password opens the file server.

The scan had listed the default password as a medium issue among many. The test showed that it led to the company's files. Both reports are right. The first tells you what is weak across the board, and the second tells you which weaknesses connect into something serious. The fixes follow: add the permission check, remove default and shared passwords, patch, and separate devices from servers.

Side by side

Scan and test at a glance
Vulnerability scan Mostly automated Broad coverage of known issues Run weekly, monthly or continuously Output is a list with severity ratings Needs someone to verify and prioritize Penetration test Led by skilled people Deeper on a defined scope Run periodically or after big changes Output shows attack paths and impact Limited by time and rules VS Vulnerability scan Mostly automated Broad coverage of known issues Run weekly, monthly or continuously Output is a list with severity ratings Needs someone to verify and prioritize Penetration test Led by skilled people Deeper on a defined scope Run periodically or after big changes Output shows attack paths and impact Limited by time and rules

A third term appears often. A red team exercise simulates a determined adversary pursuing an objective over a longer period, partly to test whether defenders notice and respond. It makes sense for organizations that already have a monitoring team to test.

What neither one does

Neither fixes anything. Neither proves your security is good. Both describe a moment in time, and a change the next day can open a new hole. Neither usually covers how well you would recover from an attack, which is what backup tests and incident exercises are for.

Some standards expect both. The Payment Card Industry Data Security Standard, for example, calls for regular vulnerability scanning, including external scans by an approved vendor, and periodic penetration testing. Check the exact requirements that apply to you in the current version or with your assessor.

Which do you need now?

Your situation Sensible next step
No inventory of systems Build one, then scan
Never scanned Start external and authenticated internal scans
Long backlog of findings Fix the exploited and exposed items before buying tests
Launching a web app that holds customer data Scan, review the code and commission a focused test
Mature patching, want assurance Periodic penetration test
Monitoring team in place Consider a red team or joint exercise

Running a scanning program

  1. List the assets and who owns each.
  2. Schedule scans, with authentication where safe.
  3. Rank results by exploitation evidence, exposure and the importance of the system, not score alone.
  4. Set target fix times by priority.
  5. Verify fixes with a follow-up scan.
  6. Record accepted risks with an owner and review date.

Only scan what you are authorized to scan. Hosted providers often have their own testing rules, and scanning without permission can cause legal trouble.

Buying a penetration test

Ask providers:

  • Who will do the work, and what experience do they have with systems like yours?
  • What methodology do you follow? Public ones include the OWASP testing guides for web applications and NIST Special Publication 800-115.
  • How much is manual? A report that reads like raw scanner output was probably produced that way.
  • How are our data and any access handled and deleted afterward?
  • What happens if you find something critical mid-test?
  • Is retesting included?
  • Can we see a redacted sample report?

Define rules of engagement in writing: in-scope addresses and applications, excluded actions such as denial of service, testing hours, emergency contacts and stop conditions. Back up important systems first and test in a staging environment where it faithfully mirrors production.

Reading the report

Start with the summary of attack paths: how a tester got from the starting point to something that matters. Fixing one link may break several paths. Then assign each finding an owner and date.

Look for systemic causes. Five findings about weak passwords suggest a policy and tooling gap, best solved with password managers and multi-factor sign-in. Several about unreachable updates suggest an inventory problem. Flat access between departments points toward segmentation.

Reports are sensitive documents, effectively a map of your weak points. Limit who receives them and share them over protected channels.

How often and when

Frequency should follow change and exposure. Internet-facing addresses deserve frequent scanning, since new flaws appear daily and a forgotten service can be exposed by one firewall edit. Internal systems can follow a regular cycle tied to patching.

Penetration tests make sense at moments that change your risk: before launching an application that handles sensitive data, after a major redesign or migration, after merging with another organization's network and on whatever interval your obligations set. Book ahead, and leave time in the schedule to fix serious findings before the launch date. A test that ends the day before release can only tell you what you are about to ship.

Between tests, keep the earlier report open. Track which findings are closed, which are accepted and which have drifted. If the next tester finds the same problems again, the gap is in your follow-through, and no change of vendor will solve it.

Preparing your team

Tell the people who run affected systems that testing is happening, unless detection is deliberately part of the exercise and leadership has approved that. Give your monitoring staff or provider a way to confirm whether a particular alert is the test, so a real intrusion during the same week is not waved away. Agree a stop word, in effect: a named person who can pause everything with one call.

After the test, ask for removal of any accounts, files or tools the testers created, and check that it happened.

Finally, hold a short debrief with the testers. Ask what slowed them down, because those controls are worth keeping, and what they would try with more time.

Common questions

Is a scan enough for a very small business?

Often yes, together with automatic updates, multi-factor sign-in and tested backups. Commission a test when you handle sensitive data in custom software or a customer or regulator requires one.

Can automated "pentest" tools replace testers?

They can automate parts of exploitation and run more often. They still struggle with business logic, such as whether a refund process can be abused.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Cybersecurity →

Latest news on this topic