Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run sudo ./installer.sh in a gitpod.io instance and receive an error #1239

Open
matthewluallen opened this issue Jul 18, 2024 · 9 comments
Open
Labels
EMBA help wanted Extra attention is needed Installation Installation issues stale unsupported Unsupported environment

Comments

@matthewluallen
Copy link

Describe the bug
CONTAINER VARIABLE SET TO embeddedanalyzer/emba:1.4.1e
1.4.1e: Pulling from embeddedanalyzer/emba
beda2df076e1: Pull complete
6c6558834121: Pull complete
641795abd7ee: Pull complete
c862cf65afdb: Pull complete
66dd883588f6: Pull complete
f381de0b2824: Extracting [==================================================>] 5.38GB/5.38GB
b5b62e8906aa: Download complete
failed to register layer: failed to Lchown "/root/.cpanm/work/1719916562.221739/Number-Compare-0.03" for UID 831580115, GID 755412454 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /root/.cpanm/work/1719916562.221739/Number-Compare-0.03: invalid argument

Error detected - status code 1
Command: echo -e "Command: ${ORANGE}${BASH_COMMAND}${NC}"
Location: ./installer/I05_emba_docker_image_dl.sh, line 52
Stack Trace:
[1] I05_emba_docker_image_dl(): ./installer/I05_emba_docker_image_dl.sh, line 52 -> I05_emba_docker_image_dl
[2] main(): ./installer.sh, line 333 -> main -d

Important: Consider filling out a bug report at https://github.com/e-m-b-a/emba/issues


gitpod /workspace/emba (master) $

To Reproduce
Steps to reproduce the behavior:

  1. open github emba repository at https://github.com/e-m-b-a/emba in gitpod.io with 8 cores and 16 gb of ram
  2. Run sudo ./installer.sh

Priority issue
Are you already a [Sponsor]? - N

Additional context
Trying to run emba in a gitpod.io workspace so that it is simple to get started with. Produces the above error after running install shell script.

Copy link

Thank you for contributing an issue!

Welcome to the EMBA firmware analysis community!

We are glad you are here and appreciate your contribution. Please keep in mind our contributing guidelines here and here.
Also, please check existing open issues and consider to open a discussion in the dedicated discussion area.
Additionally, we have collected a lot of details around EMBA, the installation and the usage of EMBA in our Wiki.

If you like EMBA you have the chance to support us by becoming a Sponsor or buying some beer here.

To show your love for EMBA with nice shirts or other merch you can check our Spreadshop.

This is an automatic message. Allow for time for the EMBA community to be able to read the issue and comment on it.

@m-1-k-3 m-1-k-3 added help wanted Extra attention is needed Installation Installation issues unsupported Unsupported environment EMBA labels Jul 18, 2024
@m-1-k-3
Copy link
Member

m-1-k-3 commented Jul 18, 2024

I am not familiar with such an environment but it looks as there are initial issues in setting up the EMBA base image. If you get it running we are very interested in a little tutorial or something like this.

@matthewluallen
Copy link
Author

I ""believe that I was able"" to get this to work by building from source instead of the containers. It would be great to provide the tutorial .. gitpod.io is so helpful. I just spun up an 8 core, 16 gb environment that is free for the first several hours of use per month. I will now start testing the tools.

sudo docker-compose build emba

@m-1-k-3
Copy link
Member

m-1-k-3 commented Jul 19, 2024

This means you did a developer installation on the host with sudo ./installer.sh -F

@santubb
Copy link

santubb commented Jul 19, 2024

Have you solved this problem?
Could you please tell me how to solve it?

@matthewluallen
Copy link
Author

