pr0v3rbs / FirmAE

Towards Large-Scale Emulation of IoT Firmware for Dynamic Analysis
MIT License
642 stars 119 forks source link

Mounted error #31

Closed JonathanGoikhman closed 2 years ago

JonathanGoikhman commented 3 years ago

Hello, First of all thank you for the great project.

After all the setup process, when I run the command sudo ./run.sh -r dlink /home/iot/Desktop/DIR823A1_FW100WWb05.bin

I get these lines: [*] /home/iot/Desktop/DIR823A1_FW100WWb05.bin emulation start!!! [*] extract done!!! [*] get architecture done!!! mke2fs 1.44.1 (24-Mar-2018) /dev/loop3p1 is mounted; will not make a filesystem here! Do you have any idea how can I fix the problem? Thank you!

pr0v3rbs commented 3 years ago

Thank you for your interest!

It seems to another firmware emulation fails while mounting the filesystem. Thus, the mounted filesystem was mismatched.

You can find the already mounted filesystem by losetup command. Go to the emulation-failed scratch directory, unmount the filesystem with umount image command. Then, remove the partition device with kpartx -d image.raw.

0xdkay commented 3 years ago

I cannot get the exact cause from the posted error message, but trying sudo losetup -D to release loop devices as @pr0v3rbs said.

YB1-cyber commented 3 years ago

@pr0v3rbs

I Released the loop devices. i unmounted + deleted the folder '/FirmAE/scratch/1' I run again , a new '1' folder + loop device is created and I still get this error: # ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin [] /root/Desktop/firmware/DIR880A1_FW107WWb08.bin emulation start!!! [] extract done!!! [*] get architecture done!!! mke2fs 1.46.4 (18-Aug-2021) e2fsck 1.46.4 (18-Aug-2021) e2fsck: Cannot continue, aborting.

==running again ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin [] /root/Desktop/firmware/DIR880A1_FW107WWb08.bin emulation start!!! [] extract done!!! [*] get architecture done!!! mke2fs 1.46.4 (18-Aug-2021) /dev/loop14p1 is mounted; will not make a filesystem here!

pr0v3rbs commented 2 years ago

@YB1-cyber Can you try again after runs the command? (sudo losetup -D)

YB1-cyber commented 2 years ago

Hi @pr0v3rbs Same behaviour BTW i downloaded the firmware from here: https://drivers.softpedia.com/get/Router-Switch-Access-Point/D-Link/D-Link-DIR-880L-RevA1-Router-Firmware-107B08.shtml

Can u try it yourself ?

This is the output of the commands I use:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
<REDACTED>
/dev/loop14p1  1006M   84M  871M   9% /media/root/5fe6a83a-7fd9-4168-b0ca-e146e76016d7

# umount /dev/loop14p1
# sudo losetup -D
# ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin
[*] /root/Desktop/firmware/DIR880A1_FW107WWb08.bin emulation start!!!
[*] extract done!!!
[*] get architecture done!!!
mke2fs 1.46.4 (18-Aug-2021)
e2fsck 1.46.4 (18-Aug-2021)
e2fsck: Cannot continue, aborting.

# df -h
Filesystem      Size  Used Avail Use% Mounted on
<REDACTED>
/dev/loop14p1  1006M   84M  871M   9% /media/root/0dbd3713-4c6e-4c76-b115-206820c0e747
pr0v3rbs commented 2 years ago

@YB1-cyber

This is my log on ubuntu20.

image

I recommend that using ubuntu18 or ubuntu20.

YB1-cyber commented 2 years ago

Hi @pr0v3rbs I can see that you use older mke2fs , e2fsck i will try to downgrade and report thanks

Ryze-T commented 2 years ago
image

The Problem still exist