Random Note #632424: Backup Google Authenticator Data

randomnote backups

Using 2 factor authentication generally is a good idea. However, losing 2 factor data can be the opposite. If you’re using Google Authenticator to generate 2FA codes, you may have wondered how to backup the data the app uses to generate codes. The method described here requires root access of course but doesn’t require a third party app. Please note that you can always use apps that backup app data but recovering this data on newer Android versions can fail. To avoid this, use this script:


# $1: IP

adb root
adb connect $1:5555
adb pull /data/data/com.google.android.apps.authenticator2/databases/databases /tmp/.bkp

sqlite3 /tmp/.bkp "select * from accounts;"
rm /tmp/.bkp

This pulls the SQLite database of Google Authenticator and prints all secret data. You can then use the printed data to backup your Authenticator state and to recover it later in case other restoring mechanisms fail.

Random Note #092345: Passing binary input via GDB

randomnote gdb exploitation reverse-engineering

Random Note #12354123: Easy Remote Pair Programming Using Docker and Tmux

randomnote docker vim tmux shell programming

Random Note #23542351: Using the GitHub API to improve Dockerfiles

randomnote docker