Skip to content

Instantly share code, notes, and snippets.

@edupsousa
Created April 1, 2024 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edupsousa/ef5cde8817ba7dbc0957c99fd8b5ceb8 to your computer and use it in GitHub Desktop.
Save edupsousa/ef5cde8817ba7dbc0957c99fd8b5ceb8 to your computer and use it in GitHub Desktop.
A script by Vegard Nossum to detect if sshd is vulnerable to CVE-2024-3094
#! /bin/bash
set -eu
# find path to liblzma used by sshd
path="$(ldd $(which sshd) | grep liblzma | grep -o '/[^ ]*')"
# does it even exist?
if [ "$path" == "" ]
then
echo probably not vulnerable
exit
fi
# check for function signature
if hexdump -ve '1/1 "%.2x"' "$path" | grep -q f30f1efa554889f54c89ce5389fb81e7000000804883ec28488954241848894c2410
then
echo probably vulnerable
else
echo probably not vulnerable
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment