krissrex / google-authenticator-exporter Goto Github PK
View Code? Open in Web Editor NEWGet the TOTP secrets exported by Google Authenticator
License: MIT License
Get the TOTP secrets exported by Google Authenticator
License: MIT License
Hi, great script! really helpful.
Not a major issue but I am having issues when trying to save to file
`prompt: saveToFile: y
prompt: filename: lee.json
lee.json
true
Saving to "lee.json"...
node:internal/readline/emitKeypressEvents:71
throw err;
^
TypeError: saveToFile is not a function
at toJson (D:\py\gauth\src\index.js:120:5)
at D:\py\gauth\src\index.js:181:9
at D:\py\gauth\node_modules\prompt\lib\prompt.js:357:32
at D:\py\gauth\node_modules\async\lib\async.js:154:25
at assembler (D:\py\gauth\node_modules\prompt\lib\prompt.js:354:9)
at D:\py\gauth\node_modules\prompt\lib\prompt.js:363:32
at D:\py\gauth\node_modules\prompt\lib\prompt.js:658:5
at Interface.onLine (D:\py\gauth\node_modules\read\lib\read.js:111:5)
at Interface.emit (node:events:390:28)
at Interface._onLine (node:readline:487:10)`
Be nice since most desktops don't have a camera
This could be turned into a static website, if the dependencies (protobufjs
) allow for it.
The prompt
and colors
are only needed in the CLI.
Hi !
Thanks for sharing, I wrote a simple and dirty pythonic PoC from your work
https://github.com/ArkSystemes/pygauth
<Ark />
node:readline:1252
throw err;
^
RangeError: index out of range: 51 + 10 > 51
at indexOutOfRange (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:13:12)
at BufferReader.read_uint32 [as uint32] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:98:19)
at BufferReader.read_int32 [as int32] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:109:17)
at Type.OtpParameters$decode [as decode] (eval at Codegen (C:\Users\test\google-authenticator-exporter\node_modules@protobufjs\codegen\index.js:50:33), :23:14)
at Type.decode_setup [as decode] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\type.js:507:25)
at Type.MigrationPayload$decode [as decode] (eval at Codegen (C:\Users\test\google-authenticator-exporter\node_modules@protobufjs\codegen\index.js:50:33), :13:33)
at Type.decode_setup [as decode] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\type.js:507:25)
at decodeProtobuf (C:\Users\test\google-authenticator-exporter\src\index.js:14:36)
at decode (C:\Users\test\google-authenticator-exporter\src\index.js:48:19)
at C:\Users\test\google-authenticator-exporter\src\index.js:176:22
I was just testing the code when i stumbled upon an 'error'.
It occurs whenever i try to run 'npm run start' or 'npm run start:qrcode'
npm and Nodejs are installed. and the index.js file exists in the stated location...
Am i doing something wrong/missing something, or what could be the problem here?
** Enviroment **
Debian 12 Virtual Machine running in Virtual Box
** Error Message **
npm run start
[email protected] start
node ./src/index.jsnode:internal/modules/cjs/loader:1042
throw err;
^Error: Cannot find module 'prompt'
Require stack:
- /home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at promptUserForUri (/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js:136:18)
at Object. (/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js:190:1)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js'
]
}Node.js v18.13.0
Having the app freely available to anyone on your computer is a security hazard
Google now use a single QR code to store all the keys you've chosen to export, so it is now not available.
Might be worth mentioning in the REAMDE that the QR code presented by Google Auth must not be more than one.
In case it is more than one the workaround is to limit the amount of exported accounts
A user can upload/select a jpg, and we then read QR and get the URI from it.
I know this can be done in python, but the aim is to run 100% client side to be compatible with #1.
An even more viable option is to implement #1, then use the webcamera from the browser to read the Google Authenticator QR code. This simplifies the process a lot.
Also found an issue with generating QRCodes due to non-escaped characters.
e.g.for windows /:*?"<>|
I often find these are used in the authenticator name
I changed lines 91-94 of index.js to the below (probably a MUCH better way of doing it than this,but it worked for me (windows) today ;-)
const Escname = name.replace(/[\\\/:*?"<>|]/g, "\-")
const url = `otpauth://totp/${encodeURI(name)}?secret=${encodeURI(secret)}&issuer=${encodeURI(issuer)}`
const file = `${directory}/${issuer || "No issuer"} (${escname}).png`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.