SECURITY ENGINEERING · PART 5 · ETHICAL HACKING, STEP BY STEP · SCANNING · 63 OF 229

Vulnerability Scanning With Nuclei and OpenVAS

A vulnerability scanner checks systems against thousands of known weaknesses automatically. This episode explains how scanners decide something is vulnerable, the difference between unauthenticated and credentialed scans, OpenVAS (Greenbone) for networks and Nuclei for template-based web checks, how to read results and remove false positives, the limits of scanning, and how security teams run it continuously.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 14

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Automated checks for known weaknesses
  • credentialed scans are more accurate
  • verify everything
  • a clean scan is not proof

Notes

How a scanner decides

How does a scanner decide? Three main ways. A version match: the banner reports a version and the database says that version is affected. This is the least reliable, because Linux distributions often fix a flaw without changing the version number. A behaviour check: send a harmless request and look for a response only a vulnerable system gives. A configuration check: a default password works, or directory listing is on. And the most accurate: log in and read the installed packages.

Detection methods
  • version match: banner says 2.4.18, feed says 2.4.18 is affected (many false positives: backported fixes)
  • behaviour check: send a safe request, look for a telltale response (better)
  • configuration check: default login works, listing is on local check with credentials: read installed packages

Two viewpoints

There are two viewpoints. An unauthenticated scan sees what anyone on the network sees. It shows your real exposure, but it guesses a lot. A credentialed scan logs in, over SSH or Windows remote management, or uses an agent on the machine, and reads the installed packages, patches and configuration. It finds far more and is wrong far less often. Security teams run both: the outside view for exposure, and the inside view for the true patch status.

Unauthenticated vs credentialed
  • unauthenticated: what any network user can see fewer findings, more guessing
  • credentialed (SSH, WinRM, agent): reads packages, patches, config many more findings, far fewer false positives
  • run both: exposure and full patch status

OpenVAS

OpenVAS, maintained by Greenbone, is the open-source network vulnerability scanner. It has a web interface and a feed of well over a hundred thousand tests, updated daily. You define targets, a port list, credentials, a scan configuration and a schedule. Results show severity, the related CVE and a quality of detection score, which tells you how reliable that check is. The commercial equivalents you will meet at work are Nessus, Qualys and Rapid seven.

OpenVAS / Greenbone
  • a full scanner with a web interface (community edition)
  • a feed of 100,000+ tests, updated daily
  • you define: targets, port list, credentials, scan config, schedule
  • results: severity, CVE, a "quality of detection" score
  • commercial peers: Nessus, Qualys, Rapid7

Nuclei

Nuclei, from ProjectDiscovery, takes a different approach. Every check is a small text template that describes a request and what a vulnerable response looks like. The community maintains thousands of them, and new ones often appear within a day of a vulnerability becoming public. You point it at a list of hosts, choose severities or tags, and set a rate limit. It is fast, and because templates are readable, you can see exactly what was tested and why something matched.

nuclei basics
nuclei -update-templates
nuclei -l live-hosts.txt \
  -severity medium,high,critical \
  -rate-limit 50 -o findings.txt

# pick by tag instead:
nuclei -u https://staging.example.test \
  -tags exposure,misconfig

# each check is one YAML file

Inside a template

Here is what a template looks like, using a harmless example. It has an identifier, a name and a severity. Then a request: get the git config file from the web root. Then a matcher: if the response contains the word core in square brackets, the file is exposed. That is the whole check. Writing your own templates is a valuable skill for a security engineer, because you can encode a problem found once and test every host for it, forever.

a simple exposure template
id: exposed-git-config
info:
  name: Exposed .git/config
  severity: medium
http:
  - method: GET
    path: ["{{BaseURL}}/.git/config"]
    matchers:
      - type: word
        words: ["[core]"]
# asks for one file; reports if found

Read the results

Now the important skill. A scanner result is a claim, not a fact. First, check how it was detected: by version, or by behaviour. Reproduce it by hand with a simple request or the vendor's documentation. Ask whether the affected feature is even enabled. Ask whether an attacker can reach the host. Then rate it in your own context. If it is a false positive, record why, so it stays closed and nobody investigates it again next week.

Triage steps
  1. how was it detected: version or behaviour?
  2. reproduce it by hand (curl, the product docs)
  3. is the affected feature actually enabled?
  4. is the host reachable by an attacker?
  5. rate it in context
  6. false positive: record why, so it stays closed

False results

Scanners are wrong in both directions. False positives are reported but not real: a patched package with an old version number, a site that returns a success page for every address, a web firewall answering in place of the application. False negatives are real but not reported, and they are more dangerous: business logic flaws, broken access control, anything in custom code, anything behind a login the scanner did not have. A clean scan does not mean a secure system.

Two kinds of error
  • false positive: reported, not real backported patches, a generic 200 page, a WAF answering for the app
  • false negative: real, not reported logic flaws, access control, custom code, anything behind a login
  • "clean scan" is not "secure"

Scan safely

