Decrypt TP-Link config.bin Configuration Backup File

Configuration backup file can be downloaded from certain TP-Link devices by clicking Backup button on System Tools > Backup & Restore page. The downloaded configuration file, config.bin is encrypted.

To decrypt the config.bin file, use key 478DA50BF9E3D2CF.

openssl enc -d -des-ecb -nopad -K 478DA50BF9E3D2CF -in config.bin -out dec_config.bin

First 16 bytes of the output file, dec_config.bin is the MD5 hash of configuration text file.


Decrypted file may also contain null byte padding at the end. In this case there are 4 null bytes at the end of file.


To extract configuration text file, remove MD5 hash (First 16 bytes) and padding (Last 4 bytes). 

dd if=dec_config.bin of=config.txt bs=1 skip=16

truncate -s -4 config.txt

Output file, config.txt contains the configurations. Its MD5 hash should match the MD5 given in dec_config.bin.


Demo

Comments


  1. Error setting cipher DES-ECB
    80BB7A91157F0000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:../crypto/evp/evp_fetch.c:349:Global default library context, Algorithm (DES-ECB : 1), Properties ()

    ReplyDelete
    Replies
    1. Late here but hope you solved it. Just using an old version of SSL will fix that. OpenSSL 1.0.2 for example. This is because DES-ECB is an obsolete and insecure algorithm and newer versions of OpenSSL 'don't like' 50-year-old encryption standard.

      Delete
    2. Just add `-provider legacy -provider default` at the end

      Delete
  2. It's a shame that my Archer AX73 AX4500 now uses aes-cbc. So this guide have no use for me. Please make a new guide showing how to decrypt it

    ReplyDelete
  3. Hello sir. I have Dasan H660GM. Firmware. I want to know super user password please help me 🙏🏻

    ReplyDelete

Post a Comment

Popular posts from this blog

Firmadyne Installation & Emulation of Firmware

Extract / Create Cramfs File System from Ubuntu 20.04