Skip to content

Instantly share code, notes, and snippets.

@prakashcc
Created December 15, 2021 13:20
Show Gist options
  • Save prakashcc/fe3cc54cbe6c9c17da73d8633a0642ab to your computer and use it in GitHub Desktop.
Save prakashcc/fe3cc54cbe6c9c17da73d8633a0642ab to your computer and use it in GitHub Desktop.
#!/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