Scanning has operational risks. Rate-limit and scan outside peak hours. Use safe checks and disable denial-of-service tests. Exclude fragile devices such as printers, industrial equipment and old appliances. Be careful with web forms and APIs, where a scanner can create thousands of records or trigger emails. Tell the operations centre your source address. And protect the scanner's credentials carefully: an account that can log in to every server is a prize for an attacker.

Operational care
  • rate-limit; scan off-peak
  • use safe checks; disable denial-of-service tests
  • exclude fragile devices: printers, OT, old appliances
  • forms and APIs: a scanner can submit thousands of records or send emails
  • tell the SOC your source IP
  • protect scanner credentials: they are very powerful

Scanning as a programme

Inside a company, scanning is a continuous programme. External scans run daily and internal ones weekly, with agents on servers and laptops. The same idea extends to container images, software dependencies and cloud configuration, which later parts cover. Findings become tickets with an owner and a due date. The team tracks time to fix by severity. And when a new critical vulnerability is announced, you can check your entire estate for it the same day.

The blue-team version
  • scheduled: weekly internal, daily external
  • agents on servers and laptops
  • also scan: container images, dependencies, cloud config
  • findings become tickets with an owner and a due date
  • track: time to fix, by severity
  • new critical CVE: scan for it the same day

Scanner vs pentester

Know the limits. Scanners are good at known vulnerabilities, missing patches, default configuration, exposed files and weak TLS. They miss attacks that chain several small issues, flaws in business logic, authorisation errors such as one user reading another's data, and new techniques. A penetration test starts where the scanner stops. Organisations need both: scanning every week, and human testing yearly or after major changes.

Limits of scanning
  • finds: known CVEs, missing patches, default config, exposed files, weak TLS
  • misses: chained attacks, logic flaws, authorisation errors, new techniques
  • a pentest starts where the scanner stops
  • do both; scan weekly, test yearly or on big changes

Common mistakes

Mistakes. Forwarding a raw four hundred page report to developers, who will rightly ignore it. Never verifying findings. Running only unauthenticated scans. Sorting by score alone instead of real risk. Scanning a known subset while unknown assets are never scanned. No owner for findings. Scanning without permission, which is still unauthorised testing. And closing tickets without a rescan to confirm the fix.

Avoid these
  • forwarding a raw 400-page report to developers
  • never verifying findings
  • unauthenticated scans only
  • sorting by CVSS alone
  • scanning a subset; unknown assets never scanned
  • no owner for findings
  • scanning without permission
  • closing tickets without a rescan

Say it like this

In the interview: I treat scan results as leads, not facts. I check how each was detected, verify the important ones by hand, and record false positives with a reason. I rank by real risk: is the host exposed, is there a known exploit, how important is the asset, not by score alone. Then findings become tickets with owners and deadlines, and a rescan confirms the fix. I run credentialed scans as well, because they are far more accurate.

In the interview
  • "I treat them as leads. I
  • check the detection method, verify by hand, drop false
  • positives with a reason, and rank by exposure, exploit
  • availability and asset value, not CVSS alone. Then tickets
  • with owners and deadlines, and a rescan to confirm."

Interview questions

Q1What is vulnerability scanning?

The automated process of checking systems, networks and applications against a database of known vulnerabilities and misconfigurations. It produces a list of potential weaknesses that must be verified and prioritised.

Q2What is the difference between authenticated and unauthenticated scans?

An unauthenticated scan tests from the network without credentials and shows what an outside attacker could observe. An authenticated (credentialed) scan logs in or uses an agent to inspect installed software and configuration, giving more complete and more accurate results.

Q3What is Nuclei?

An open-source, template-based vulnerability scanner from ProjectDiscovery. Each check is a YAML template describing requests and matchers. It is fast, extensible, widely used for web and API exposure checks, and supported by a large community template library.

Q4What is OpenVAS?

An open-source network vulnerability scanner maintained by Greenbone. It uses a regularly updated feed of vulnerability tests, supports credentialed scanning and scheduling, and provides reports with severity ratings and remediation information.

Q5What is a false positive in vulnerability scanning?

A finding reported by the scanner that does not actually exist, commonly caused by version-based detection where a vendor has backported a fix, by generic server responses, or by security devices altering responses.

Q6Can vulnerability scanners find all vulnerabilities?

No. They detect known issues with signatures. They generally miss business logic flaws, access control errors, vulnerabilities in custom code, issues requiring multiple steps and newly discovered weaknesses without checks. Manual testing and code review cover those gaps.

Q7How often should vulnerability scans be run?

Continuously or at least weekly for internal systems, daily for internet-facing assets, and immediately when a significant new vulnerability is disclosed. Compliance standards such as PCI DSS require at least quarterly scans.

Q8Is vulnerability scanning safe for production?

Usually, with care: use safe checks, rate limits and maintenance windows, exclude fragile devices, and be cautious with forms and APIs that create data. Some systems, especially industrial and legacy devices, can be disrupted by scanning.