Created
March 31, 2024 05:22
-
-
Save thixpin/32af2d41a60ef1a1bcbd01c6f49863f3 to your computer and use it in GitHub Desktop.
xz backdoor scanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
cd / | |
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