Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZXHN H267N router error #18

Closed
skorokithakis opened this issue Sep 11, 2021 · 10 comments · Fixed by #23
Closed

ZXHN H267N router error #18

skorokithakis opened this issue Sep 11, 2021 · 10 comments · Fixed by #23

Comments

@skorokithakis
Copy link

skorokithakis commented Sep 11, 2021

When trying to decrypt the config.bin for ZXHN H267N, I get the following error:

Traceback (most recent call last):
  File "examples/decode.py", line 75, in <module>
    main()
  File "examples/decode.py", line 63, in main
    infile = zcu.encryption.aes_decrypt(infile, key, is_digi)
  File "/tmp/zte-config-utility/zcu/encryption.py", line 44, in aes_decrypt
    decrypted_data.write(aes_cipher.decrypt(encrypted_data.read()))
  File "/tmp/zte-config-utility/env/lib/python3.8/site-packages/pycryptodomex-3.10.1-py3.8-linux-x86_64.egg/Cryptodome/Cipher/_mode_ecb.py", line 196, in decrypt
    raise ValueError("Data must be aligned to block boundary in ECB mode")

Unfortunately, I'm not sure what could have led to unaligned data. I can send you the config.bin if there's a private way to do that.

@811Alex
Copy link
Contributor

811Alex commented Sep 25, 2021

It's always useful to know what command you used, too. If you want me to take a look when I have the time, just tell me where I can contact you. I can't guarantee anything and you should know that config.bin has some sensitive info in it.

@skorokithakis
Copy link
Author

I ended up finding the password in a forum, but I'd be glad to send you the config file (I think I still have it). You can contact me hi@stavros.io if you like!

@811Alex
Copy link
Contributor

811Alex commented Sep 25, 2021

Is the one you found listed here?

@skorokithakis
Copy link
Author

IIRC no, I remember looking. I can get you the password later if you want to add it.

@811Alex
Copy link
Contributor

811Alex commented Sep 25, 2021

If it's not there, then that would help, yeah!
It would also help if you could provide the exact signature, along with it.
You can get that by using:

python3 examples/signature.py <your config.bin>

@skorokithakis
Copy link
Author

The signature is:

12:24:29 $ python3 signature.py ~/Downloads/Sync/config.bin 
ZXHN H267N V1.0

@skorokithakis
Copy link
Author

So it looks like the password is $Extra,ODP0ptiOns$987%, but this isn't a password issue, it crashes because of an alignment issue. It doesn't proceed past the first password tried.

@811Alex
Copy link
Contributor

811Alex commented Oct 1, 2021

I'm fairy certain this is not your config.bin encryption key, but your root user password. If you're using the latest version, it should have said it's the wrong key though, so maybe that's something worth taking a look at. I think I'll just throw you an email for the config.bin, so I can run some tests.

@skorokithakis
Copy link
Author

Ah, yes, I thought the two were the same, sorry. I've sent you my config.bin in case it helps, thanks!

@811Alex
Copy link
Contributor

811Alex commented Oct 1, 2021

Could you try using your router's serial number instead of a key (with the --serial parameter)?
or send it to my email if you want me to try instead

811Alex added a commit to 811Alex/zte-config-utility that referenced this issue Oct 3, 2021
Decrypting a type 4 payload (digimobil style, CBC instead of ECB), using a key instead of S/N, raises an exception. This prints a more user-friendly error, when that's the case.
Closes mkst#18
@mkst mkst closed this as completed in #23 Oct 5, 2021
mkst pushed a commit that referenced this issue Oct 5, 2021
Decrypting a type 4 payload (digimobil style, CBC instead of ECB), using a key instead of S/N, raises an exception. This prints a more user-friendly error, when that's the case.
Closes #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants