simone36050 / PosteID-seed-extractor

Uno strumento per estrarre il seed OTP dell'app PosteID
MIT License
13 stars 2 forks source link

Errore non appena inserisco il codice otp #2

Closed fst85 closed 1 year ago

fst85 commented 1 year ago

Ciao ho appena provato ad eseguire il tuo tool tutto bene fino a quando ho inserito il codice che ho ricevuto tramite sms ottenendo questo errore

`Traceback (most recent call last): File "/home/max/.local/lib/python3.10/site-packages/jwcrypto/jwe.py", line 499, in deserialize djwe = json_decode(raw_jwe) File "/home/max/.local/lib/python3.10/site-packages/jwcrypto/common.py", line 42, in json_decode return json.loads(string) File "/usr/lib/python3.10/json/init.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not dict

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/max/extractor.py", line 482, in main() File "/home/max/extractor.py", line 474, in main extract_cmd(args.only_output, args.show_string) File "/home/max/extractor.py", line 401, in extract_cmd app_register_id, secret_app = http_register_app(s, app_id, app_id_hashed, File "/home/max/extractor.py", line 213, in http_register_app response_content = jwe_decode(response, app_privkey) File "/home/max/extractor.py", line 342, in jwe_decode jwe_message.deserialize(content, jwe_key) File "/home/max/.local/lib/python3.10/site-packages/jwcrypto/jwe.py", line 543, in deserialize raise InvalidJWEData('Invalid format', repr(e)) from e jwcrypto.jwe.InvalidJWEData: Invalid format {TypeError('the JSON object must be str, bytes or bytearray, not dict')}`

Ho anche provato ad entrare nell'app prima d'inserire il codice otp ma ho ricevuto lo stesso identico errore

simone36050 commented 1 year ago

Ciao 👋, grazie della segnalazione!

Il problema è molto strano perché PosteID dà una risposta strana che non ho mai visto, ho appena provato e a me funziona tutto correttamente. La prima causa che mi viene in mente è un problema temporaneo ai server di Poste, in questo caso sarebbe sufficiente riprovare.

Un'altra possibile causa è l'app, prova a fare logout e poi di nuovo il login (oppure disinstalla e reinstalla l'app) e successivamente esegui lo script.

Fammi sapere se funziona, in caso negativo cercheremo altre soluzioni.

fst85 commented 1 year ago

Ok credo di aver capito il problema: posteid permette di collegare al massimo 5 dispositivi alla propria app ed io ne avevo registrati tutti e 5. Facendo il login sul sito poste e scollegando tutti i dispositivi sono riuscito ad ottenere il QR code

simone36050 commented 1 year ago

Grazie! Ho aggiornato il readme in modo che altri utenti con lo stesso problema sapranno cosa fare