Closed manihalvifred closed 2 years ago
Thank you for your issue!
Running binwalk
with the root user is may unsafe, because of the third-party utilities.
However, the run.sh
script is working with the root user. Thus, the --run-as=root
command was added in the extractor.py
.
As described in the binwalk
script, be careful of third-party utilities.
Im afraid it now raises a new issue ...
# ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin
[*] /root/Desktop/firmware/DIR880A1_FW107WWb08.bin emulation start!!!
General Error: Cannot open file --run-as=root (CWD: /tmp/tmps7l2ay4u) : [Errno 2] No such file or directory: '--run-as=root'
@YB1-cyber
It still needs to run with the root user.
Try this sudo ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin
command.
@pr0v3rbs
Im Already root user that's why sudo
is missing in the command.
(anyway i checked also with sudo before i commented.)
# sudo ./run.sh -d tplink /root/Desktop/firmware/DIR880A1_FW107WWb08.bin
[*] /root/Desktop/firmware/DIR880A1_FW107WWb08.bin emulation start!!!
General Error: Cannot open file --run-as=root (CWD: /tmp/tmpgm2pp_2h) : [Errno 2] No such file or directory: '--run-as=root'
Traceback (most recent call last): File "/root/Desktop/FirmAE/./sources/extractor/extractor.py", line 445, in extract for module in binwalk.scan(self.item, "--run-as=root", "-e", "-r", "-C", self.temp, File "/usr/lib/python3/dist-packages/binwalk/init.py", line 10, in scan objs = m.execute() File "/usr/lib/python3/dist-packages/binwalk/core/module.py", line 783, in execute obj = self.run(module) File "/usr/lib/python3/dist-packages/binwalk/core/module.py", line 802, in run obj = self.load(module, kwargs) File "/usr/lib/python3/dist-packages/binwalk/core/module.py", line 833, in load argv.update(self.dependencies(module, argv['enabled'])) File "/usr/lib/python3/dist-packages/binwalk/core/module.py", line 865, in dependencies raise ModuleException("Failed to load " + dependency.name + " module") binwalk.core.exceptions.ModuleException: Failed to load General module
thanks
@YB1-cyber
Can you try after reinstalling the binwalk?
Check this command python3 -m pip install git+https://github.com/ReFirmLabs/binwalk
.
same error...
# python3 -m pip install git+https://github.com/ReFirmLabs/binwalk
Collecting git+https://github.com/ReFirmLabs/binwalk
Cloning https://github.com/ReFirmLabs/binwalk to /tmp/pip-req-build-fh9ig121
Running command git clone -q https://github.com/ReFirmLabs/binwalk /tmp/pip-req-build-fh9ig121
Building wheels for collected packages: binwalk
Building wheel for binwalk (setup.py) ... done
Created wheel for binwalk: filename=binwalk-2.3.3+fa0c0bd-py3-none-any.whl size=135413 sha256=45af1106e0f68ba61ba68d36d588e6d9b3a45b1ebc374047a7a18b5fedeaa562
Stored in directory: /tmp/pip-ephem-wheel-cache-4bd365is/wheels/c0/a5/3b/542feb60450a355008411f9ce955c66df12475959305a35faa
Successfully built binwalk
Installing collected packages: binwalk
Attempting uninstall: binwalk
Found existing installation: binwalk 2.3.2
Not uninstalling binwalk at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'binwalk'. No files were found to uninstall.
Successfully installed binwalk-2.3.3+fa0c0bd
# uname -a
Linux kali 5.10.0-kali9-amd64 #1 SMP Debian 5.10.46-4kali1 (2021-08-09) x86_64 GNU/Linux
It seems the recent binwalk is not compatible with the root
user (But, sudo
executing looks to work well).
I'm checking now. Thank you for your issue!
@pr0v3rbs thanks, i'll wait pls ping me when there're good news
@YB1-cyber
There are multiple issues on binwalk 2.3.3 such as extracting symbolic link files about the root (/
) directory and root user permission.
I currently set the binwalk version 2.3.1. (Check install.sh
)
The command changed with python3 -m pip install git+https://github.com/ReFirmLabs/binwalk@772f271
.
Please reinstall with the 2.3.1 version binwalk and try again! I will check the compatibility with the latest binwalk.
Thank you!
after a new clean install ...
# binwalk
Binwalk v2.3.2
# ./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.
(although volume is mounted on /dev/loop14p1)
@YB1-cyber
It seems the problem of the binwalk was solved.
About the mounted error issue, please check this issue #31.
Thank you!
In FirmAE/sources/extractor/extractor.py on line 445 add --run-as=root
to binwalk-scan
. This will allow binwalk to run as expected.
for module in binwalk.scan(self.item, "--run-as=root", "-e", "-r", "-C", self.temp,
signature=True, quiet=True):
I added PR #36 to address this issue.
@loverics Check this https://github.com/pr0v3rbs/FirmAE/pull/36#issuecomment-962585681.
@loverics Thank you!
Great!
Thanks a lot. I Will be testing it with my students next week.
Kind regards,
Mick Beer
Op zo 31 jul. 2022 om 11:18 schreef Mingeun Kim @.***>
This issue was fixed in 6911f56 https://github.com/pr0v3rbs/FirmAE/commit/6911f56d92937b0d30bb58ab36d622c31a97a1ee
— Reply to this email directly, view it on GitHub https://github.com/pr0v3rbs/FirmAE/issues/33#issuecomment-1200385427, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATNYJ77YT72JVPAY2JFAMX3VWZAGNANCNFSM5E5BHUDA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Just tested this on 2 freshly installed Ubuntu machines. When trying to run FirmAE, binwalk seems to throw some errors related to its running uid.