Vulnerability assessment: finding known weaknesses
A vulnerability assessment is a survey: it lists the known weaknesses in a set of systems and ranks them, without trying to break in. Most of it is done by scanning software that can check hundreds of machines in a night. No background is assumed. A security professional needs to know what the different scans can see, why their output is never taken at face value, and what a clean report does not prove.
By the end of this unit you will be able to:
- Explain what a vulnerability assessment is and what it leaves undone
- Tell apart the five discovery scans and the three port states
- Tell apart network, web application and database scans, and authenticated and unauthenticated scans
- Explain false positives and false negatives
- Put in order the steps from a raw scan report to a confirmed fix
A report with 214 lines
An illustrative example
A lettings agency with twelve staff is asked by its insurer for a vulnerability scan. The IT contractor runs one over a weekend and sends the result on Monday: 214 lines, nine of them marked critical.
The owner reads the first page and wants every computer switched off. The contractor says some of the lines will turn out to be wrong, and that the scan could only see the machines from the outside. Neither can say how exposed the agency really is.
What has to happen to the 214 lines before anyone can answer the owner's question?
A survey of known weaknesses
A vulnerability assessment is a systematic search for known weaknesses in systems. It ranks what it finds and does not exploit it. It works like a house survey. The surveyor lists the cracked tile and the window lock that does not catch. The surveyor does not break in to prove the point.
Most of the work is done by a vulnerability scanner: a program that inspects systems and compares what it finds with a database of known weaknesses. A scanner can check hundreds of machines overnight and repeat the work every week. It can only find weaknesses that are already in its database, so the database is updated before each scan.
A scan must be authorised by the owner of the systems, like any other test. It sends a great deal of traffic and can slow or crash a fragile system. To the people watching the network, an unannounced scan looks the same as the start of an attack.
First find what is there: discovery scans
The first step is a discovery scan, which finds the machines on a network and the services each one offers. A service listens on a numbered port, and the scanner tries the ports in turn. The simplest discovery is a , which asks every address to reply and so learns which machines are switched on.
Most services use the , in which a connection opens with three messages. The caller sends SYN, the service answers SYN-ACK, and the caller replies ACK. These names are flags: single switches in the header of a TCP message. Scan types differ in the flags they send.
| Scan | What the scanner sends | What it is used for |
|---|---|---|
| TCP SYN, or half-open | SYN only. It reads the reply and never completes the connection | The usual quick scan for open ports |
| TCP connect | The full three-message opening | Used when the scanner lacks the rights to send a bare SYN |
| TCP ACK | ACK alone, belonging to no connection | Shows whether a filters a port. It cannot show that a port is open |
| UDP | A message in the , which has no opening exchange | Finds services that use UDP. Slower and less certain |
| Xmas | A message with the FIN, PSH and URG flags all set, which no normal connection sends | An unusual probe that standard TCP software answers only from closed ports |
| State | What the scanner saw | What it means |
|---|---|---|
| Open | A service answered | Something is listening and can be reached from where the scanner sits |
| Closed | The machine answered that nothing is listening | The port can be reached and no service is there |
| Filtered | No usable answer, because a filter such as a firewall blocked the probe | The scanner cannot tell whether a service is listening |
Common misconception
“A filtered port is a safe port, and an open port is a vulnerable one.”
Filtered describes the path from where the scanner sits. A service may be listening behind the filter and open to every machine inside. Open means only that there is a service to assess. Whether it is vulnerable is the next question.
Three kinds of vulnerability scan, with or without an account
Once the scanner knows what is there, it looks for weaknesses.
| Scan | What it examines | Typical findings |
|---|---|---|
| Network vulnerability scan | Each service found on each machine: the software, its version and its settings | Missing security updates, out-of-date software, weak settings |
| Web application scan | A website's pages and forms, by visiting each one and submitting test input | Flaws in the site's own code, such as obeying commands typed into a form |
| Database scan | Database software and its configuration | Default passwords, excessive permissions, missing updates |
A scan can be run with or without an account on the target. In an unauthenticated scan the scanner sees only what any machine on the network could see. It often has to guess the software version from the way a service answers. This is the outside attacker's view.
In an authenticated scan, also called a , the scanner is given an account. It signs in to each machine and reads the installed software and settings directly. It finds far more and guesses far less.
The two views complement each other, as do scans from outside and from inside the network. The lettings agency's scan was unauthenticated and external, so it saw the least.
A scan result is a candidate, not a fact
A scanner makes two kinds of mistake. A false positive is a weakness reported that is not there, often because the scanner judged by a version number and the fix had already been applied. A false negative is a real weakness the scanner missed, because it is too new for the database or lies where the scanner could not see.
- Validate. Check each important finding on the system itself, and remove the false positives.
- Rate. Judge each confirmed weakness by the harm it could do to this organisation. The scanner's severity rating is only a starting point, because the scanner does not know what the machine is used for.
- Report to the owners of the systems, who decide what is fixed and when.
- Remediate, starting with the highest .
- Scan again to confirm that each fix worked.
A has three limits. It finds only known weaknesses. It describes one moment, and new weaknesses are published every day. It also lists weaknesses without showing what an attacker could do with them. Showing that is the job of a .
A question, worked through
A retailer scans its 60 servers every month from outside its network, without accounts on the servers. The reports have shown fewer than ten findings for a year. An internal audit then signs in to five servers chosen at random and finds that four are missing security updates released months ago. The chief information security officer asks what should change.
Which change would BEST improve what the monthly scans find?
Decide on your answer, then open the reasoning
- The scans report little, yet the servers are missing updates. The question is why the scanner cannot see what an auditor found by signing in.
- Rule out d: showing only critical findings hides more and finds nothing new.
- Rule out b: SYN and connect scans both discover open ports. Neither reads what is installed on a server.
- Between a and c: a penetration test would probably find the missing updates, but once a year and on a sample. The fault lies in the monthly control. An authenticated scan signs in to every server and reads its installed software, which is what the audit did by hand.
Answer: A. Add authenticated scans run from inside the network
Choosing between good answers
- A question contrasts scan results with what is really on the systems
- look for credentials. An authenticated scan reads the system from inside. An unauthenticated scan guesses from outside.
- A question asks what to do with scanner output before reporting it
- validate it first. Unconfirmed findings include false positives.
- A question asks which activity lists known weaknesses without exploiting them
- choose vulnerability assessment. Exploiting them belongs to a penetration test.
- A port is reported as filtered
- treat it as unknown, not as safe. A filter blocked the probe from where the scanner sat.
Try it
Read a port scan of one server line by line, then move the scanner inside the network and see which answers change.
Loading the preview.
Check your understanding
5 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 5
What to remember
- A vulnerability assessment finds and ranks known weaknesses without exploiting them, mostly with an automated scanner, and only with the owner's authority.
- Discovery scans find machines and ports. SYN is the quick half-open scan, connect completes the connection, ACK maps a firewall, UDP finds UDP services, and Xmas sets FIN, PSH and URG.
- A port is reported as open, closed or filtered. Filtered means a filter blocked the probe, so the state is unknown.
- Network, web application and database scans look for weaknesses. An authenticated scan signs in and sees far more than an unauthenticated one.
- A false positive is reported and not there. A false negative is there and not reported. Findings are validated and rated by risk before they are reported.
Say it from memory
What is a vulnerability assessment, and what must be done with a scanner's results before they are reported?
A systematic, mostly automated search for known weaknesses, which ranks them and does not exploit them. Discovery scans find machines and open ports. Network, web application or database scans then look for weaknesses, with or without credentials. Results are validated to remove false positives and rated by risk to the organisation before they go to the system owners.
What do a TCP SYN scan and a TCP ACK scan each show, and what do open, closed and filtered mean?
A SYN, or half-open, scan sends SYN only and is the usual quick scan for open ports. An ACK scan shows whether a firewall filters a port, not whether it is open. Open: a service answered. Closed: the machine answered that nothing is listening. Filtered: a filter blocked the probe, so the scanner cannot tell.
Name the three kinds of vulnerability scan, what each examines and a typical finding of each.
A network vulnerability scan examines each service on each machine, finding missing security updates and weak settings. A web application scan visits a site's pages and forms with test input, finding flaws in the site's own code. A database scan examines database software and configuration, finding default passwords and excessive permissions.
What is the difference between a false positive and a false negative in a scan, and what are the three limits of a vulnerability assessment?
A false positive is a reported weakness that is not there. A false negative is a real weakness the scanner missed. A vulnerability assessment finds only known weaknesses, describes one moment, and does not show what an attacker could do with what it lists.
Sources
- NIST SP 800-115: Technical Guide to Information Security Testing and Assessment, NISTVulnerability scanning with and without host credentials, from inside and outside the network; false positives and false negatives; updating the scanner's database before a scan; assessors setting their own risk level for each finding.
- SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations, NISTVulnerability monitoring and scanning at a defined frequency, analysis of scan reports, remediation of legitimate vulnerabilities by risk, and privileged access for more thorough scanning.
- Nmap Reference Guide: Port Scanning Techniques, Nmap Project (Gordon Lyon)The SYN, connect, ACK, UDP and Xmas scans: what each sends and what each can determine.
- Nmap Reference Guide: Port Scanning Basics, Nmap Project (Gordon Lyon)The open, closed and filtered port states and what each means.
- CISSP Student Glossary, ISC2Ping scanning as a way of learning which addresses have a machine that answers.