I am still working through this. I noted in my earlier comment that I was able to get an environment installed. The question is if it is working. No :-(. I downloaded an image (please recognize that I was just introduced to EMBA 2 days ago) and tried to analyze it.

There are two sections to this posted comment

results of

(#1) # sudo ./emba -l ./log -f ./IoTGoat-raspberry-pi2.img
(two set of results are split by &&&&&&&&&&)

results of

(#2) # sudo ./installer.sh -F. ((two iterations))

(#1) First results below.

sudo ./emba -l ./log -f ./IoTGoat-raspberry-pi2.img

[*] Fri Jul 19 14:17:25 UTC 2024 - Enable python virtual environment ./external/emba_venv

[+] Dependency check

[*] Network connection:
Internet connection - ok
EMBA release version - ok
Error: No such object: embeddedanalyzer/emba:latest
Docker image version - Updates available
EMBA github version - ok
head: cannot open './external/nvd-json-data-feeds/.git/refs/heads/main' for reading: No such file or directory
CVE database version - Updates available
ChatGPT-API key not set - see https://github.com/e-m-b-a/emba/wiki/AI-supported-firmware-analysis for more information

[*] Elementary:
user permission - ok
Docker compose version - docker compose ok
Docker-compose EMBA image version - ok
configuration directory - ok
Python virtual environment - ok

[*] Load kernel modules on host system:
modprobe: FATAL: Module ufs not found in directory /lib/modules/6.1.91-060191-generic
modprobe: FATAL: Module nandsim not found in directory /lib/modules/6.1.91-060191-generic
modprobe: FATAL: Module ubi not found in directory /lib/modules/6.1.91-060191-generic
modprobe: FATAL: Module nbd not found in directory /lib/modules/6.1.91-060191-generic
ufs kernel module - not ok
nandsim kernel module - not ok
ubi kernel module - not ok
nbd kernel module - not ok

[*] Necessary utils on system:
docker - ok
docker-compose - ok
inotifywait - ok
notify-send - ok

[!] Warning

There are files in the specified directory: ./log
You can now delete the content here or start the tool again and specify a different directory.

[*] A finished EMBA firmware test was found in the log directory

Delete content of log directory: ./log ?

(Y/n) Y

Sucessfully deleted: ./log

[!] Warning

It appears that there are log files in the EMBA directory.
You should move these files to another location where they won't be exposed to the Docker container.
    ./logs/emba.log
    ./logs/orig_user.log

Continue to run EMBA and ignore this warning?

(Y/n) Y

[] Fri Jul 19 14:17:31 UTC 2024 - Started kernel downloader thread with PID 10634
[
] Fri Jul 19 14:17:31 UTC 2024 - Original user: gitpod
[] Fri Jul 19 14:17:31 UTC 2024 - Notification process started with PID 10649
[
] Fri Jul 19 14:17:31 UTC 2024 - Firmware binary detected.
EMBA starts with the pre-testing phase.

[!] WARNING: EMBA is running with 1 modules in parallel and 1 threads per module.
[!] This scan could take a very long time ...

[*] Fri Jul 19 14:17:31 UTC 2024 - EMBA sets up the docker environment.

[*] Fri Jul 19 14:17:31 UTC 2024 - EMBA initializes docker container.

╔═══════════════════════════════════════════════════════════════╗
║ E M B A ║
║ EMBEDDED FIRMWARE ANALYZER ║
╚═══════════════════════════════════════════════════════════════╝
[+] Fri Jul 19 14:17:32 UTC 2024 - Quest container ded2688312c11cef81dcc98040fec17f071bf1bd89932bc61067f3bbd1af150a started and detached.

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /dev/console: permission denied: unknown
[-] Fri Jul 19 14:17:37 UTC 2024 - Test ended on Fri Jul 19 14:17:37 UTC 2024 and EMBA failed in docker mode!
[] Fri Jul 19 14:17:37 UTC 2024 - Final cleanup started.
[
] Fri Jul 19 14:17:37 UTC 2024 - Stopping Quest Container ...
ded2688312c11cef81dcc98040fec17f071bf1bd89932bc61067f3bbd1af150a
[] Fri Jul 19 14:17:37 UTC 2024 - Stopping kernel downloader thread with PID 10634
[
] Fri Jul 19 14:17:38 UTC 2024 - Stopping EMBA process with PID 10681

&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&

(#2) Second results below. ((two iterations)

Noting the /dev/console error, I attempted to use the recent comment about developer mode (after struggling through asking questions an LLM agent that I trained on this repo's documents). It wanted me to install the linux headers and some other commands. That went into a dark hole of pain. I did have some challenges with the -F switch but I fixed that by running #sudo /bin/mkdir -p /home/linuxbrew/.cache/Homebrew

#sudo ./installer.sh -F. ((two iterations))

(1st iteration with homebrew permission error)
==> /usr/bin/sudo /bin/chown -R linuxbrew:linuxbrew /home/linuxbrew/.linuxbrew/Homebrew
/bin/mkdir: cannot create directory ‘/home/linuxbrew/.cache’: Permission denied
Failed during: /bin/mkdir -p /home/linuxbrew/.cache/Homebrew

Error detected - status code 1
Command: echo -e "Command: ${ORANGE}${BASH_COMMAND}${NC}"
Location: ./installer/I01_default_apps.sh, line 92
Stack Trace:
[1] I01_default_apps(): ./installer/I01_default_apps.sh, line 92 -> I01_default_apps
[2] main(): ./installer.sh, line 329 -> main -F

Important: Consider filling out a bug report at https://github.com/e-m-b-a/emba/issues


gitpod /workspace/emba (master) $ /bin/mkdir -p /home/linuxbrew/.cache/Homebrew
/bin/mkdir: cannot create directory ‘/home/linuxbrew/.cache’: Permission denied
gitpod /workspace/emba (master) $ sudo /bin/mkdir -p /home/linuxbrew/.cache/Homebrew

(2nd iteration)
#sudo ./installer.sh -F. --> this is still running as I type this. Enough information for this comment :-)

########
########
Thank you for your help and interest. My goal was to do some quick tests to see if we could use this platform for students performing some work with this tool. It is obvious to me that the community is doing some great work here, so here to support as best that I can.

@matthewluallen
Copy link
Author

#sudo ./installer.sh -F (2nd iteration) eventually errored out as well.

Cloning into '/root/.local/share/radare2/r2pm/git//r2dec'...
remote: Enumerating objects: 160, done.
remote: Counting objects: 100% (160/160), done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 160 (delta 39), reused 95 (delta 17), pack-reused 0
Receiving objects: 100% (160/160), 480.29 KiB | 12.98 MiB/s, done.
Resolving deltas: 100% (39/39), done.
INFO: Starting install for r2dec
INFO: R2PM_NEEDS: Found gcc in PATH
INFO: R2PM_NEEDS: Found make in PATH
INFO: R2PM_NEEDS: Found ninja in PATH
INFO: R2PM_NEEDS: Found meson in PATH
INFO: SCRIPT=<<EOF
INFO: meson -Dr2_plugdir=${R2PM_PLUGDIR} b --wipe || exit 1
ninja -C b || exit 1
ninja -C b install || exit 1
INFO: EOF
Directory does not contain a valid build tree:
/root/.local/share/radare2/r2pm/git/r2dec/b
Installed r2 plugins:

Error detected - status code 1
Command: echo -e "Command: ${ORANGE}${BASH_COMMAND}${NC}"
Location: ./installer/I13_disasm.sh, line 110
Stack Trace:
[1] I13_disasm(): ./installer/I13_disasm.sh, line 110 -> I13_disasm
[2] main(): ./installer.sh, line 331 -> main -F

Important: Consider filling out a bug report at https://github.com/e-m-b-a/emba/issues

@m-1-k-3
Copy link
Member

m-1-k-3 commented Aug 4, 2024

Full install is only supported and tested on Kali Linux

Copy link

github-actions bot commented Sep 2, 2024

This issue is stale because it has been open for 28 days with no activity.

@github-actions github-actions bot added the stale label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EMBA help wanted Extra attention is needed Installation Installation issues stale unsupported Unsupported environment
Projects
None yet
Development

No branches or pull requests

3 participants