n/chit-chatu/James · 5 个月前
注册 登录
n/chit-chat · 5 个月前 · 806 次浏览
u/James💯王者

从Google Authenticator解密获取2FA密钥备份教程

启用2FA可以有效的保证账户安全,但一旦手机丢失或者换手机等操作不当丢失2FA密钥就会导致账户可能再也无法找回。Google Authenticator是一个常用的二步验证动态口令生成工具,支持设备间转移和google云备份,但是在软件内不能直接查看到密钥,不能很方便的进行密钥的本地保存和备份,或者是迁移到其它2FA平台。这里介绍一个从Google Authenticator解密获取到2FA密钥的工具和使用方法。

操作过程

导出配置文件二维码

  1. 打开Google Authenticator,点击左上角的三条横线按钮,选择转移账号
  2. 选择导出账号
  3. 勾选需要导出的账号并点击下一步

这里我们会看到一个二维码,截图保存为文件,比如ga.jpg。

使用decodeGoogleOTP工具解码

为了方便整个过程,我写了一个命令行工具decodeGoogleOTP,前往Github下载页面,根据自己的平台,下载最新版本的工具。

下载后解压,为了方便操作可以重命名一下,比如windows平台重命名为decodeGoogleOTP.exe,然后和ga.jpg放在一个文件夹下。

decodeGoogleOTP支持将结果导出为csv文件、json文件、txt文件或者二维码图片等多种格式。如果我们需要将结果导出为json文件,运行如下命令即可

decodeGoogleOTP -i ga.jpg -c output.json

输出的结果格式如下:

[
  {
    "issuer": "",
    "name": "xx",
    "secret": "AAAAAAAAAAA",
    "type": "totp",
    "counter": 0,
    "url": "otpauth://totp/xx?secret=AAAAAAAAAAA"
  }
]

其中secret字段就是2FA密钥,有了密钥就可以方便的转移到其它平台。而url可以用来生成二维码供其它2FA软件扫描导入,也可以使用decodeGoogleOTP直接导出二维码图片供扫描

更详细的使用方法参考下面的说明

$ decodeGoogleOTP -h

decodeGoogleOTP is a command line tool to decode Google OTP QR codes. Output can be json, csv, qrcode or plain text.

Usage:
  decodeGoogleOTP [flags]
  decodeGoogleOTP [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print current version of the application

Flags:
  -c, --csv string      Output in CSV format and specify the output file
  -d, --debug           Enable debug mode
  -h, --help            help for decodeGoogleOTP
  -i, --input string    Input file path
  -j, --json string     Output in JSON format and specify the output file
  -p, --print-qr        Print QR code to terminal
  -q, --qrcode string   Output in QR code image format and specify the output directory
  -s, --silent          Enable silent mode
  -t, --text string     Output url list in plain text format and specify the output file
  -u, --url string      Output in URL format and specify the output file
  -v, --version         Print version information

Use "decodeGoogleOTP [command] --help" for more information about a command.
17
34
登录后参与讨论。
u/deleted 广告
海外原生IP VPS,稳定访问全球网络

还在为IP不纯、平台风控、频繁验证而烦恼? 丽萨主机海外原生IP VPS,双ISP住宅IP,覆盖美国、香港、日本、新加坡、台湾、德国、越南、英国等热门地区,适合跨境电商、社媒运营、AI工具、流媒体及海外业务使用。

lisahost.com 了解更多

34 条回复

排序
  1. xingyun1000 黄金 5 个月前

    支持一下啊

    1
  2. LOL 黄金 5 个月前

    这个可以有,喜欢多一层备份的狂喜

    1
  3. Aneirin-supar 黄金 5 个月前

    支持一下啊 :xhj001:

    1
  4. Wade 黄金 3 YEARS 5 个月前

    这个好

    1
  5. Furry 钻石 文圣 5 个月前

    有点意思 第一个

    0
  6. bashell 钻石 5 个月前

    感谢分享🙏🏻

    0
  7. linying23333 😇 钻石 2 YEARS 5 个月前

    hhh,由于我不用google 2fa,所以本身hotp就是明文的url链接(然后微软2fa的app又不支持导出)
    很遗憾用不上了

    0
  8. Halim_Abdullah 白银 5 个月前

    来学习了

    0
  9. haoqi75 黄金 5 个月前

    以后再也不怕账号被丢了,👍支持大佬,已保存。

    0
  10. linxone2895 黄金 5 个月前

    支持一下啊! :xhj001:

    0
  11. dearfaint 白银 5 个月前

    Mark~换机使用

    0
  12. tonylive 黄金 3 YEARS 5 个月前

    支持一下,学习了

    0
  13. NooMI 黄金 5 个月前

    这个好啊,转移到bitwarden上面去就很舒服了

    0
  14. James 💯 王者 楼主 MANAGER 5 个月前

    可以试试 NodeAuth

    1
  15. NooMI 黄金 5 个月前

    也是密码管理工具吗

    0
  16. James 💯 王者 楼主 MANAGER 5 个月前

    是的,站内大佬开发的,我已经用上了,很好用。

    0
  17. duan15 白银 5 个月前

    这个得要授权码啊,

    0
  18. MuYbaby 黄金 3 YEARS 5 个月前

    看上去是一个很实用的小工具

    0
  19. pmg 黄金 3 YEARS 5 个月前

    我的常规做法是保留二维码做备份

    0
  20. gzj000p 黄金 3 YEARS 5 个月前

    感谢,收藏了

    0
  21. jojodat 黄金 5 个月前

    看上去是一个很实用的小工具

    0
  22. sb_o 白银 5 个月前

    我第一个用的密码管理器,被阿三的软件设计气到了

    0
  23. sdcfre 钻石 3 YEARS 5 个月前

    感谢分享

    0
  24. Arvin_Leung 王者 3 YEARS 5 个月前

    我一直都是用bitwarden,都很懒去折腾别的。

    0
  25. anlish 黄金 5 个月前

    还有个更简便的方法,Google Authenticator导出,显示二维码后,用Aegis(google play里面搜索下载)扫码就可以了,或者把二维码拍下来(一般的手机为了安全这个界面截不了屏),再用Google Authenticator同一个手机的Aegis扫码

    0
  26. Young2095 黄金 5 个月前

    支持一下,学习了! :xhj001:

    0
  27. lbj 铂金 3 YEARS 5 个月前

    可以,正好备份一下

    0
  28. zpxocikkk 黄金 5 个月前

    这个很有必要操作

    0
  29. cjohn 钻石 不离不弃 5 个月前

    學習

    0
  30. MSaZs 黄金 5 个月前

    支持

    0
  31. Bridge 黄金 5 个月前

    mark备用

    0
  32. 已删除 5 个月前
    这条回复已被版主删除
  33. Zanimelle 白银 3 YEARS 5 个月前

    不错不错,但其实更想把微软的Authenticator里的提取出来

    0
  34. q120656387 黄金 5 个月前

    这是实用的玩意,必须支持一下,感谢分享

    0