aelius Posted April 16, 2014 Report Posted April 16, 2014 (edited) Ma plictiseam la cafea si cautam cu ce sa ma joc, asa ca am dat de binwalk1. Descarcam binwalk si extragem fisierele din arhivaroot@pluto:~# wget https://github.com/devttys0/binwalk/archive/v1.3.0.tar.gzroot@pluto:~# tar zxvf v1.3.0.tar.gz root@pluto:~# cd binwalk-1.3.0/2. Instalam dependintele principale pentru binwalk cat si ceva tool-uri pentru dezarhivareroot@pluto:~/binwalk-1.3.0# apt-get install python-magicroot@pluto:~/binwalk-1.3.0# apt-get install libfuzzy2root@pluto:~/binwalk-1.3.0# apt-get install python-opengl python-qt4 python-qt4-gl python-numpy python-scipyroot@pluto:~/binwalk-1.3.0# apt-get install mtd-utils zlib1g-dev liblzma-dev ncompress gzip bzip2 tar arj p7zip p7zip-full openjdk-6-jdk squashfs-toolsroot@pluto:~/binwalk-1.3.0# wget http://www.pyqtgraph.org/downloads/pyqtgraph-0.9.8.tar.gzroot@pluto:~/binwalk-1.3.0# tar zxvf pyqtgraph-0.9.8.tar.gzroot@pluto:~/binwalk-1.3.0# cd pyqtgraph-0.9.8/root@pluto:~/binwalk-1.3.0/pyqtgraph-0.9.8# python setup.py install3. Instalam binwalkroot@pluto:~/binwalk-1.3.0/pyqtgraph-0.9.8# cd ../src/root@pluto:~/binwalk-1.3.0/src# python setup.py install4. Stergem arhiva si directorul cu sursele din care am compilatroot@pluto:~/binwalk-1.3.0/src# cdroot@pluto:~# rm -rf v1.3.0.tar.gz binwalk-1.3.0/5. Sa facem cateva teste pe o imagine de Router luata de pe dd wrtroot@pluto:~# su - marianmarian@pluto:~$ cd work/marian@pluto:~/work$ wget ftp://ftp.dd-wrt.com/stable/dd-wrt.v23/standard/dd-wrt.v23_generic.binmarian@pluto:~/work$ binwalk dd-wrt.v23_generic.bin DECIMAL HEX DESCRIPTION-------------------------------------------------------------------------------------------------------------------0 0x0 TRX firmware header, little endian, header size: 28 bytes, image size: 3522560 bytes, CRC32: 0x54888AF2 flags: 0x0, version: 128 0x1C gzip compressed data, maximum compression, from Unix, NULL date: Thu Jan 1 01:00:00 19702264 0x8D8 LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1941504 bytes604396 0x938EC Squashfs filesystem, little endian, version 2.1, size: 2912869 bytes, 793 inodes, blocksize: 65536 bytes, created: Sun Dec 25 17:00:26 2005 6. Ce ne intereseaza pe noi, este in filesystem. O sa extragem tot ce este dupa 604396 cu dd-ul intr-o imagine.marian@pluto:~/work$ dd if=dd-wrt.v23_generic.bin bs=1 skip=604396 of=ddwrt.squashfs2918164+0 records in2918164+0 records out2918164 bytes (2.9 MB) copied, 2.72447 s, 1.1 MB/s7. Sa vedem cum arata imaginea extrasa cu dd-ul spre diferenta de cea originala.marian@pluto:~/work$ binwalk ddwrt.squashfsDECIMAL HEX DESCRIPTION-------------------------------------------------------------------------------------------------------------------0 0x0 Squashfs filesystem, little endian, version 2.1, size: 2912869 bytes, 793 inodes, blocksize: 65536 bytes, created: Sun Dec 25 17:00:26 2005 marian@pluto:~/work$ file ddwrt.squashfs ddwrt.squashfs: Squashfs filesystem, little endian, version 2.1, 2912869 bytes, 793 inodes, blocksize: 65536 bytes, created: Sun Dec 25 17:00:26 2005De aici cred ca va puteti juca si voi (squashfs/unsquashfs). Sfanta documentatie o puteti gasi aici: Wiki | BinwalkSpor la joaca ;-) Edited April 16, 2014 by aelius Quote