Skip to content

Instantly share code, notes, and snippets.

@nrnw
Created March 30, 2024 16:40
Show Gist options
  • Save nrnw/524a6cd7b00ff27f12740d699db7ebdf to your computer and use it in GitHub Desktop.
Save nrnw/524a6cd7b00ff27f12740d699db7ebdf to your computer and use it in GitHub Desktop.
backdoor vulnerablity check for xz-utils
#!/bin/bash
#Check xz-utils installed
if ! command -v xz &> /dev/null
then
echo "xz-utils is not installed on this system."
exit 1
fi
# Get the version of xz-utils
xz_version=$(xz --version | head -n 1 | awk '{print $4}')
# Check if the version is vulnerable
if [[ "$xz_version" == "5.6.0" || "$xz_version" == "5.6.1" ]]
then
echo "System is vulnerable to the backdoor found in xz-utils (CVE-2024-3094)."
else
echo "System is not vulnerable to the backdoor found in xz-utils."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment