Skip to content

Instantly share code, notes, and snippets.

@navicore
Created December 14, 2021 21:16
Show Gist options
  • Save navicore/7e9730fb810f610541c86c85007ba396 to your computer and use it in GitHub Desktop.
Save navicore/7e9730fb810f610541c86c85007ba396 to your computer and use it in GitHub Desktop.
#!/bin/env bash
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