Skip to content

Instantly share code, notes, and snippets.

@oberstet
Created March 30, 2024 14:49
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 oberstet/ad16a18c710f57cc45813d4a9ee9681d to your computer and use it in GitHub Desktop.
Save oberstet/ad16a18c710f57cc45813d4a9ee9681d to your computer and use it in GitHub Desktop.
(.venv) oberstet@intel-nuci7:~$ uname -a
Linux intel-nuci7 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
(.venv) oberstet@intel-nuci7:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
(.venv) oberstet@intel-nuci7:~$ cat ~/Downloads/detect_sh.bin
#! /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
(.venv) oberstet@intel-nuci7:~$ chmod +x ~/Downloads/detect_sh.bin
(.venv) oberstet@intel-nuci7:~$ ~/Downloads/detect_sh.bin
probably not vulnerable
(.venv) oberstet@intel-nuci7:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment