-
-
Save seth2810/1b3ff52b39df2e9cc8bf1a3d3c7efe01 to your computer and use it in GitHub Desktop.
Shell script to generate Google Authenticator codes
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
#!/bin/sh | |
# This is the path to the Google Authenticator app file. It's typically located | |
# in /data under Android. Copy it to your PC in a safe location and specify the | |
# path to it here. | |
DB="/path/to/com.google.android.apps.authenticator/databases/databases" | |
sqlite3 "$DB" 'SELECT email,secret FROM accounts;' | while read A | |
do | |
NAME=`echo "$A" | cut -d '|' -f 1` | |
KEY=`echo "$A" | cut -d '|' -f 2` | |
CODE=`oathtool --totp -b "$KEY"` | |
echo -e "\e[1;32m$CODE\e[0m - \e[1;33m$NAME\e[0m" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment