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

[BUG] bqm: command not found in load_supported_setups.sh #207

Closed
gbe opened this issue Aug 15, 2023 · 8 comments · Fixed by #219
Closed

[BUG] bqm: command not found in load_supported_setups.sh #207

gbe opened this issue Aug 15, 2023 · 8 comments · Fixed by #219
Assignees
Labels
bug Something isn't working waiting for review A review is requested

Comments

@gbe
Copy link
Contributor

gbe commented Aug 15, 2023

Describe the bug

When executing the script /.exegol/load_supported_setups.sh, the script fails to find the tool bqm.
This is likely due to the change introduced before releasing the images v3.1.0 with the introduction of ruby wrappers.

Calling bqm directly from a zsh prompt works as a zsh alias exists. However, the script load_supported_setups.sh is executed by bash which does not know the alias. Hence, it fails to find the binary.

This bug breaks the support of bloodhound for my-resources.

# /.exegol/load_supported_setups.sh  
This log file is the result of the execution of the official and personal customization script
[15-08-2023_14-36-56] ==== Loading custom setups (/.exegol/load_supported_setups.sh) ====
DEPRECATION: wfuzz 3.1.0 has a non-standard dependency specifier pyparsing>=2.4*; python_version >= "3.5". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of wfuzz or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[-] No addons were found in the list /opt/my-resources/setup/firefox/addons.txt.                                                                                                                                                            
                                                                                                                                                                                                                                            
[-] No addons were found in the folder /opt/my-resources/setup/firefox/addons.                                                                                                                                                              
                                                                                                                                                                                                                                            
[-] No addons were found.                                                                                                                                                                                                                   
/.exegol/load_supported_setups.sh: line 159: bqm: command not found
[15-08-2023_14-36-57] ==== Loading user setup (/opt/my-resources/setup/load_user_setup.sh) ====
[15-08-2023_14-36-57] ==== End of custom setups loading ====

Steps To Reproduce

  1. Create a container
  2. Place a Bloodhound customqueries.json file in /opt/my-resources/setup/bloodhound/customqueries_replacement/
  3. Run /.exegol/load_supported_setups.sh

Exegol Wrapper Version

$ exegol version -vvv
[*] Exegol is currently in version v4.2.5
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏                                              
[+] We thank HackTheBox for sponsoring the multi-arch support 💚                                                     
[D] Pip installation: On ✔                                                                                           
[D] Git source installation: Off 🪓                                                                                  
[D] Host OS: HostOs.LINUX (DockerEngine.LINUX)                                                                       
[D] Arch: amd64                                                                                                      
[D] Raw arch: x86_64                                                                                                 
[D] Docker desktop: Off 🪓                                                                                           
[D] Shell type: HostOs.LINUX                                                                                         
[D] Last wrapper update check: 2023-08-10 00:00:00

Exegol container information

exegol info -vv qqq
[*] Exegol is currently in version v4.2.5
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏                                              
[+] We thank HackTheBox for sponsoring the multi-arch support 💚                                                     
[V] Listing user configurations                                                                                      

🧠 User configurations                                   
┌───────────────────────────────────────────────────────┐
│ User config file: /home/kali/.exegol/config.yml       │
│ Private workspace: /home/kali/.exegol/workspaces      │
│ Exegol resources: /home/kali/.exegol/exegol-resources │
│ My resources: /home/kali/.exegol/my-resources         │
│ Auto-check updates: On ✔                              │
│ Auto-remove images: On ✔                              │
│ Auto-update fs: Off 🪓                                │
│ Default start shell: zsh                              │
│ Shell logging method: asciinema                       │
│ Shell logging compression: On ✔                       │
└───────────────────────────────────────────────────────┘

[V] Listing git repositories                                                                                         
[!] Exegol has not been installed via git clone. Skipping wrapper auto-update operation.                             
[*] If you have installed Exegol with pip, check for an update with the command pip3 install exegol --upgrade        
[!] Exegol has not been installed via git clone. Skipping wrapper auto-update operation.                             
[*] If you have installed Exegol with pip, check for an update with the command pip3 install exegol --upgrade        

🐙 Project modules                            
┌───────────┬───────────────┬────────────────┐
│ Name      │ Status        │ Current branch │
├───────────┼───────────────┼────────────────┤
│ Wrapper   │ Not installed │ ? 🤷           │
│ Images    │ Not installed │ ? 🤷           │
│ Resources │ Up to date    │ main           │
└───────────┴───────────────┴────────────────┘


