Created
November 21, 2024 14:53
-
-
Save Firebasky/dc9e4fce5f7ca89d0ea55f076acf078f to your computer and use it in GitHub Desktop.
CVE-2024-48990 check 脚本
This file contains hidden or 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 | |
| # https://mp.weixin.qq.com/s/Klj66bHJ3p_VcR14FQXhMA | |
| ubuntu_version=$(lsb_release -rs) | |
| libmodule_scandeps_perl_version=$(apt list --installed 2>/dev/null | grep -E "^(libmodule-scandeps-perl/)" | awk -F'/' '{print $1 " " $2}' | awk -F ' ' '{print $3}' | sed 's/ubuntu.*//') | |
| needrestart_version=$(apt list --installed 2>/dev/null | grep -E "^(needrestart/)" | awk -F'/' '{print $1 " " $2}' | awk -F ' ' '{print $3}') | |
| if [[ "$ubuntu_version" == "22.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" le 1.31-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 3.5-5ubuntu2.1; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| if [[ "$ubuntu_version" == "16.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" le 1.20-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 2.6-1; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| if [[ "$ubuntu_version" == "18.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" le 1.24-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 3.1-1ubuntu0.1; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| if [[ "$ubuntu_version" == "20.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" le 1.27-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 3.4-6ubuntu0.1; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| if [[ "$ubuntu_version" == "24.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" le 1.35-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 3.6-7ubuntu4.1; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| if [[ "$ubuntu_version" == "24.04" ]]; then | |
| if dpkg --compare-versions "$libmodule_scandeps_perl_version" lt 1.35-1; then | |
| if dpkg --compare-versions "$needrestart_version" le 3.6-8ubuntu4; then | |
| echo "ubuntu: $ubuntu_version has CVE-2024-48990 vul !!!" | |
| fi | |
| fi | |
| fi | |
| echo "ubuntu: $ubuntu_version no vul!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment