Agentless vulnerability scanning: how it works

Agentless vulnerability scanning finds missing updates over SSH or WinRM with nothing installed on the server: how it works, agent vs agentless, and setup.

Agentless vulnerability scanning checks a server for missing security updates without installing anything on it. The scanner logs in with an account you give it, over SSH on Linux or WinRM on Windows, reads the installed packages and updates, and compares them with the vendor's security data. When the scan ends, nothing new keeps running on the server.

This guide explains how agentless vulnerability scanning works, how it differs from an agent, and how to prepare and test the logins before your first scan.

How agentless vulnerability scanning works

An agentless scan has three steps:

  1. Log in. The scanner opens a session to the server with a login you provide: an SSH key or password on Linux, a WinRM account on Windows.
  2. Read. It runs read-only queries to list what is installed: the package database on Linux (dpkg-query, rpm -qa), installed updates and applications on Windows.
  3. Compare. It matches each installed version with the fixed versions in the vendor's advisories (Canonical, Debian, Red Hat, Microsoft and others) and lists the updates that are missing and the CVEs they fix.

Because the scanner reads what is really installed, this is a credentialed scan. If the term is new, read what a credentialed vulnerability scan is first.

Agent vs agentless vulnerability scanning

The difference is where the collecting program lives, not how good the result is. Both read the same package data from the host.

Agent basedAgentless
What runs on the serverA resident program on every host, installed once and kept runningNothing resident; a session exists only while the scan runs
What you maintainInstalling and updating the agent on every hostOne scan account per server or per domain, and its credentials
What the network needsThe agent reaches its management serverThe scanner reaches the server: SSH (port 22 by default) or WinRM (5985 for HTTP, 5986 for HTTPS)
Hosts that leave the networkThe agent can collect while the host is awayOnly scanned when the scanner can reach them
A new serverCovered once the agent is installedCovered once it has a login and is in the target list

Agent based or agentless: which to choose

Agentless suits servers: they sit at a fixed address, stay on the network, and an administrator already logs in to them over SSH or WinRM. You add no software to production machines and have nothing extra to patch. An agent suits machines the scanner cannot reach on a schedule, such as laptops that travel. The two can also be combined: agentless for servers, agents for endpoints.

Prepare the scan account on Linux

Create a dedicated account for scanning, give it an SSH key, and check what it can read. Run these from the computer that will run the scans.

# copy the public key of the scan account to the server
ssh-copy-id -i ~/.ssh/scan_ed25519.pub scanner@server01

# the login must work with no prompt at all
ssh -i ~/.ssh/scan_ed25519 -o BatchMode=yes scanner@server01 'id'

# which commands may this account run with sudo, without a password?
ssh -i ~/.ssh/scan_ed25519 scanner@server01 'sudo -n -l'

# can it read the package database?
ssh -i ~/.ssh/scan_ed25519 scanner@server01 'dpkg-query -W | head -5'   # Debian, Ubuntu
ssh -i ~/.ssh/scan_ed25519 scanner@server01 'rpm -qa | head -5'         # RHEL, Rocky, AlmaLinux, SUSE, Amazon Linux

What each line checks:

  • ssh-copy-id installs the key in the account's authorized_keys.
  • BatchMode=yes turns off password prompts and host key questions, so a login that would hang in a scheduled scan fails here instead.
  • sudo -n -l lists the account's sudo rights and exits with an error instead of asking for a password.
  • dpkg-query -W prints each installed package and its version; rpm -qa does the same on RPM systems.

Some scanners need root for part of the evidence. If yours does, allow passwordless sudo only for the read commands it documents, with a command list in sudoers, rather than full root.

Prepare WinRM on Windows Server

PowerShell remoting is enabled by default on Windows Server; on other Windows versions Enable-PSRemoting turns it on. Test from the scanning computer:

# is the WinRM service answering?
Test-WSMan -ComputerName server01

# can the scan account log in and read installed updates?
Invoke-Command -ComputerName server01 -Credential (Get-Credential) -ScriptBlock {
    Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5
}

Test-WSMan checks that the WinRM service is running on the server. Invoke-Command runs Get-HotFix over that session, which lists the installed updates. If both work, an agentless scanner can use the same account.

A failed login is not a clean server

The weak point of agentless vulnerability scanning is the login. When it fails, the scanner has read nothing. A report that then shows zero findings for that server is wrong, because the server was never checked.

Before you trust a result, look for:

  • servers with a login error or a timeout,
  • servers where sudo was refused, so part of the evidence is missing,
  • operating system releases your scanner does not support.

Openness, a new open source scanner by S4E.io, reports a server it cannot read, or a release it does not support, as "not checked", never as clean. The releases it reads are on the supported systems page.

What to do now

  1. Pick five servers and run the checks above against each one.
  2. Fix every login that prompts, hangs or is refused before you schedule scans.
  3. Keep the scan account separate from personal accounts, so you can rotate or remove it on its own.
  4. Run a first scan and compare the server list in the report with your inventory. Every server should appear, checked or marked as not checked.

To run the whole check for many servers at once, Openness logs in over SSH or WinRM, only reads and never changes the host, and lists each missing update with the CVEs it fixes. The first scan guide shows how to add targets and logins, and the free plan covers 20 servers in 90 days, commercial use included. Download Openness.

FAQ

What is agentless vulnerability scanning?

It is a vulnerability scan that installs no software on the scanned server. The scanner logs in remotely with an account you provide, reads the installed packages and updates, and compares them with the vendor's security advisories.

Is agentless scanning the same as an uncredentialed scan?

No. An uncredentialed scan only sees the server from the network: open ports and the banners services show. An agentless credentialed scan logs in and reads the installed versions, so it finds missing updates that the network cannot show.

Does agentless vulnerability scanning work on Linux and Windows?

Yes. Linux servers are read over SSH and Windows servers over WinRM. Coverage depends on the scanner: check which distributions and Windows versions it supports, and whether it reports unsupported ones as not checked.

Does an agentless scan change the server?

It should not. A scanner built for this runs only read commands, such as the package queries above. Ask your scanner's documentation which commands it runs, and give the scan account no more rights than those need.

This post was written by an AI model (claude-opus-5-5) and published by S4E.io. Found a mistake? Tell us.

All posts · This page as Markdown

Star on GitHub