#!/bin/bash
cat << "EOF"
 _    _            _               _    _                                           
| |  | |          | |             | |  | |                                          
| |__| | __ _  ___| | _____ _ __  | |__| | ___ _ __ _ __ ___   __ _ _ __   ___  ___ 
|  __  |/ _` |/ __| |/ / _ \ '__| |  __  |/ _ \ '__| '_ ` _ \ / _` | '_ \ / _ \/ __|
| |  | | (_| | (__|   <  __/ |    | |  | |  __/ |  | | | | | | (_| | | | | (_) \__ \
|_|  |_|\__,_|\___|_|\_\___|_|    |_|  |_|\___|_|  |_| |_| |_|\__,_|_| |_|\___/|___/
CVE-2024-3094 check                                                                        
EOF

# CVE-2024-3094 vulnerability check
if command -v xz &>/dev/null; then
    xz_version=$(xz --version | head -n 1 | awk '{print $4}')
    if [[ $xz_version == "5.6.0" || $xz_version == "5.6.1" ]]; then
        echo -e "\n[*] This system seems to be VULNERABLE to CVE-2024-3094 since it has a vulnerable version of xz"
        echo -e "\nLearn more about CVE-2024-3094 on this link:\nhttps://nvd.nist.gov/vuln/detail/CVE-2024-3094"
    else
        echo -e "\n[*] This system DOES NOT SEEM to be vulnerable to CVE-2024-3094."
    fi
else
    echo "[-] xz package is not installed."
fi
