Open y198nt opened 1 year ago
This is likely due to a bug in extractor.py in firmadyne.
As a workaround, you can first manually extract the img using binwalk and then run fat.py on the extracted squashfs.
$ binwalk -e ./RAX30-V1.0.9.92_1.img
$ ./fat.py _RAX30-V1.0.9.92_1.img.extracted/777EAC.squashfs
yeah it was working but I can find any Network interfaces
/ _| | |
| |_ __ _ | |_
| _| / _` | | __|
| | | (_| | | |_
|_| \__,_| \__|
Welcome to the Firmware Analysis Toolkit - v0.3
Offensive IoT Exploitation Training http://bit.do/offensiveiotexploitation
By Attify - https://attify.com | @attifyme
[+] Firmware: 777EAC.squashfs [+] Extracting the firmware... [+] Image ID: 1 [+] Identifying architecture... [+] Architecture: armel [+] Building QEMU disk image... [+] Setting up the network connection, please standby... [+] Network interfaces: [] [+] All set! Press ENTER to run the firmware... [+] When running, press Ctrl + A X to terminate qemu
this is qemu.initial.serial.log
[ 0.453858] [
and I don't know it end with [ 1.721588] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004. Normally when I use fat for .bin file, it always working successfully without any error, but when using fat for netgear router, there are a lot of error
Yes it crashes with a kernel panic and that's why no network interfaces are detected. There is no generalized way to solve such issues. This will need more research to identify the reason for the panic.
The reason for the crash might be due to an invalid instruction.
FATAL: kernel too old
[ 1.675091] init (1): undefined instruction: pc=00010354
I still don't know why it keeps saying KERNEL TOO OLD although I've install kernel 6.0.0-060000-generic version
I still don't know why it keeps saying KERNEL TOO OLD although I've install kernel 6.0.0-060000-generic version
The error message is about the firmadyne kernel. Not the kernel on the host OS. In addition I would also suggest looking at the address 00010354
. The instruction at that address is tripping qemu.
where is the kernel file which contain 00010354
address
where is the kernel file which contain
00010354
address
zImage.armel in https://github.com/firmadyne/kernel-v4.1/releases/tag/v1.1
┌──(ayman㉿kali)-[~/Downloads/firmware-analysis-toolkit/firmadyne] └─$ sudo ./fat.py Gaw5.6T02-4-DL-R1B020-ME.EN_upgrade(0322113411).en_upgrade
__ _
/ _| | |
| |_ __ _ | |_
| _| / _` | | __|
| | | (_| | | |_
|_| \__,_| \__|
Welcome to the Firmware Analysis Toolkit - v0.3
Offensive IoT Exploitation Training http://bit.do/offensiveiotexploitation
By Attify - https://attify.com | @attifyme
[+] Firmware: Gaw5.6T02-4-DL-R1B020-ME.EN_upgrade(0322113411).en_upgrade
[+] Extracting the firmware...
Traceback (most recent call last):
File "/home/ayman/Downloads/firmware-analysis-toolkit/firmadyne/./fat.py", line 172, in
help please
@sdahiasdba Please create a new issue with a link to the firmware. In general, not all firmware will work right out of the box. Here it fails right on the extraction step, so the issue should be in the extraction part.
The firmware that was used is http://www.downloads.netgear.com/files/GDC/WNAP320/WNAP320%20Firmware%20Version%202.0.3.zip and it has been extracted previously using the binwalk tool.
can anyone help me with this, this error occurs when I try to using fat with RAX30 router firmware every version [+] Firmware: RAX30-V1.0.9.92_1.img [+] Extracting the firmware... Traceback (most recent call last): File "/home/browser/working_station/iot/firmware-analysis-toolkit/./fat.py", line 173, in
main()
File "/home/browser/working_station/iot/firmware-analysis-toolkit/./fat.py", line 161, in main
image_id = run_extractor(args.firm_path)
File "/home/browser/working_station/iot/firmware-analysis-toolkit/./fat.py", line 55, in run_extractor
child.expect_exact("Tag: ")
File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 421, in expect_exact
return exp.expect_loop(timeout)
File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 179, in expect_loop
return self.eof(e)
File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 122, in eof
raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fae3cf953f0>
command: /usr/bin/sudo
args: ['/usr/bin/sudo', '--', '/home/browser/working_station/iot/firmware-analysis-toolkit/firmadyne/sources/extractor/extractor.py', '-np', '-nk', '../CVE-2023-24749/RAX30-V1.0.9.92_1.img', '/home/browser/working_station/iot/firmware-analysis-toolkit/firmadyne/images']
buffer (last 100 chars): b''
before (last 100 chars): b'24749/RAX30-V1.0.9.92_1.img\r\n>> MD5: 49241d7f2502d60e14e8f6005116fe3d\r\n>> Skipping: image/g3fax...\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 4803
child_fd: 5
closed: False
timeout: None
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_string:
0: b'Tag: '