Created
December 28, 2022 07:37
-
-
Save joshterrill/688645cce28b115e9cdeb94569bbf616 to your computer and use it in GitHub Desktop.
A shell script that checks files for entropy then orders files by highest entropy and saves the paths to a file called `entropy.txt`
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
echo "Getting entropy readings from all .php files" | |
rm -rf entropy.txt entropy.tmp.txt | |
for entry in $(find . -type f -name "*.php" -maxdepth 4); do | |
entropy=$(ent $entry | sed -n 's/.*Serial correlation coefficient is //p' | sed "s/ .*//") | |
echo "$entry $entropy" >> entropy.tmp.txt | |
done | |
sort -k2 -n entropy.tmp.txt > entropy.txt | |
rm -rf entropy.tmp.txt | |
echo "Entropy readings saved to entropy.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment