Check Linux servers for vulnerabilities

A Linux server can have thousands of known vulnerabilities (CVEs). CVEfocus shows the few to act on: which ones have a fix, which are exploited or network-facing, and what to do first, with one read-only command. Uses Ubuntu's, Debian's, Red Hat's and Alpine's own security data, so backported fixes count. No agent, no network scan, nothing stored.

Run it

Get a free API key (email only), then on the server:

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 @-

As root (after sudo -i) it also shows each item's exposure. Step-by-step playbooks for one server, a fleet, or an MSP with many clients are in Getting started.

What you get

Questions

How do I check if my Ubuntu or Debian server is vulnerable?

Run the read-only command on this page. It sends the OS release, running kernel and installed package list to CVEfocus, which checks every package against Ubuntu's or Debian's own security data and prints what to upgrade first, with the exact apt command and fixed version.

Which Linux distributions are supported?

Ubuntu 20.04 and later, Debian 11 and later, Red Hat Enterprise Linux 7 to 10 (including module streams), AlmaLinux and Rocky Linux 8 to 10, and Alpine Linux 3.x, plus Windows Server and container images.

Why not just compare version numbers with the CVE?

Linux distributions backport security fixes without changing the upstream version, so a plain version comparison reports vulnerabilities that are already fixed. CVEfocus uses each vendor's fixed package version and its own status (fixed, waiting, won't fix, not affected).

Is an agent installed, or the server scanned over the network?

Neither. One read-only command runs on the server and sends only the package list. Nothing is installed, nothing scans your network, and CVEfocus stores nothing: no inventories, results or IP addresses.

Does it show whether a vulnerability is actually exposed?

Yes, when the command runs as root: each item says whether the vulnerable package is loaded by a program listening on the network (and on which port), only running locally, or not running at all. Network-facing fixes move up.

Can I check many servers, or my clients' servers?

Yes. A fleet call checks up to 100 servers at once, labelled by server and client, with what changed since the last run and a report per client. A ready-made script runs it daily from cron, an RMM or Ansible.

Free API key in 30 seconds, email only.

Get a free API keyThis week's latest CVEs