Created
December 14, 2021 21:16
-
-
Save navicore/7e9730fb810f610541c86c85007ba396 to your computer and use it in GitHub Desktop.
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/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