Created
December 17, 2021 05:52
-
-
Save samuels410/13d05124b621ff301752a48ed323df07 to your computer and use it in GitHub Desktop.
check log 4j vulnurability
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
echo "checking for log4j vulnerability..." | |
OUTPUT="$(locate log4j|grep -v log4js)" | |
if [ "$OUTPUT" ]; then | |
echo "[WARNING] maybe vulnerable, those files contain the name:" | |
echo "$OUTPUT" | |
fi | |
OUTPUT="$(dpkg -l|grep log4j|grep -v log4js)" | |
if [ "$OUTPUT" ]; then | |
echo "[WARNING] maybe vulnerable, dpkg installed packages:" | |
echo "$OUTPUT" | |
fi | |
if [ "$(command -v java)" ]; then | |
echo "java is installed, so note that Java applications often bundle their libraries inside jar/war/ear files, so there still could be log4j in such applications." | |
fi | |
echo "If you see no output above this line, you are safe. Otherwise check the listed files and packages." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment