Sunday, June 21, 2015

Tutorial- Unpacking cable modem firmware

So, what about Your ISP cable modem? Some providers shares a cm firmware, some not and this is the most often situation. There is a couple of ways, to get this piece of binaries. When You have it, You may think what is the next step. A few basic tools (hexdump, strings, dd, lzmadec,  etc.) provided with linux usually make the job. Now, go back to ours binary. First we must know, if it is a zip or lzma package maybe? File command show us, what it knows about it.

$ file cable_modem_firmware.bin 
cable_modem_firmware.bin: data

Nothing. 

Of course, file tool doesn't reveal intersting news at this step, as usually. Ther is no magic bytes recognized on the begining of .bin file.
Next tool is "strings". In example mentioned below, it show us at least 12-chars strings: 


$ strings -12 cable_modem_firmware.bin 
cable_modem_firmware.bin

4wX8<X$2ee`E-
(8i\R#F"\b-#O
t^paU>ETvn{^o
S<W/[d6h)!@|;q
p!&G,C< >       ,r:
h;BVFqX*99YJT
Hro+'xP@LRD1#
/.3jDeFloQ1     s
pDvaz|IR/_[;q-
nRG<5@W9U#?F,>Q