attifyos icon indicating copy to clipboard operation
attifyos copied to clipboard

failed in emulating dlink using fat

Open Janette88 opened this issue 5 years ago • 0 comments

hi ,adi i received the error like this when i emulated Dlink using fat tool. sudo ./fat.py

Welcome to the Firmware Analysis Toolkit - v0.1
Offensive IoT Exploitation Training  - http://offensiveiotexploitation.com
By Attify - https://attify.com  | @attifyme

Enter the name or absolute path of the firmware you want to analyse : new-firmware.bin Enter the brand of the firmware : Dlink new-firmware.bin Now going to extract the firmware. Hold on.. /home/oit/tools/fat//sources/extractor/extractor.py -b Dlink -sql 127.0.0.1 -np -nk "new-firmware.bin" images test The database ID is 1 Getting image type Password for user firmadyne: Found image type of mipsel Putting information to database Traceback (most recent call last): File "/home/oit/tools/fat//scripts/tar2db.py", line 100, in main() File "/home/oit/tools/fat//scripts/tar2db.py", line 97, in main process(iid, infile) File "/home/oit/tools/fat//scripts/tar2db.py", line 77, in process insertObjectToImage(iid, file2oid, links, cur) File "/home/oit/tools/fat//scripts/tar2db.py", line 57, in insertObjectToImage for x in files2oids]) psycopg2.IntegrityError: duplicate key value violates unique constraint "object_to_image_oid_iid_filename_key" DETAIL: Key (oid, iid, filename)=(1, 1, /lib/iptables/libipt_NETMAP.so) already exists.

Already done earlier Creating Image Executing command

sudo /home/oit/tools/fat//scripts/makeImage.sh 1 Password for user firmadyne: Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0xee73a908. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Building a new DOS disklabel with disk identifier 0x4b6f8148. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) mke2fs 1.42.9 (4-Feb-2014) Please check the makeImage function Everything is done for the image id 1 Setting up the network connection Password for user firmadyne: qemu: terminating on signal 2 from pid 4836 Querying database for architecture... mipsel Running firmware 1: terminating after 60 secs... Inferring network... Interfaces: [] Done!

Running the firmware finally : /home/oit/tools/fat//scratch/1/run.sh: line 15: $1: unbound variable Traceback (most recent call last): File "./fat.py", line 113, in main() File "./fat.py", line 109, in main final_run(image_id) File "./fat.py", line 89, in final_run print subprocess.check_output(final_run_cmd, shell=True) File "/usr/lib/python2.7/subprocess.py", line 573, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command 'sudo /home/oit/tools/fat//scratch/1/run.sh' returned non-zero exit status 1

i tried sudo ./reset.sh and then ./fat.py still failed. how can i solve the problem ? thank u for ur time.

Janette88 avatar Feb 12 '20 09:02 Janette88