Getting started

Pick the playbook that matches you. Each one ends with a daily check and a dated report you can keep as evidence. Nothing is installed on your servers, and we never store inventories, results or IP addresses.

10 min
One server

A single Linux or Windows server. Ten minutes, nothing to install.

1 hour
Several servers

Your own company's servers, checked daily, with one fleet report.

Half a day
MSP with clients

Many clients' servers, one report per client with your name on it.

15 min
Container images

Check images in CI or everything running in Kubernetes. Nothing to install.

Before you start (everyone)

  1. Sign up with your work email and click the link we send. This email is printed on every report, so use the one you want auditors and clients to see.
  2. In the dashboard, create an API key and copy it (it's shown once). Store it like a password.

Supported today: Ubuntu, Debian, RHEL, AlmaLinux, Rocky Linux, Windows Server 2016–2025, Windows 10 and Windows 11.

Playbook 1: one server

For: a single server, or trying CVEfocus out. You get: the CVEs that apply, what to do first, and a dated report each day.

1. Run your first check

Linux (as any user; as root, after sudo -i, it also shows each item's exposure: whether a program listening on the network has the vulnerable code loaded):

export CVEFOCUS_KEY=cvf_live_…
{ cat /etc/os-release; uname -r; [ -r /etc/machine-id ] && printf 'CVEFOCUS_SYSTEM=%s\n' "$(printf 'cvefocus:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-32)"; if command -v dpkg-query >/dev/null; then dpkg-query -W -f='${Package} ${Version} ${Architecture} ${source:Package} ${Priority} ${Section}\n'; else rpm -qa --qf '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE} %{ARCH} %{SOURCERPM} %{MODULARITYLABEL}\n'; fi; for f in /opt/*/release /opt/*/*/release /usr/local/*/release /usr/java/*/release /usr/lib/jvm/*/release; do [ -f "$f" ] && awk -F'"' -v d="${f%/release}" '/^JAVA_VERSION=/{v=$2} /^IMPLEMENTOR=/{i=$2} END{if(v!="")print "CVEFOCUS_JDK=" v, d, i}' "$f"; done 2>/dev/null; echo "CVEFOCUS_UID=$(id -u)"; S=$(for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; awk -v u="$(grep -o '[^/]*\.service' $p/cgroup 2>/dev/null | tail -n1)" -v c="$(tr ' ' _ 2>/dev/null < $p/comm)" '$NF=="(deleted)" && $6 ~ /^\/(usr\/)?(lib|lib64|bin|sbin|libexec)\// {print (u==""?"-":u), c, $6}' $p/maps 2>/dev/null; done | sort -u); printf '%s\n' "$S" | sed '/^$/d; s/^/CVEFOCUS_STALE=/'; printf '%s\n' "$S" | awk 'NF{print $3}' | sort -u | while read f; do o=$( (dpkg -S "$f" || rpm -qf --qf '%{NAME}\n' "$f") 2>/dev/null | head -n1 | cut -d: -f1); echo "CVEFOCUS_OWNER=${o:-?} $f"; done; echo CVEFOCUS_EXPOSURE=host; T=$(mktemp -d); for f in /proc/net/tcp /proc/net/tcp6 /proc/net/udp /proc/net/udp6; do awk -v f="$f" 'function hx(s,i,r){for(i=1;i<=length(s);i++)r=r*16+index("0123456789ABCDEF",substr(s,i,1))-1;return r} NR>1 && (($4=="0A" && f~/tcp/) || ($4=="07" && f~/udp/ && $3~/^0+:0000$/)) {split($2,a,":"); c=(a[1]~/^0+$/)?"any":(a[1]~/7F$/ || a[1]=="00000000000000000000000001000000")?"lo":"ip"; print "L", $10, (f~/tcp/?"tcp":"udp"), c, hx(a[2])}' $f 2>/dev/null; done > $T/s; for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; q=${p#/proc/}; c=$(tr ' ' _ 2>/dev/null < $p/comm) || continue; ls -l $p/fd 2>/dev/null | sed -n "s/.*socket:\[\([0-9]*\)\].*/S $q \1/p"; { readlink $p/exe; awk '$6 ~ /^\// {print $6}' $p/maps; } 2>/dev/null | sed "s|^|F $q $c |"; done | sort -u > $T/p; { if [ -d /var/lib/dpkg/info ]; then awk 'FNR==1{p=FILENAME; sub(/.*\//,"",p); sub(/\.list$/,"",p); sub(/:.*/,"",p)} {print "P", $0, p}' /var/lib/dpkg/info/*.list; else rpm -qa --qf '[P %{FILENAMES} %{NAME}\n]'; fi; cat $T/s $T/p; } 2>/dev/null | awk 'function k(x){return (x~/^\/usr\/(lib|lib64|bin|sbin)\//)?substr(x,5):x} $1=="P"{o[k($2)]=$3; next} $1=="L"{s[$2]=$3" "$4" "$5; next} $1=="S"{if($3 in s){split(s[$3],z," "); l=(z[2]=="lo")?2:3; if(l>v[$2])v[$2]=l; w[$2]=w[$2] (w[$2]==""?"":",") z[3] "/" z[1] (z[2]=="lo"?"@lo":"")}; next} $1=="F"{m[$2]=$3; if(k($4) in o) u[o[k($4)] SUBSEP $2]=1} END{split("running local network",n," "); for(x in u){split(x,y,SUBSEP); l=v[y[2]]; if(l<1)l=1; if(l>b[y[1]]){b[y[1]]=l; d[y[1]]=m[y[2]] (w[y[2]]==""?"":":" w[y[2]])}} for(x in b) print "CVEFOCUS_USE=" x, n[b[x]], d[x]}' | sort; rm -rf $T; } \
  | curl -sS "https://api.cvefocus.com/v1/check?format=text" \
      -H "Authorization: Bearer $CVEFOCUS_KEY" \
      -H "Content-Type: text/plain" --data-binary @-

Windows (PowerShell):

$env:CVEFOCUS_KEY = "cvf_live_…"
$cv = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$arch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
$sid = -join ([Security.Cryptography.SHA256]::Create().ComputeHash([Text.Encoding]::UTF8.GetBytes("cvefocus:" + (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Cryptography').MachineGuid)) | ForEach-Object { $_.ToString('x2') })
$inventory = @("ID=windows", "PRETTY_NAME=$((Get-CimInstance Win32_OperatingSystem).Caption)", "VERSION_ID=$($cv.DisplayVersion)",
  "WINDOWS_BUILD=10.0.$($cv.CurrentBuildNumber).$($cv.UBR)", "WINDOWS_ARCH=$arch",
  "WINDOWS_INSTALLATION_TYPE=$($cv.InstallationType)", "CVEFOCUS_SYSTEM=$($sid.Substring(0, 32))",
  "WINDOWS_PENDING_REBOOT=$((Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') -or (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending'))") -join "`n"
Invoke-RestMethod -Method Post -Uri "https://api.cvefocus.com/v1/check?format=text" -ContentType "text/plain" -Body $inventory `
  -Headers @{ Authorization = "Bearer $env:CVEFOCUS_KEY" }

2. Do what it says, top first

The result starts with What to do: one action per problem, most urgent first. Act now means the CVE is being exploited in the wild (CISA KEV) or is likely to be soon (EPSS). Items tagged Network-facing are loaded by a program listening on the network (the port is named): do those first within each priority. On Windows this is usually one item: install the latest cumulative update and restart. Run the check again afterwards; resolved items disappear.

3. Check daily, keep the reports

Windows: in an administrator PowerShell, this saves the key where only SYSTEM and administrators can read it, and adds a daily task that saves a dated report to C:\ProgramData\CVEfocus\reports:

New-Item -ItemType Directory -Force C:\ProgramData\CVEfocus\reports | Out-Null
Set-Content C:\ProgramData\CVEfocus\key.txt "cvf_live_YOUR_KEY"
icacls C:\ProgramData\CVEfocus\key.txt /inheritance:r /grant:r "SYSTEM:R" "Administrators:R" | Out-Null
@'
$key = (Get-Content C:\ProgramData\CVEfocus\key.txt -Raw).Trim()
$cv = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$arch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
$sid = -join ([Security.Cryptography.SHA256]::Create().ComputeHash([Text.Encoding]::UTF8.GetBytes("cvefocus:" + (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Cryptography').MachineGuid)) | ForEach-Object { $_.ToString('x2') })
$inventory = @("ID=windows", "PRETTY_NAME=$((Get-CimInstance Win32_OperatingSystem).Caption)", "VERSION_ID=$($cv.DisplayVersion)",
  "WINDOWS_BUILD=10.0.$($cv.CurrentBuildNumber).$($cv.UBR)", "WINDOWS_ARCH=$arch",
  "WINDOWS_INSTALLATION_TYPE=$($cv.InstallationType)", "CVEFOCUS_SYSTEM=$($sid.Substring(0, 32))",
  "WINDOWS_PENDING_REBOOT=$((Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') -or (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending'))") -join "`n"
Invoke-WebRequest -UseBasicParsing -Method Post -Uri "https://api.cvefocus.com/v1/check?format=report" -ContentType "text/plain" `
  -Body $inventory -Headers @{ Authorization = "Bearer $key" } `
  -OutFile "C:\ProgramData\CVEfocus\reports\report-$(Get-Date -Format yyyy-MM-dd).html"
'@ | Set-Content C:\ProgramData\CVEfocus\check.ps1
$action = New-ScheduledTaskAction -Execute powershell.exe `
  -Argument "-NoProfile -ExecutionPolicy Bypass -File C:\ProgramData\CVEfocus\check.ps1"
Register-ScheduledTask -TaskName "CVEfocus daily check" -Action $action `
  -Trigger (New-ScheduledTaskTrigger -Daily -At 6:15am) -User SYSTEM -RunLevel Highest

Linux: save this as /usr/local/bin/cvefocus-check, then install the key and the daily schedule:

#!/bin/sh
# /usr/local/bin/cvefocus-check — writes the latest result to /var/tmp/cvefocus.json
{ cat /etc/os-release; uname -r; [ -r /etc/machine-id ] && printf 'CVEFOCUS_SYSTEM=%s\n' "$(printf 'cvefocus:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-32)"; if command -v dpkg-query >/dev/null; then dpkg-query -W -f='${Package} ${Version} ${Architecture} ${source:Package} ${Priority} ${Section}\n'; else rpm -qa --qf '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE} %{ARCH} %{SOURCERPM} %{MODULARITYLABEL}\n'; fi; for f in /opt/*/release /opt/*/*/release /usr/local/*/release /usr/java/*/release /usr/lib/jvm/*/release; do [ -f "$f" ] && awk -F'"' -v d="${f%/release}" '/^JAVA_VERSION=/{v=$2} /^IMPLEMENTOR=/{i=$2} END{if(v!="")print "CVEFOCUS_JDK=" v, d, i}' "$f"; done 2>/dev/null; echo "CVEFOCUS_UID=$(id -u)"; S=$(for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; awk -v u="$(grep -o '[^/]*\.service' $p/cgroup 2>/dev/null | tail -n1)" -v c="$(tr ' ' _ 2>/dev/null < $p/comm)" '$NF=="(deleted)" && $6 ~ /^\/(usr\/)?(lib|lib64|bin|sbin|libexec)\// {print (u==""?"-":u), c, $6}' $p/maps 2>/dev/null; done | sort -u); printf '%s\n' "$S" | sed '/^$/d; s/^/CVEFOCUS_STALE=/'; printf '%s\n' "$S" | awk 'NF{print $3}' | sort -u | while read f; do o=$( (dpkg -S "$f" || rpm -qf --qf '%{NAME}\n' "$f") 2>/dev/null | head -n1 | cut -d: -f1); echo "CVEFOCUS_OWNER=${o:-?} $f"; done; echo CVEFOCUS_EXPOSURE=host; T=$(mktemp -d); for f in /proc/net/tcp /proc/net/tcp6 /proc/net/udp /proc/net/udp6; do awk -v f="$f" 'function hx(s,i,r){for(i=1;i<=length(s);i++)r=r*16+index("0123456789ABCDEF",substr(s,i,1))-1;return r} NR>1 && (($4=="0A" && f~/tcp/) || ($4=="07" && f~/udp/ && $3~/^0+:0000$/)) {split($2,a,":"); c=(a[1]~/^0+$/)?"any":(a[1]~/7F$/ || a[1]=="00000000000000000000000001000000")?"lo":"ip"; print "L", $10, (f~/tcp/?"tcp":"udp"), c, hx(a[2])}' $f 2>/dev/null; done > $T/s; for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; q=${p#/proc/}; c=$(tr ' ' _ 2>/dev/null < $p/comm) || continue; ls -l $p/fd 2>/dev/null | sed -n "s/.*socket:\[\([0-9]*\)\].*/S $q \1/p"; { readlink $p/exe; awk '$6 ~ /^\// {print $6}' $p/maps; } 2>/dev/null | sed "s|^|F $q $c |"; done | sort -u > $T/p; { if [ -d /var/lib/dpkg/info ]; then awk 'FNR==1{p=FILENAME; sub(/.*\//,"",p); sub(/\.list$/,"",p); sub(/:.*/,"",p)} {print "P", $0, p}' /var/lib/dpkg/info/*.list; else rpm -qa --qf '[P %{FILENAMES} %{NAME}\n]'; fi; cat $T/s $T/p; } 2>/dev/null | awk 'function k(x){return (x~/^\/usr\/(lib|lib64|bin|sbin)\//)?substr(x,5):x} $1=="P"{o[k($2)]=$3; next} $1=="L"{s[$2]=$3" "$4" "$5; next} $1=="S"{if($3 in s){split(s[$3],z," "); l=(z[2]=="lo")?2:3; if(l>v[$2])v[$2]=l; w[$2]=w[$2] (w[$2]==""?"":",") z[3] "/" z[1] (z[2]=="lo"?"@lo":"")}; next} $1=="F"{m[$2]=$3; if(k($4) in o) u[o[k($4)] SUBSEP $2]=1} END{split("running local network",n," "); for(x in u){split(x,y,SUBSEP); l=v[y[2]]; if(l<1)l=1; if(l>b[y[1]]){b[y[1]]=l; d[y[1]]=m[y[2]] (w[y[2]]==""?"":":" w[y[2]])}} for(x in b) print "CVEFOCUS_USE=" x, n[b[x]], d[x]}' | sort; rm -rf $T; } \
  | curl -sS --fail-with-body https://api.cvefocus.com/v1/check \
      -H "Authorization: Bearer $(cat /etc/cvefocus.key)" \
      -H "Content-Type: text/plain" --data-binary @- > /var/tmp/cvefocus.json
sudo chmod 755 /usr/local/bin/cvefocus-check
sudo sh -c 'umask 077; printf %s "cvf_live_YOUR_KEY" > /etc/cvefocus.key'
# Random delay up to 1 hour, so a fleet doesn't call all at once
echo '15 6 * * * root sleep $(shuf -i 0-3600 -n 1) && /usr/local/bin/cvefocus-check' | sudo tee /etc/cron.d/cvefocus

For a dated report to keep as evidence (for example once a month):

{ cat /etc/os-release; uname -r; [ -r /etc/machine-id ] && printf 'CVEFOCUS_SYSTEM=%s\n' "$(printf 'cvefocus:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-32)"; if command -v dpkg-query >/dev/null; then dpkg-query -W -f='${Package} ${Version} ${Architecture} ${source:Package} ${Priority} ${Section}\n'; else rpm -qa --qf '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE} %{ARCH} %{SOURCERPM} %{MODULARITYLABEL}\n'; fi; for f in /opt/*/release /opt/*/*/release /usr/local/*/release /usr/java/*/release /usr/lib/jvm/*/release; do [ -f "$f" ] && awk -F'"' -v d="${f%/release}" '/^JAVA_VERSION=/{v=$2} /^IMPLEMENTOR=/{i=$2} END{if(v!="")print "CVEFOCUS_JDK=" v, d, i}' "$f"; done 2>/dev/null; echo "CVEFOCUS_UID=$(id -u)"; S=$(for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; awk -v u="$(grep -o '[^/]*\.service' $p/cgroup 2>/dev/null | tail -n1)" -v c="$(tr ' ' _ 2>/dev/null < $p/comm)" '$NF=="(deleted)" && $6 ~ /^\/(usr\/)?(lib|lib64|bin|sbin|libexec)\// {print (u==""?"-":u), c, $6}' $p/maps 2>/dev/null; done | sort -u); printf '%s\n' "$S" | sed '/^$/d; s/^/CVEFOCUS_STALE=/'; printf '%s\n' "$S" | awk 'NF{print $3}' | sort -u | while read f; do o=$( (dpkg -S "$f" || rpm -qf --qf '%{NAME}\n' "$f") 2>/dev/null | head -n1 | cut -d: -f1); echo "CVEFOCUS_OWNER=${o:-?} $f"; done; echo CVEFOCUS_EXPOSURE=host; T=$(mktemp -d); for f in /proc/net/tcp /proc/net/tcp6 /proc/net/udp /proc/net/udp6; do awk -v f="$f" 'function hx(s,i,r){for(i=1;i<=length(s);i++)r=r*16+index("0123456789ABCDEF",substr(s,i,1))-1;return r} NR>1 && (($4=="0A" && f~/tcp/) || ($4=="07" && f~/udp/ && $3~/^0+:0000$/)) {split($2,a,":"); c=(a[1]~/^0+$/)?"any":(a[1]~/7F$/ || a[1]=="00000000000000000000000001000000")?"lo":"ip"; print "L", $10, (f~/tcp/?"tcp":"udp"), c, hx(a[2])}' $f 2>/dev/null; done > $T/s; for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; q=${p#/proc/}; c=$(tr ' ' _ 2>/dev/null < $p/comm) || continue; ls -l $p/fd 2>/dev/null | sed -n "s/.*socket:\[\([0-9]*\)\].*/S $q \1/p"; { readlink $p/exe; awk '$6 ~ /^\// {print $6}' $p/maps; } 2>/dev/null | sed "s|^|F $q $c |"; done | sort -u > $T/p; { if [ -d /var/lib/dpkg/info ]; then awk 'FNR==1{p=FILENAME; sub(/.*\//,"",p); sub(/\.list$/,"",p); sub(/:.*/,"",p)} {print "P", $0, p}' /var/lib/dpkg/info/*.list; else rpm -qa --qf '[P %{FILENAMES} %{NAME}\n]'; fi; cat $T/s $T/p; } 2>/dev/null | awk 'function k(x){return (x~/^\/usr\/(lib|lib64|bin|sbin)\//)?substr(x,5):x} $1=="P"{o[k($2)]=$3; next} $1=="L"{s[$2]=$3" "$4" "$5; next} $1=="S"{if($3 in s){split(s[$3],z," "); l=(z[2]=="lo")?2:3; if(l>v[$2])v[$2]=l; w[$2]=w[$2] (w[$2]==""?"":",") z[3] "/" z[1] (z[2]=="lo"?"@lo":"")}; next} $1=="F"{m[$2]=$3; if(k($4) in o) u[o[k($4)] SUBSEP $2]=1} END{split("running local network",n," "); for(x in u){split(x,y,SUBSEP); l=v[y[2]]; if(l<1)l=1; if(l>b[y[1]]){b[y[1]]=l; d[y[1]]=m[y[2]] (w[y[2]]==""?"":":" w[y[2]])}} for(x in b) print "CVEFOCUS_USE=" x, n[b[x]], d[x]}' | sort; rm -rf $T; } \
  | curl -sS --fail-with-body "https://api.cvefocus.com/v1/check?format=report" \
      -H "Authorization: Bearer $(sudo cat /etc/cvefocus.key)" \
      -H "Content-Type: text/plain" --data-binary @- > report-$(hostname -s)-$(date +%F).html

Open a report in a browser and use Print → Save as PDF.

Each month

Playbook 2: several servers in one company

For: an IT team with a handful to a few hundred servers. You get: one daily fleet report, what changed since yesterday, and the CVEs affecting the most servers.

Option A: each server checks itself (up to about 10 servers)

Repeat step 3 of Playbook 1 on every server, with the same API key. Each server keeps its own reports. Simple, but there's no combined view.

Option B: collect centrally, one fleet report (recommended)

  1. Pick a collector: any Linux or Windows machine with Python 3, plus a folder the servers can write to (a file share, or a folder on the collector reached over SSH).
  2. Each server writes its inventory daily to that folder as <server>.txt. Push it with whatever you already use: Group Policy, Intune, Ansible, cron or Task Scheduler.

    Windows (schedule it daily, for example at 06:00, as SYSTEM):

    $cv = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
    $arch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
    $sid = -join ([Security.Cryptography.SHA256]::Create().ComputeHash([Text.Encoding]::UTF8.GetBytes("cvefocus:" + (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Cryptography').MachineGuid)) | ForEach-Object { $_.ToString('x2') })
    @("ID=windows", "PRETTY_NAME=$((Get-CimInstance Win32_OperatingSystem).Caption)", "VERSION_ID=$($cv.DisplayVersion)",
      "WINDOWS_BUILD=10.0.$($cv.CurrentBuildNumber).$($cv.UBR)", "WINDOWS_ARCH=$arch",
      "WINDOWS_INSTALLATION_TYPE=$($cv.InstallationType)", "CVEFOCUS_SYSTEM=$($sid.Substring(0, 32))",
      "WINDOWS_PENDING_REBOOT=$((Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') -or (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending'))") | Set-Content -Encoding ascii "\\fileserver\cvefocus\inventories\$env:COMPUTERNAME.txt"

    Linux (daily from cron; uses an SSH key for a cvefocus user on the collector):

    { cat /etc/os-release; uname -r; [ -r /etc/machine-id ] && printf 'CVEFOCUS_SYSTEM=%s\n' "$(printf 'cvefocus:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-32)"; if command -v dpkg-query >/dev/null; then dpkg-query -W -f='${Package} ${Version} ${Architecture} ${source:Package} ${Priority} ${Section}\n'; else rpm -qa --qf '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE} %{ARCH} %{SOURCERPM} %{MODULARITYLABEL}\n'; fi; for f in /opt/*/release /opt/*/*/release /usr/local/*/release /usr/java/*/release /usr/lib/jvm/*/release; do [ -f "$f" ] && awk -F'"' -v d="${f%/release}" '/^JAVA_VERSION=/{v=$2} /^IMPLEMENTOR=/{i=$2} END{if(v!="")print "CVEFOCUS_JDK=" v, d, i}' "$f"; done 2>/dev/null; echo "CVEFOCUS_UID=$(id -u)"; S=$(for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; awk -v u="$(grep -o '[^/]*\.service' $p/cgroup 2>/dev/null | tail -n1)" -v c="$(tr ' ' _ 2>/dev/null < $p/comm)" '$NF=="(deleted)" && $6 ~ /^\/(usr\/)?(lib|lib64|bin|sbin|libexec)\// {print (u==""?"-":u), c, $6}' $p/maps 2>/dev/null; done | sort -u); printf '%s\n' "$S" | sed '/^$/d; s/^/CVEFOCUS_STALE=/'; printf '%s\n' "$S" | awk 'NF{print $3}' | sort -u | while read f; do o=$( (dpkg -S "$f" || rpm -qf --qf '%{NAME}\n' "$f") 2>/dev/null | head -n1 | cut -d: -f1); echo "CVEFOCUS_OWNER=${o:-?} $f"; done; echo CVEFOCUS_EXPOSURE=host; T=$(mktemp -d); for f in /proc/net/tcp /proc/net/tcp6 /proc/net/udp /proc/net/udp6; do awk -v f="$f" 'function hx(s,i,r){for(i=1;i<=length(s);i++)r=r*16+index("0123456789ABCDEF",substr(s,i,1))-1;return r} NR>1 && (($4=="0A" && f~/tcp/) || ($4=="07" && f~/udp/ && $3~/^0+:0000$/)) {split($2,a,":"); c=(a[1]~/^0+$/)?"any":(a[1]~/7F$/ || a[1]=="00000000000000000000000001000000")?"lo":"ip"; print "L", $10, (f~/tcp/?"tcp":"udp"), c, hx(a[2])}' $f 2>/dev/null; done > $T/s; for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; q=${p#/proc/}; c=$(tr ' ' _ 2>/dev/null < $p/comm) || continue; ls -l $p/fd 2>/dev/null | sed -n "s/.*socket:\[\([0-9]*\)\].*/S $q \1/p"; { readlink $p/exe; awk '$6 ~ /^\// {print $6}' $p/maps; } 2>/dev/null | sed "s|^|F $q $c |"; done | sort -u > $T/p; { if [ -d /var/lib/dpkg/info ]; then awk 'FNR==1{p=FILENAME; sub(/.*\//,"",p); sub(/\.list$/,"",p); sub(/:.*/,"",p)} {print "P", $0, p}' /var/lib/dpkg/info/*.list; else rpm -qa --qf '[P %{FILENAMES} %{NAME}\n]'; fi; cat $T/s $T/p; } 2>/dev/null | awk 'function k(x){return (x~/^\/usr\/(lib|lib64|bin|sbin)\//)?substr(x,5):x} $1=="P"{o[k($2)]=$3; next} $1=="L"{s[$2]=$3" "$4" "$5; next} $1=="S"{if($3 in s){split(s[$3],z," "); l=(z[2]=="lo")?2:3; if(l>v[$2])v[$2]=l; w[$2]=w[$2] (w[$2]==""?"":",") z[3] "/" z[1] (z[2]=="lo"?"@lo":"")}; next} $1=="F"{m[$2]=$3; if(k($4) in o) u[o[k($4)] SUBSEP $2]=1} END{split("running local network",n," "); for(x in u){split(x,y,SUBSEP); l=v[y[2]]; if(l<1)l=1; if(l>b[y[1]]){b[y[1]]=l; d[y[1]]=m[y[2]] (w[y[2]]==""?"":":" w[y[2]])}} for(x in b) print "CVEFOCUS_USE=" x, n[b[x]], d[x]}' | sort; rm -rf $T; } \
      | ssh cvefocus@collector "cat > inventories/$(hostname -s).txt"

    Tasks running as SYSTEM reach a file share as the computer account: give Domain Computers write access to the folder.

  3. On the collector, run the fleet script daily, after the servers have written their files. cvefocus_fleet.py is one file with no dependencies.

    Linux collector:

    sudo mkdir -p /opt/cvefocus && sudo curl -sSo /opt/cvefocus/cvefocus_fleet.py https://cvefocus.com/tools/cvefocus_fleet.py
    sudo sh -c 'umask 077; printf %s "cvf_live_YOUR_KEY" > /etc/cvefocus.key'
    # Daily at 07:30, after the servers have dropped their inventories
    echo '30 7 * * * root python3 /opt/cvefocus/cvefocus_fleet.py /srv/cvefocus/inventories /srv/cvefocus/results --key-file /etc/cvefocus.key' | sudo tee /etc/cron.d/cvefocus-fleet

    Windows collector (needs Python for all users: winget install Python.Python.3.12 --scope machine):

    New-Item -ItemType Directory -Force C:\CVEfocus | Out-Null
    Invoke-WebRequest -UseBasicParsing https://cvefocus.com/tools/cvefocus_fleet.py -OutFile C:\CVEfocus\cvefocus_fleet.py
    Set-Content C:\CVEfocus\key.txt "cvf_live_YOUR_KEY"
    icacls C:\CVEfocus\key.txt /inheritance:r /grant:r "SYSTEM:R" "Administrators:R" | Out-Null
    $action = New-ScheduledTaskAction -Execute py.exe `
      -Argument 'C:\CVEfocus\cvefocus_fleet.py \\fileserver\cvefocus\inventories C:\CVEfocus\results --key-file C:\CVEfocus\key.txt'
    Register-ScheduledTask -TaskName "CVEfocus fleet check" -Action $action `
      -Trigger (New-ScheduledTaskTrigger -Daily -At 7:30am) -User SYSTEM -RunLevel Highest
  4. Read the results: each run writes report-<date>-servers.html (the fleet report), results-<date>.json (everything, for your own tooling) and state.json (what each server had open, so tomorrow's run shows what's new and what's resolved).

Each week and month

Playbook 3: MSP with multiple clients

For: managed service providers. You get: every client's servers checked daily, a report per client with your company name and your registered email, and what changed since the last run. Your client list never leaves your systems: client names and server names are labels you send with each check, used for the answer and discarded.

1. Set up your account

PlanSystems a monthServer checks per minuteA daily run of 500 servers takes
Starter ($49)100120about 9 minutes
Growth ($149)300300about 4 minutes
Business ($349)1,000600about 2 minutes
Enterprise1,000+1,200about 1 minute

A system is one server or container image checked in the month, however often. Each one is counted anonymously: the collector sends a one-way hash of the machine's ID (never its name), and client and server labels are used for the answer and dropped.

Try it first, in one command

See exactly what your clients will get before rolling anything out. On any Linux machine with Python 3, paste this line. It collects that machine, runs the fleet check as if it were a client called "Test client", and writes the client report to cvefocus-results/. It asks for your API key.

curl -sSf https://cvefocus.com/tools/cvefocus_fleet.py | python3 - --this-machine "Test client" --provider "Your MSP name"

Open the report-…-Test-client.html file it names in a browser. Run it again and the summary shows what's new and resolved since the first run. When you're happy, set it up properly with the steps below.

2. Give each client a short label

Pick a stable label per client, such as acme or bobs-plumbing. It's used in file names and printed as the client name on their report. Letters, digits, spaces and . _ - : @ ( ) / & , ' + are allowed. Use asset tags instead of hostnames for server if you prefer not to send hostnames.

3. Deploy the collector through your RMM

Add a daily script in your RMM (NinjaOne, Datto RMM, ConnectWise Automate, N-able, or similar). Most RMMs run scripts as SYSTEM or root and let you set the client label per site as a variable. Each machine writes <client>__<server>.txt (two underscores) to your collection folder.

Windows script (replace acme with the site's label, or your RMM's site variable):

$cv = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$arch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
$sid = -join ([Security.Cryptography.SHA256]::Create().ComputeHash([Text.Encoding]::UTF8.GetBytes("cvefocus:" + (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Cryptography').MachineGuid)) | ForEach-Object { $_.ToString('x2') })
@("ID=windows", "PRETTY_NAME=$((Get-CimInstance Win32_OperatingSystem).Caption)", "VERSION_ID=$($cv.DisplayVersion)",
  "WINDOWS_BUILD=10.0.$($cv.CurrentBuildNumber).$($cv.UBR)", "WINDOWS_ARCH=$arch",
  "WINDOWS_INSTALLATION_TYPE=$($cv.InstallationType)", "CVEFOCUS_SYSTEM=$($sid.Substring(0, 32))",
  "WINDOWS_PENDING_REBOOT=$((Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') -or (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending'))") | Set-Content -Encoding ascii "\\fileserver\cvefocus\inventories\acme__$env:COMPUTERNAME.txt"

Linux script:

{ cat /etc/os-release; uname -r; [ -r /etc/machine-id ] && printf 'CVEFOCUS_SYSTEM=%s\n' "$(printf 'cvefocus:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-32)"; if command -v dpkg-query >/dev/null; then dpkg-query -W -f='${Package} ${Version} ${Architecture} ${source:Package} ${Priority} ${Section}\n'; else rpm -qa --qf '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE} %{ARCH} %{SOURCERPM} %{MODULARITYLABEL}\n'; fi; for f in /opt/*/release /opt/*/*/release /usr/local/*/release /usr/java/*/release /usr/lib/jvm/*/release; do [ -f "$f" ] && awk -F'"' -v d="${f%/release}" '/^JAVA_VERSION=/{v=$2} /^IMPLEMENTOR=/{i=$2} END{if(v!="")print "CVEFOCUS_JDK=" v, d, i}' "$f"; done 2>/dev/null; echo "CVEFOCUS_UID=$(id -u)"; S=$(for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; awk -v u="$(grep -o '[^/]*\.service' $p/cgroup 2>/dev/null | tail -n1)" -v c="$(tr ' ' _ 2>/dev/null < $p/comm)" '$NF=="(deleted)" && $6 ~ /^\/(usr\/)?(lib|lib64|bin|sbin|libexec)\// {print (u==""?"-":u), c, $6}' $p/maps 2>/dev/null; done | sort -u); printf '%s\n' "$S" | sed '/^$/d; s/^/CVEFOCUS_STALE=/'; printf '%s\n' "$S" | awk 'NF{print $3}' | sort -u | while read f; do o=$( (dpkg -S "$f" || rpm -qf --qf '%{NAME}\n' "$f") 2>/dev/null | head -n1 | cut -d: -f1); echo "CVEFOCUS_OWNER=${o:-?} $f"; done; echo CVEFOCUS_EXPOSURE=host; T=$(mktemp -d); for f in /proc/net/tcp /proc/net/tcp6 /proc/net/udp /proc/net/udp6; do awk -v f="$f" 'function hx(s,i,r){for(i=1;i<=length(s);i++)r=r*16+index("0123456789ABCDEF",substr(s,i,1))-1;return r} NR>1 && (($4=="0A" && f~/tcp/) || ($4=="07" && f~/udp/ && $3~/^0+:0000$/)) {split($2,a,":"); c=(a[1]~/^0+$/)?"any":(a[1]~/7F$/ || a[1]=="00000000000000000000000001000000")?"lo":"ip"; print "L", $10, (f~/tcp/?"tcp":"udp"), c, hx(a[2])}' $f 2>/dev/null; done > $T/s; for p in /proc/[0-9]*; do grep -qE 'docker|containerd|kubepods|libpod|lxc' $p/cgroup 2>/dev/null && continue; q=${p#/proc/}; c=$(tr ' ' _ 2>/dev/null < $p/comm) || continue; ls -l $p/fd 2>/dev/null | sed -n "s/.*socket:\[\([0-9]*\)\].*/S $q \1/p"; { readlink $p/exe; awk '$6 ~ /^\// {print $6}' $p/maps; } 2>/dev/null | sed "s|^|F $q $c |"; done | sort -u > $T/p; { if [ -d /var/lib/dpkg/info ]; then awk 'FNR==1{p=FILENAME; sub(/.*\//,"",p); sub(/\.list$/,"",p); sub(/:.*/,"",p)} {print "P", $0, p}' /var/lib/dpkg/info/*.list; else rpm -qa --qf '[P %{FILENAMES} %{NAME}\n]'; fi; cat $T/s $T/p; } 2>/dev/null | awk 'function k(x){return (x~/^\/usr\/(lib|lib64|bin|sbin)\//)?substr(x,5):x} $1=="P"{o[k($2)]=$3; next} $1=="L"{s[$2]=$3" "$4" "$5; next} $1=="S"{if($3 in s){split(s[$3],z," "); l=(z[2]=="lo")?2:3; if(l>v[$2])v[$2]=l; w[$2]=w[$2] (w[$2]==""?"":",") z[3] "/" z[1] (z[2]=="lo"?"@lo":"")}; next} $1=="F"{m[$2]=$3; if(k($4) in o) u[o[k($4)] SUBSEP $2]=1} END{split("running local network",n," "); for(x in u){split(x,y,SUBSEP); l=v[y[2]]; if(l<1)l=1; if(l>b[y[1]]){b[y[1]]=l; d[y[1]]=m[y[2]] (w[y[2]]==""?"":":" w[y[2]])}} for(x in b) print "CVEFOCUS_USE=" x, n[b[x]], d[x]}' | sort; rm -rf $T; } \
  | ssh cvefocus@collector "cat > inventories/acme__$(hostname -s).txt"

The folder then looks like this:

inventories/
  acme__DC01.txt
  acme__WEB02.txt
  bobs-plumbing__FILESRV.txt
  bobs-plumbing__ubuntu-app1.txt

If your RMM can't write to a share, have it capture the script's output instead (send the inventory to stdout by removing the Set-Content … part) and export it to the folder with the same file names.

4. Run the fleet script daily with your company name

--provider prints your company name on every report, next to your registered email, marked as a label you supplied.

Linux collector:

sudo mkdir -p /opt/cvefocus && sudo curl -sSo /opt/cvefocus/cvefocus_fleet.py https://cvefocus.com/tools/cvefocus_fleet.py
sudo sh -c 'umask 077; printf %s "cvf_live_YOUR_KEY" > /etc/cvefocus.key'
# Daily at 07:30, after the servers have dropped their inventories
echo '30 7 * * * root python3 /opt/cvefocus/cvefocus_fleet.py /srv/cvefocus/inventories /srv/cvefocus/results --key-file /etc/cvefocus.key --provider "Your MSP name"' | sudo tee /etc/cron.d/cvefocus-fleet

Windows collector:

New-Item -ItemType Directory -Force C:\CVEfocus | Out-Null
Invoke-WebRequest -UseBasicParsing https://cvefocus.com/tools/cvefocus_fleet.py -OutFile C:\CVEfocus\cvefocus_fleet.py
Set-Content C:\CVEfocus\key.txt "cvf_live_YOUR_KEY"
icacls C:\CVEfocus\key.txt /inheritance:r /grant:r "SYSTEM:R" "Administrators:R" | Out-Null
$action = New-ScheduledTaskAction -Execute py.exe `
  -Argument 'C:\CVEfocus\cvefocus_fleet.py \\fileserver\cvefocus\inventories C:\CVEfocus\results --key-file C:\CVEfocus\key.txt --provider "Your MSP name"'
Register-ScheduledTask -TaskName "CVEfocus fleet check" -Action $action `
  -Trigger (New-ScheduledTaskTrigger -Daily -At 7:30am) -User SYSTEM -RunLevel Highest

Each run writes one report per client, ready to send: report-<date>-acme.html, report-<date>-bobs-plumbing.html, and so on, plus results-<date>.json and state.json for new and resolved items since the last run.

5. Operate it

Calling the API directly

If you'd rather build this into your own tooling or PSA, the script is a thin wrapper around POST /v1/fleet/check. See Fleets and MSPs in the docs and the API reference.

Playbook 4: container images

For: teams that ship containers. You get: the same CVE list, vendor status and decisions for every image, a build that fails when something needs patching now, and a report per image. The script reads each image's package list without running the image, and only that list is sent.

1. Check everything running on a machine

On any machine with Docker, paste this one line. It downloads the script and runs it in one go, finds every image your running containers use, and checks each one. It asks for your API key (what you type is hidden).

curl -sSf https://cvefocus.com/tools/cvefocus-image.sh | sudo sh -s -- --running

Each item also shows its exposure: Network-facing when the container's program that loads it listens on a port published on the host, Containers only for an unpublished port, Running or Not seen running. Network-facing fixes move up the list. sudo lets the script read the running containers' processes; nothing runs inside them. How exposure works.

What you see: for each image, only what to do, most urgent first, with the command or Dockerfile line, and one line for the CVEs that need nothing from you (waiting on a fix, or ones the vendor won't fix). It ends with a table of every image, most urgent first. If no image has anything under Act now or This week, you're done for the week.

To seeAdd to the end of the line
Only the table, one line per image--summary
Why each item matters, and every CVE waiting on a fix--full
A report per image to open in a browser, print or share--report cvefocus-reports

Want something else checked? Change the last word:

To checkEnd the line with
One image, by name (as you'd give it to docker pull)nginx:1.27 or my-app:latest or ghcr.io/acme/api:2.4.1
Every image on this machine--all
A Docker Compose project (run it in the project's folder)--compose
Everything running in your Kubernetes cluster--kubernetes (or --kubernetes --namespace prod)

Add --report cvefocus-reports to save a printable report per image. For a private registry, log in first (docker login …); the docs have the login command for Amazon ECR, Azure, Google, GitHub and GitLab.

Checked: the operating-system packages of images based on Debian, Ubuntu (most official images), distroless, Alpine, Red Hat UBI, AlmaLinux and Rocky Linux, and the Python, Node.js, Java, Go, Ruby, PHP and Rust libraries inside any image.

2. Add it to your pipeline

After the image is built, before it's pushed or deployed. Store your key as a CI secret named CVEFOCUS_KEY (the script uses it without asking). --fail-on act_now stops the pipeline when the image has a CVE that's exploited or likely to be; --report keeps a report for each build.

curl -sSf https://cvefocus.com/tools/cvefocus-image.sh | sh -s -- --fail-on act_now --report cvefocus-reports my-app:$GIT_SHA

Ready-made GitHub Actions and GitLab CI steps are in the docs.

3. Check production daily

Images already deployed keep collecting new CVEs. Schedule the same line on a machine that runs your containers (--running) or that has kubectl for your cluster (--kubernetes), with CVEFOCUS_KEY set in the job:

sudo sh -c 'umask 077; printf %s "cvf_live_YOUR_KEY" > /etc/cvefocus.key'
echo '30 7 * * * root CVEFOCUS_KEY=$(cat /etc/cvefocus.key) sh -c "curl -sSf https://cvefocus.com/tools/cvefocus-image.sh | sh -s -- --running --report /srv/cvefocus/containers"' | sudo tee /etc/cron.d/cvefocus-containers

Already make SBOMs?

Send your CycloneDX or SPDX file straight to the API instead; see From an SBOM.

Need help?

Send us a message through the contact form. Don't include inventories or API keys.