Decrypt firmware: DIR-X1560
Verify that image is encrypted
» hd DIRX1560A1_FW102B01.bin | less
» binwalk -E DIRX1560A1_FW102B01.bin Decrypt image and extract content
» cat decrypt.sh
#!/bin/bash
SIZE=$(stat -c%s $1)
BLOCKS=$SIZE/131072
for ((i=0; i<$BLOCKS; i++)) do
dd if=$1 iflag=skip_bytes,count_bytes skip=$((16+i*131072)) count=131072 \
| openssl aes-256-cbc -d -in /dev/stdin -out /dev/stdout -K 6865392d342b4d212964363d6d7e7765312c7132613364316e26322a5a5e2538 \
-iv 4a253169516c38243d6c6d2d3b384145 --nopad --nosalt \
| dd if=/dev/stdin of=$2 oflag=append conv=notrunc
doneLast updated