⭐ Container summary                                                                    
┌──────────────────┬───────────────────────────────────────────────────────────────────┐
│             Name │ qqq                                                               │
│            Image │ full - v.3.1.0 (Up to date) (amd64)                               │
├──────────────────┼───────────────────────────────────────────────────────────────────┤
│    Creation date │ 15/08/2023 14:14                                                  │
│              GUI │ On ✔                                                              │
│          Network │ host                                                              │
│         Timezone │ On ✔                                                              │
│ Exegol resources │ On ✔ (/opt/resources)                                             │
│     My resources │ On ✔ (/opt/my-resources)                                          │
│    Shell logging │ Off 🪓                                                            │
│       Privileged │ Off ✔                                                             │
│        Workspace │ Dedicated (/workspace)                                            │
│             Envs │ DISPLAY=:0.0                                                      │
│                  │ _JAVA_AWT_WM_NONREPARENTING=1                                     │
│                  │ QT_X11_NO_MITSHM=1                                                │
│                  │ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin │
│          Volumes │ /home/kali/.exegol/workspaces/qqq ➡ /workspace                    │
│                  │ /tmp/.X11-unix ➡ /tmp/.X11-unix                                   │
│                  │ /etc/timezone ➡ /etc/timezone (RO)                                │
│                  │ /etc/localtime ➡ /etc/localtime (RO)                              │
│                  │ /home/kali/.exegol/my-resources ➡ /opt/my-resources               │
│                  │ /home/kali/.exegol/exegol-resources ➡ /opt/resources              │
└──────────────────┴───────────────────────────────────────────────────────────────────┘

Exception

No response

Additional context

No response

Anything else?

No response

@gbe gbe added the bug Something isn't working label Aug 15, 2023
gbe pushed a commit to gbe/Exegol-images that referenced this issue Aug 25, 2023
@ShutdownRepo ShutdownRepo linked a pull request Aug 31, 2023 that will close this issue
ShutdownRepo added a commit that referenced this issue Aug 31, 2023
load_supported_setups: expand aliases to fix bug #207
@ShutdownRepo
Copy link
Member

Should be fixed in the next nightly image. Let's test when it's out and close when we know it's merged

@QU35T-code
Copy link
Member

Fixed ?

@ShutdownRepo ShutdownRepo added the waiting for review A review is requested label Sep 19, 2023
@ShutdownRepo
Copy link
Member

@gbe can you check?

@gbe
Copy link
Contributor Author

gbe commented Sep 23, 2023

No, with the move to Debian12, it's even worse.

[Sep 23, 2023 - 14:46:58 (CEST)] exegol-essai /.exegol # ./load_supported_setups.sh
This log file is the result of the execution of the official and personal customization script
[23-09-2023_14-47-03] ==== Loading custom setups (/.exegol/load_supported_setups.sh) ====
./load_supported_setups.sh: line 56: ls: command not found
./load_supported_setups.sh: line 56: ls: command not found
./load_supported_setups.sh: line 56: ls: command not found
./load_supported_setups.sh: line 56: ls: command not found
./load_supported_setups.sh: line 56: ls: command not found
./load_supported_setups.sh: line 71: mkdir: command not found
./load_supported_setups.sh: line 79: cp: command not found
./load_supported_setups.sh: line 81: mkdir: command not found
./load_supported_setups.sh: line 82: grep: command not found
./load_supported_setups.sh: line 90: rm: command not found
./load_supported_setups.sh: line 91: grep: command not found
./load_supported_setups.sh: line 91: tr: command not found
./load_supported_setups.sh: line 111: python3: command not found
./load_supported_setups.sh: line 148: python3: command not found
./load_supported_setups.sh: line 167: find: command not found
./load_supported_setups.sh: line 179: find: command not found
./load_supported_setups.sh: line 122: date: command not found
[] ==== Loading user setup (/opt/my-resources/setup/load_user_setup.sh) ====
[Exegol] Installing [green]my-resources[/green] user's defined custom setup ...
./load_supported_setups.sh: line 131: date: command not found
[] ==== End of custom setups loading ====

@gbe
Copy link
Contributor Author

gbe commented Sep 23, 2023

I manually changed the relative path to a full path where an error was returned.
Unfortunatelly, it is not enough for my-resources to work again.
It requires a bit more digging.

[Sep 23, 2023 - 15:00:18 (CEST)] exegol-essai /workspace # /.exegol/load_supported_setups.sh             
This log file is the result of the execution of the official and personal customization script
[23-09-2023_15-00-22] ==== Loading custom setups (/.exegol/load_supported_setups.sh) ====
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
  File "/opt/tools/firefox/user-setup.py", line 8, in <module>
    from setup import get_link, download_addon, read_manifest, install_addons, activate_addons
  File "/opt/tools/firefox/setup.py", line 18, in <module>
    from R2Log import logger
ModuleNotFoundError: No module named 'R2Log'
/usr/bin/env: ‘bash’: No such file or directory
[23-09-2023_15-00-23] ==== Loading user setup (/opt/my-resources/setup/load_user_setup.sh) ====
[Exegol] Installing [green]my-resources[/green] user's defined custom setup ...
[23-09-2023_15-00-23] ==== End of custom setups loading ====

@gbe
Copy link
Contributor Author

gbe commented Sep 25, 2023

The bqm issue is fixed in dev. I could successfully test it after the fixes done in #245

@ShutdownRepo
Copy link
Member

Not fixed in dev actually. Since the PR is not merged yet the fix doesn't apply to the nightly image.
Nightly will be the first image to get the fix, once the PR is merged

@ShutdownRepo
Copy link
Member

We're good it seems, please open again if you feel like the issue is not resolved in the new nightly images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for review A review is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants