pr0v3rbs / FirmAE

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

Check/Make binaries executable #22

Closed combat-entropy closed 2 years ago

combat-entropy commented 3 years ago

In testing with Archer VR600v v170814 firmware which is downloadable from https://static.tp-link.com/Archer_VR600v(EU)_V2_170814.zip .

Trying to run the firmware I would always get "Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance."

In attempting to resolve this I noticed many of the binaries where not marked as executable. I modified the image.raw file by mounting it and blindly changing the permission of everything via and chmod -R 777

After the image.raw was modified I commented out lines 189,190 in run.sh so it would not overwrite my modified image.

With that changed FirmAE is able to get the firmware to boot somewhat, its progressing past the init errors but seemingly the webserver is not starting or finding the network (which so far I have not been able to figure out - any help would be appreciated).

I don't know how commonly executable have incorrect permissions but this might be something worth checking before trying to emulate a given firmware.

pr0v3rbs commented 3 years ago

Thank you for your work!

It needs to fix the permissions when the extracted files cannot determine the original permission.

I will update this issue on the next update. Thank you!