n/chit-chatu/James · 5 เดือนที่แล้ว
สมัครสมาชิก เข้าสู่ระบบ
n/chit-chat · 5 เดือนที่แล้ว · เข้าชม 832 ครั้ง
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
เข้าสู่ระบบเพื่อร่วมพูดคุย

34 การตอบกลับ

การเรียงลำดับ
  1. xingyun1000 ทอง 5 เดือนที่แล้ว

    支持一下啊

    1
  2. LOL ทอง 5 เดือนที่แล้ว

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

    1
  3. Aneirin-supar ทอง 5 เดือนที่แล้ว

    支持一下啊 :xhj001:

    1
  4. Wade ทอง 3 ปี 5 เดือนที่แล้ว

    这个好

    1
  5. Furry ราชันย์ ปราชญ์แห่งวรรณกรรม 5 เดือนที่แล้ว

    有点意思 第一个

    0
  6. bashell เพชร 5 เดือนที่แล้ว

    感谢分享🙏🏻

    0
  7. linying23333 😇 เพชร 2 ปี 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 💯 ตำนาน เจ้าของกระทู้ ผู้จัดการ 5 เดือนที่แล้ว

    可以试试 NodeAuth

    1
  15. NooMI ทอง 5 เดือนที่แล้ว

    也是密码管理工具吗

    0
  16. James 💯 ตำนาน เจ้าของกระทู้ ผู้จัดการ 5 เดือนที่แล้ว

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

    0
  17. duan15 เงิน 5 เดือนที่แล้ว

    这个得要授权码啊,

    0
  18. MuYbaby ทอง 3 ปี 5 เดือนที่แล้ว

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

    0
  19. pmg ทอง 3 ปี 5 เดือนที่แล้ว

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

    0
  20. gzj000p ทอง 3 ปี 5 เดือนที่แล้ว

    感谢,收藏了

    0
  21. jojodat ทอง 5 เดือนที่แล้ว

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

    0
  22. sb_o เงิน 5 เดือนที่แล้ว

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

    0
  23. sdcfre เพชร 3 ปี 5 เดือนที่แล้ว

    感谢分享

    0
  24. Arvin_Leung 🚗 เกียรติยศ 3 ปี 5 เดือนที่แล้ว

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

    0
  25. anlish ทอง 5 เดือนที่แล้ว

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

    0
  26. Young2095 ทอง 5 เดือนที่แล้ว

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

    0
  27. lbj แพลทินัม 3 ปี 5 เดือนที่แล้ว

    可以,正好备份一下

    0
  28. zpxocikkk ทอง 5 เดือนที่แล้ว

    这个很有必要操作

    0
  29. cjohn ไม่ทอดทิ้งกัน 5 เดือนที่แล้ว

    學習

    0
  30. MSaZs ทอง 5 เดือนที่แล้ว

    支持

    0
  31. Bridge ทอง 5 เดือนที่แล้ว

    mark备用

    0
  32. yifang ทอง 5 เดือนที่แล้ว
    การตอบกลับนี้ถูกผู้ดูแลลบแล้ว
  33. Zanimelle เงิน 3 ปี 5 เดือนที่แล้ว

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

    0
  34. q120656387 ทอง 5 เดือนที่แล้ว

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

    0