Created
December 15, 2021 13:20
-
-
Save prakashcc/fe3cc54cbe6c9c17da73d8633a0642ab 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/bash | |
| for f in $(find / -name "*.jar" 2>/dev/null); do | |
| #echo "Checking $f..." | |
| unzip -l "$f" | grep -F org/apache/logging/log4j/core/lookup/JndiLookup.class | |
| if [ $? -eq 0 ]; then | |
| echo "Found JNDI lookup class in $f in $container. Deleting now..." | |
| zip -q -d $f org/apache/logging/log4j/core/lookup/JndiLookup.class | |
| #find / -name "log4j-core-2*.jar" -exec zip -q -d {} org/apache/logging/log4j/core/lookup/JndiLookup.class \; | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment