从FreeOTP备份中提取令牌
freeotp-extractor的Python项目详细描述
FreeOTP令牌提取器
备份FreeOTP
使用应用程序的adb,create a backup,使用以下命令:
adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
org.fedorahosted.freeotp是FreeOTP的应用程序ID。在
这将在电话中请求密码来加密备份。继续输入密码。在
手动提取备份
备份是某种形式的加密tar文件。Android Backup Extractor可以解密它们。在
它在AUR上有android-backup-extractor-git。在
按如下方式使用(此命令将要求您输入刚刚设置的用于解密的密码):
^{pr2}$然后提取生成的tar文件:
$ tar xvf freeotp-backup.tar apps/org.fedorahosted.freeotp/_manifest apps/org.fedorahosted.freeotp/sp/tokens.xml
我们不关心清单文件,所以让我们看看apps/org.fedorahosted.freeotp/sp/tokens.xml
。在
提取令牌
首先,下载^{pip
从PyPi安装),然后可以运行./freeotp_extractor.pyz -h
:
usage: freeotp_extractor.pyz [-h] [-v] [-o OUTPUT] [-q {term,svg,eps}] input
Extract token from FreeOTP
positional arguments:
input File containing XML with tokens (usually 'tokens.xml')
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-o OUTPUT, --output OUTPUT
Give the output file for save tokens
-q {term,svg,eps}, --qrcode {term,svg,eps}
Use a JSON input to recreate QRcode for each issuer.
Use 'term' to display directly to the terminal, 'svg'
and 'eps' output the qrcode into a file
要在终端中仅输出令牌:
./freeotp_extractor.pyz apps/org.fedorahosted.freeotp/sp/tokens.xml
它将输出如下内容:
Dropbox:example@gmail.com: BQ4F6XX3QOFEXQY5SNFPJZW3
gitlab.com:example@gmail.com: 4FBTY2GE3VK7BMFBFOE3X7CR
Google:example@gmail.com: RK6MVRZCQXFBUMGBKZBF5CAA
或者您可以传递一个output
参数将其保存到文件中:
./freeotp_extractor.pyz --output tokens.json apps/org.fedorahosted.freeotp/sp/tokens.xml
tokens.json
:
{"Dropbox:example@gmail.com":{"secret":"BQ4F6XX3QOFEXQY5SNFPJZW3","issuer":"Dropbox"},"gitlab.com:example@gmail.com":{"secret":"4FBTY2GE3VK7BMFBFOE3X7CR","issuer":"Gitlab"},"Google:example@gmail.com":{"secret":"RK6MVRZCQXFBUMGBKZBF5CAA","issuer":"Google"}}
重新创建QRcode
有了JSON文件(即:tokens.json
),您可以重新创建QRcode来扫描应用程序。
直接输出到终端:
./freeotp_extractor.pyz tokens.json -q term
或者如果您想将其保存到文件中:
mkdir -p ./qrcode ./freeotp_extractor.pyz tokens.json -q svg -o ./qrcode
- 项目
标签: