Last active
December 21, 2021 15:01
-
-
Save datadavev/bb06fb5658bbd0c9da706434e6b9c577 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 | |
# Run sudo updatedb first | |
# Then run this with sudo if read access to any jars is restricted | |
TEST='JndiLookup' | |
LOGF="$(date --iso-8601=date)-${TEST}-search.txt" | |
echo "Logging to ${LOGF}..." | |
echo "# Generated $(date --iso-8601)" > $LOGF | |
echo "# Locate ${TEST}" >> $LOGF | |
echo "# " >> $LOGF | |
CNT=0 | |
FND=0 | |
echo -n "\r\033[0KChecked ${CNT}, found ${FND}" | |
for F in $(locate /*.jar); do | |
CNT=$((CNT+1)) | |
RES=$(unzip -l $F | grep -i ${TEST}.); | |
if [[ ! -z ${RES} ]]; then | |
echo "# " >> ${LOGF}; | |
echo "${F}" >> ${LOGF}; | |
echo "${RES}" >> ${LOGF}; | |
FND=$((FND+1)) | |
fi ; | |
echo -n -e "\r\033[0KChecked ${CNT}, found ${FND}" | |
done; | |
echo |
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 | |
# Run sudo updatedb first | |
# Then run this with sudo if read access to any jars is restricted | |
TEST='JMSAppender' | |
LOGF="$(date --iso-8601=date)-${TEST}-search.txt" | |
echo "Logging to ${LOGF}..." | |
echo "# Generated $(date --iso-8601)" > $LOGF | |
echo "# Locate ${TEST}" >> $LOGF | |
echo "# " >> $LOGF | |
CNT=0 | |
FND=0 | |
echo -n "\r\033[0KChecked ${CNT}, found ${FND}" | |
for F in $(locate /*.jar); do | |
CNT=$((CNT+1)) | |
RES=$(unzip -l $F | grep -i ${TEST}.); | |
if [[ ! -z ${RES} ]]; then | |
echo "# " >> ${LOGF}; | |
echo "\n${F}" >> ${LOGF}; | |
echo "${RES}" >> ${LOGF}; | |
FND=$((FND+1)) | |
fi ; | |
echo -n -e "\r\033[0KChecked ${CNT}, found ${FND}" | |
done; | |
echo | |
echo "Done."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
e.g. for 44228:
and 45046