firmware-analysis-toolkit
firmware-analysis-toolkit copied to clipboard
Error running fat.py with Netgear R9000 firmware
I followed all of the instructions in the README. FIRMWARE_DIR is set to the proper location (in my case that is at /home/test/firmadyne/. I also copied fat.py and reset.py into the firmadyne directory.
python fat.py /home/test/R9000-V1.0.4.12.img
__ _
/ _| | |
| |_ __ _ | |_
| _| / _` | | __|
| | | (_| | | |_
|_| \__,_| \__|
Welcome to the Firmware Analysis Toolkit - v0.2
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 : /home/test/R9000-V1.0.4.12.img
[?] Enter the brand of the firmware : netgear
[+] Now going to extract the firmware. Hold on..
[+] Firmware : /home/test/R9000-V1.0.4.12.img
[+] Brand : netgear
[+] Database image ID : 1
[+] Identifying architecture
[+] Architecture : armel
[+] Storing filesystem in database
[+] Building QEMU disk image
Traceback (most recent call last):
File "fat.py", line 122, in <module>
main()
File "fat.py", line 116, in main
make_image(arch, image_id)
File "fat.py", line 82, in make_image
child.expect(pexpect.EOF)
File "/home/test/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 341, in expect
timeout, searchwindowsize, async_)
File "/home/test/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 369, in expect_list
return exp.expect_loop(timeout)
File "/home/test/.local/lib/python2.7/site-packages/pexpect/expect.py", line 119, in expect_loop
return self.timeout(e)
File "/home/test/.local/lib/python2.7/site-packages/pexpect/expect.py", line 82, in timeout
raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f80968bf650>
command: /usr/bin/sudo
args: ['/usr/bin/sudo', '/home/test/firmadyne/scripts/makeImage.sh', '1', 'armel']
buffer (last 100 chars): '[sudo] password for test: \r\nSorry, try again.\r\n[sudo] password for test: '
before (last 100 chars): '[sudo] password for test: \r\nSorry, try again.\r\n[sudo] password for test: '
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 17515
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: EOF
Looks like you've not provided the root password in fat.py and reset.py. This is what the error message says command: /usr/bin/sudo
args: ['/usr/bin/sudo', '/home/test/firmadyne/scripts/makeImage.sh', '1', 'armel']
buffer (last 100 chars): '[sudo] password for test: \r\nSorry, try again.\r\n[sudo] password for test: '
before (last 100 chars): '[sudo] password for test: \r\nSorry, try again.\r\n[sudo] password for test: '
after: <class 'pexpect.exceptions.TIMEOUT'>
And this where you need to provide the password https://github.com/attify/firmware-analysis-toolkit/blob/fa5d8f4639dff045c80519d693630debd17d0439/fat.py#L10-L14
https://github.com/attify/firmware-analysis-toolkit/blob/fa5d8f4639dff045c80519d693630debd17d0439/reset.py#L5-L7