Skip to content

Instantly share code, notes, and snippets.

@spy86
Created December 16, 2021 15:37
Show Gist options
  • Save spy86/73f772de95b73cb4b77d7cca9abdd924 to your computer and use it in GitHub Desktop.
Save spy86/73f772de95b73cb4b77d7cca9abdd924 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "checking for log4j vulnerability...";
if [ "$(locate log4j|grep -v log4js)" ]; then
echo "### maybe vulnerable, those files contain the name:";
locate log4j|grep -v log4js;
fi;
if [ "$(rpm -qa|grep log4j|grep -v log4js)" ]; then
echo "### maybe vulnerable, installed packages:";
rpm -qa |grep log4j;
fi;
if [ "$(which 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