COMP-222 · Lesson 2 of 12 · 22 min
Vulnerability scanning approaches
▶ Video coming soon A video version of this lesson is on the way.
Prairiefold's external scan ran first, on the morning of October 8, 2026, once the reconnaissance team had finished fingerprinting the fourteen in-scope hosts. Tobias expected a single button marked scan. Instead Dario opened the scanner's policy screen and walked him through more than a dozen decisions: which ports, which protocols, how fast, which families of checks, whether to try logins, whether to follow web links, what to do if a host stopped answering. Each decision, Dario said, was a trade between finding more and breaking less, and each one should be traceable to the rules of engagement.
Objective 3.1 lists many types of scans. This lesson covers the general approaches that the rest of the course builds on: network scans over TCP and UDP, including stealth scans; host-based and agent-based scanning; passive discovery; wireless scans; and the main tools the exam names for infrastructure scanning. Authenticated scanning gets its own lesson next, and application, container and industrial scanning follow after that.
What a vulnerability scanner does
Almost every vulnerability scanner works through the same stages. It discovers which targets are alive. It enumerates open ports and identifies the services and versions behind them. It matches what it found against its library of checks, each of which describes a vulnerability or misconfiguration and how to detect it. Some checks only compare a version number with a list of affected versions. Others send a specific request and examine the response, try a default credential, or, with credentials, read installed package lists and configuration files. Finally the scanner reports each match as a finding with a severity, a description, references such as CVE identifiers, and the evidence it used.
The quality of a scan depends on two things a tester controls: what the scanner can see, and which checks it is allowed to run. A scanner outside a firewall sees only what the firewall lets through. A scanner without credentials sees only what services expose to anonymous clients. A scanner with intrusive checks disabled will not confirm some issues that require trying an action. None of these limits is a flaw; each is a choice that the report must describe so the reader knows what the scan could and could not have found.
Network scans over TCP and UDP
A network scan examines targets over the network from a scanner's vantage point. Port scanning, covered in depth in PenTest+: Reconnaissance and Enumeration, is the foundation. For vulnerability discovery, what matters is how the port scan choices affect what the vulnerability checks can find.
TCP scans are reliable because TCP answers clearly. An open port replies to a connection request; a closed port resets it; a filtered port usually says nothing. A full connect scan completes the TCP three-way handshake, which is reliable and needs no special privileges, but every connection may be logged by the target application. A SYN scan, often called a half-open or stealth scan, sends the first packet of the handshake and reads the reply without completing the connection. It is faster and less likely to appear in application logs, though any modern intrusion detection system or firewall will still record it. The word stealth is historical; on a monitored network, nothing about a SYN scan is invisible.
UDP scans are slower and less certain. UDP has no handshake, so an open UDP port often sends nothing back to a generic probe. A closed port usually returns an ICMP port unreachable message, but many systems rate-limit those messages, which slows the scan dramatically. Good UDP scanning sends protocol-specific probes, such as a valid DNS query to port 53 or an SNMP request to port 161, so that open services reply. Testers often limit UDP scans to the most common ports and accept that coverage will be lower, then say so in the report.
nmap -sS -p- --min-rate 500 -oA pf-ext-tcp 203.0.113.0/26
nmap -sU --top-ports 50 -oA pf-ext-udp 203.0.113.0/26
nmap -sV --script "vuln and safe" -p 22,25,443 -oA pf-ext-vuln 203.0.113.20The last line in the listing shows a common bridge between port scanning and vulnerability scanning. The Nmap Scripting Engine sorts scripts into categories such as safe, intrusive, vuln, exploit and dos. Selecting scripts that are both vuln and safe asks for vulnerability checks that the script authors consider unlikely to crash a service or change data. It is a quick way to confirm a handful of issues on a few hosts, but it is not a substitute for a full vulnerability scanner with a maintained check library.
Host-based and agent-based scanning
A host-based scan examines a system from the inside: its installed software, patch level, configuration, local accounts, file permissions and running services. There are two ways to get that inside view. A network scanner can log in with credentials over SSH, Windows remote management or similar protocols and run its checks remotely; that is the credentialed scanning covered in lesson 3. Alternatively, an agent installed on the host runs the checks locally and reports back to a central console.
Agents suit laptops that are rarely on the office network, cloud instances that scale up and down, and environments where opening scanning ports from a central scanner is difficult. Their weakness from a tester's point of view is that they show only what is installed, not what an attacker on the network would see. A database might be fully patched according to its agent but still exposed to the whole branch network because of a firewall rule. Penetration testers therefore usually combine a network view with a host view rather than relying on either alone.
| Approach | Sees | Strengths | Limits |
|---|---|---|---|
| Unauthenticated network scan | What any client on the network can reach | Shows real exposure; no setup on targets | Guesses versions from banners; misses local issues |
| Credentialed network scan | Installed software and configuration via remote login | Accurate patch and configuration data | Needs accounts, ports and permissions; can fail silently |
| Agent-based scan | Local state, reported from the host | Works for roaming and cloud hosts | No view of network exposure; agent must be deployed |
| Passive discovery | Traffic already crossing a monitored link | No packets sent to targets; safe for fragile systems | Only sees what talks; slower to build a picture |
Passive discovery
Passive techniques learn about systems by watching traffic rather than sending probes. A sensor connected to a switch mirror port or a network tap records which hosts talk, which protocols they use and which software versions appear in their traffic, such as client hello messages, server banners and protocol handshakes. Passive discovery is slow and incomplete, because it sees only systems that happen to communicate during the observation period, but it sends nothing to the targets. That makes it the first choice for fragile environments, and lesson 6 returns to it as one of the two industrial control system techniques the exam names.
At Prairiefold, the team used passive observation for a short time on the head office network on the first evening, before any active internal scanning. Dario wanted a picture of normal traffic so that, if a scan caused trouble, they could see what had changed. The capture also turned up a printer that was announcing itself with an outdated management protocol, which went on the list for a later, gentle active check.
Choosing a scan policy
Commercial and open-source scanners package their choices into policies or scan configurations. A policy sets the port range, the discovery method, which families of checks run, whether intrusive checks are enabled, how many hosts and checks run in parallel, timeouts, and whether to use credentials. Typical starting templates include host discovery only, a basic network scan, a full audit with credentials, a web application scan, and compliance audits against a configuration benchmark. Testers rarely run a template unchanged.
| Setting | Prairiefold external choice | Prairiefold internal choice | Reason |
|---|---|---|---|
| Ports | All TCP, top 50 UDP | All TCP, top 100 UDP | External exposure is small enough for full TCP coverage |
| Safe checks | On | On | Rules of engagement prohibit destructive checks |
| Default credential checks | Off | On for named device types only | Allowed only against systems listed in the rules |
| Concurrent hosts | Moderate | Low on branch segments | Branch links are slow and shared |
| Credentials | None | Two dedicated scan accounts | Internal test is gray box |
| Web crawling | Limited depth | Off | Web applications are tested separately |
Speed settings deserve particular care. Every scanner can be tuned to send more probes in parallel. Faster scans finish sooner but load the network, fill firewall state tables and can make fragile devices stop responding. At Prairiefold, the branches connected to head office over modest wide-area links, and a scan that saturated a link would interrupt teller systems. Dario set the branch scans to one branch at a time with low concurrency and asked Felix Aberdeen to keep an eye on link utilization during the first one.
Wireless scans
Objective 3.1 names three things to look at in wireless scanning: the SSID, the channel and the signal strength. A wireless survey tool such as Kismet or the airodump-ng component of the Aircrack-ng suite listens on each channel in turn and records the networks it hears: their SSIDs, the hardware addresses of their access points (the BSSIDs), the channels they use, the encryption and authentication they advertise, and how strong their signals are.
BSSID CH PWR ENC AUTH ESSID
00:00:5E:00:53:01 1 -48 WPA2 MGT PF-Staff
00:00:5E:00:53:02 6 -52 WPA2 PSK PF-Guest
00:00:5E:00:53:03 11 -55 WPA2 PSK <hidden>
00:00:5E:00:53:04 6 -71 OPN - BAS-SetupReading the output is a vulnerability-discovery task in its own right. The staff network uses enterprise authentication, marked MGT, which is the expected design. The guest network uses a shared passphrase, which is normal for guests but raises the question of whether it is properly isolated from internal systems. The network with a hidden name on channel 11 used a shared passphrase and did not match any access point on Prairiefold's inventory; it turned out to be a consumer router plugged in under a teller station, and the branch removed it the same day. A second, weaker entry using the staff network's own name would have raised a different worry: a device impersonating the staff network, sometimes called an evil twin. The open network named BAS-Setup belonged to the building automation controller, which was broadcasting its setup network, a common misconfiguration that may give anyone in the car park a path onto the device.
Signal strength, shown in decibel-milliwatts as negative numbers, tells the tester how far a network leaks. Values closer to zero are stronger, so minus 48 is much stronger than minus 71. A staff network that is strong in the parking lot or the coffee shop next door is reachable by someone who never enters the building. Channel data supports a different set of conclusions: overlapping channels and crowded spectrum point to reliability problems, and an unexpected access point on an unusual channel may be a rogue access point plugged in by an employee. The wireless attacks themselves belong to objective 4.7 and PenTest+: Attacks and Exploits; for discovery, the survey identifies what is there and what looks wrong.
The tools named in objective 3.1
The exam objectives list specific tools. This lesson introduces the general infrastructure scanners; later lessons cover the specialized ones.
| Tool | What it is | Covered in |
|---|---|---|
| Tenable Nessus | A widely used commercial vulnerability scanner with a large plugin library, credentialed and unauthenticated scanning and compliance audits | This lesson and lessons 3 and 7 |
| Greenbone / OpenVAS | An open-source vulnerability scanner and management platform; OpenVAS is the scanner engine and Greenbone provides the platform and feed of tests | This lesson and lesson 7 |
| Nikto | An open-source web server scanner that checks for dangerous files, outdated server software and server misconfigurations | Lesson 4 |
| TruffleHog | An open-source tool that searches code repositories and other sources for leaked secrets and can check whether found credentials are live | Lesson 5 |
| BloodHound | A tool that collects Active Directory and Entra ID relationship data and graphs paths to privileged access | Lesson 3 |
| PowerSploit | A collection of PowerShell modules for testers, including reconnaissance; the project is no longer supported | Lesson 3 |
| Grype and Trivy | Open-source scanners for container images, file systems and software bills of materials; Trivy also scans infrastructure as code and Kubernetes | Lesson 5 |
| Kube-hunter | An open-source tool that hunts for security weaknesses in Kubernetes clusters; no longer under active development | Lesson 5 |
Nessus and Greenbone take similar approaches. Each keeps a large, regularly updated library of checks, called plugins in Nessus and network vulnerability tests in Greenbone. Each lets the tester build scan policies, run credentialed and unauthenticated scans, and export results. Greenbone attaches a quality of detection value to each result, a percentage that reflects how reliable the detection method is: a check that confirmed a vulnerability by observing a specific response scores higher than one that inferred it from a version banner. The idea of weighing how a scanner reached its conclusion carries straight into lesson 8 on validation.
Detecting and controlling scans
From the defender's side, scans are noisy and easy to notice if monitoring is in place. Firewalls log bursts of connection attempts to many ports. Network intrusion detection systems have signatures for common scan patterns and for the specific requests vulnerability checks send. Web servers log the distinctive paths that web scanners request. Endpoint tools may flag remote logins from a scanner's address. A mature client keeps a register of authorized scanner addresses, alerts on scans from anywhere else, and periodically confirms that its alerts still fire.
Prairiefold's MSSP recorded the external scan as a correlated alert within minutes of its start. The internal SYN scan of the head office server segment, by contrast, produced no alert at all, because the internal intrusion detection sensor monitored only traffic to and from the internet. That gap became a finding of its own, written by Tobias with Dario's review: internal scanning activity from an unexpected host was not detected. The remediation was to extend internal network monitoring to the server segments and to alert on scanning behavior from any address not on the authorized scanner register.
Worked problem
Choosing an approach for each target
For each Prairiefold target, choose the most suitable first approach: (a) 40 branch teller workstations on slow links; (b) a head office file server; (c) a building management controller in the head office basement whose vendor warns against scanning; (d) staff laptops that are often off site.
Show solution
- (a) Low-concurrency credentialed network scan, one branch at a time, inside the agreed window.
- (b) Full TCP scan plus a credentialed scan to see both exposure and patch level.
- (c) Passive observation first, then a manual, gentle check only if the rules of engagement and the owner allow it.
- (d) Agent-based results from the client's existing tooling, supplemented by a network scan when the laptops are connected.
Answer: Match the approach to visibility, fragility and availability of each target, and record each choice.
Common mistakes
MistakeCalling a SYN scan invisible because it is described as stealth.
InsteadAssume any monitored network will log it; stealth only means fewer application logs.
MistakeRunning a UDP scan of all ports and reporting the results as complete.
InsteadUse protocol-specific probes on common ports and state the coverage limit.
MistakeRelying only on agent results to describe exposure.
InsteadCombine host data with a network view of what is reachable.
MistakeUsing a scanner's default speed on slow or fragile links.
InsteadThrottle concurrency and watch the network during the first run.
MistakeReading a weak second signal for a staff SSID as just another access point.
InsteadInvestigate it as a possible rogue or impersonating access point.
Summary and key terms
- Scanners discover, enumerate, match against checks and report, limited by visibility and by which checks are permitted.
- TCP connect and SYN scans give clear answers; SYN scans are called stealth but are still logged by monitoring tools.
- UDP scanning is slower and less certain and needs protocol-specific probes.
- Host-based results come from credentialed remote checks or installed agents and complement the network view.
- Passive discovery sends nothing to targets and suits fragile environments.
- Wireless scans record SSID, channel and signal strength to find leakage, rogue access points and weak configurations.
- Policies set ports, checks, speed and credentials and should be traceable to the rules of engagement.
- Stealth scan
- A SYN or half-open scan that does not complete the TCP handshake.
- Host-based scan
- An examination of a system's software and configuration from the inside.
- Agent
- Software on a host that runs checks locally and reports to a console.
- Passive discovery
- Learning about systems by observing existing traffic without sending probes.
- Scan policy
- A saved set of scanner settings controlling ports, checks, speed and credentials.
- SSID
- The name a wireless network advertises.
- Rogue access point
- An unauthorized wireless access point connected to or imitating an organization's network.
- Quality of detection
- A Greenbone value expressing how reliable the method behind a result is.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why might a UDP scan report many ports as open or filtered rather than open?
Show answer
Open UDP ports often do not reply to generic probes, so the scanner cannot tell an open port from a filtered one.
A wireless survey shows the staff SSID at minus 45 dBm in the parking lot. Why does that matter?
Show answer
The network is reachable from outside the building, extending the area from which attacks could be attempted.
What two settings most affect what a vulnerability scan can find?
Show answer
What the scanner can see, set by placement and credentials, and which checks it is allowed to run.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.