minvws / nl-kat-coordination

Repo nl-kat-coordination for minvws
European Union Public License 1.2
122 stars 55 forks source link

Uncaught non-zero exit code in Nuclei boefjes #2976

Open stephanie0x00 opened 2 months ago

stephanie0x00 commented 2 months ago

Describe the bug When running the Nuclei takeover scan against mispo.es a error message is returned. This occurs on main (commit 951a52999e6905faf47427618d9afb5db9191426 (HEAD -> main, origin/main, origin/HEAD))

This exact error also occurs with the following boefjes:

To Reproduce Steps to reproduce the behavior:

  1. Give mispo.es sufficient clearance.
  2. Enable the Nuclei takeover scan boefje
  3. Look for failed tasks in the tasks list and download the raw file for Nuclei
  4. See error

Expected behavior The boefje runs without errors and the data is parsed properly.

boefje-1  | [2024-05-21 10:18:54 +0000] [16] [ERROR] [job_handler] Error running boefje nuclei-takeover[f4578a4c-5113-4478-aceb-6f7f4832bc20]
boefje-1  | Traceback (most recent call last):
boefje-1  |   File "/app/boefjes/boefjes/local.py", line 54, in run
boefje-1  |     return boefje_resource.module.run(boefje_meta)
boefje-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
boefje-1  |   File "/app/boefjes/boefjes/plugins/kat_nuclei_take_over/main.py", line 24, in run
boefje-1  |     output = client.containers.run(
boefje-1  |              ^^^^^^^^^^^^^^^^^^^^^^
boefje-1  |   File "/usr/local/lib/python3.11/site-packages/docker/models/containers.py", line 902, in run
boefje-1  |     raise ContainerError(
boefje-1  | docker.errors.ContainerError: Command '['-t', '/root/nuclei-templates/http/takeovers/', '-u', 'mispo.es:443', '-jsonl']' in image 'projectdiscovery/nuclei:v3.2.4' returned non-zero exit status 1: b"\n                     __     _\n   ____  __  _______/ /__  (_)\n  / __ \\/ / / / ___/ / _ \\/ /\n / / / / /_/ / /__/ /  __/ /\n/_/ /_/\\__,_/\\___/_/\\___/_/   v3.2.4\n\n\t\tprojectdiscovery.io\n\n[\x1b[34mINF\x1b[0m] nuclei-templates are not installed, installing...\n[\x1b[34mINF\x1b[0m] Your current nuclei-templates  are outdated. Latest is v9.8.6\n[\x1b[31mERR\x1b[0m] Could not find template '/root/nuclei-templates/http/takeovers/': could not find file: stat /root/nuclei-templates/http/takeovers: no such file or directory\n[\x1b[33mWRN\x1b[0m] Found 1 template[s] loaded with deprecated paths, update before v3 for continued support.\n[\x1b[34mINF\x1b[0m] Current nuclei version: v3.2.4 (\x1b[91moutdated\x1b[0m)\n[\x1b[34mINF\x1b[0m] Current nuclei-templates version:  (\x1b[91moutdated\x1b[0m)\n[\x1b[93mWRN\x1b[0m] Scan results upload to cloud is disabled.\n[\x1b[34mINF\x1b[0m] Targets loaded for current scan: 1\n[\x1b[34mINF\x1b[0m] No results found. Better luck next time!\n[\x1b[1;31mFTL\x1b[0m] Could not run nuclei: no templates provided for scan\n"
boefje-1  | 
boefje-1  | The above exception was the direct cause of the following exception:
boefje-1  | 
boefje-1  | Traceback (most recent call last):
boefje-1  |   File "/app/boefjes/boefjes/job_handler.py", line 143, in handle
boefje-1  |     boefje_results = self.job_runner.run(boefje_meta, boefje_meta.environment)
boefje-1  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
boefje-1  |   File "/app/boefjes/boefjes/local.py", line 56, in run
boefje-1  |     raise JobRuntimeError("Boefje failed") from e
boefje-1  | boefjes.runtime_interfaces.JobRuntimeError: Boefje failed
boefje-1  | [2024-05-21 10:18:54 +0000] [16] [INFO] [job_handler] Saving to Bytes for boefje nuclei-takeover[f4578a4c-5113-4478-aceb-6f7f4832bc20]
ammar92 commented 2 months ago

Perhaps you could share your raw output?

stephanie0x00 commented 2 months ago

This is the raw output file:

Traceback (most recent call last):
  File "/app/boefjes/boefjes/local.py", line 54, in run
    return boefje_resource.module.run(boefje_meta)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/boefjes/boefjes/plugins/kat_nuclei_exposed_panels/main.py", line 24, in run
    output = client.containers.run(
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/models/containers.py", line 902, in run
    raise ContainerError(
docker.errors.ContainerError: Command '['-t', '/root/nuclei-templates/http/exposed-panels/', '-u', 'mispo.es:443', '-jsonl']' in image 'projectdiscovery/nuclei:v3.2.4' returned non-zero exit status 1: b"\n                     __     _\n   ____  __  _______/ /__  (_)\n  / __ \\/ / / / ___/ / _ \\/ /\n / / / / /_/ / /__/ /  __/ /\n/_/ /_/\\__,_/\\___/_/\\___/_/   v3.2.4\n\n\t\tprojectdiscovery.io\n\n[\x1b[34mINF\x1b[0m] nuclei-templates are not installed, installing...\n[\x1b[34mINF\x1b[0m] Your current nuclei-templates  are outdated. Latest is v9.8.6\n[\x1b[31mERR\x1b[0m] Could not find template '/root/nuclei-templates/http/exposed-panels/': could not find file: stat /root/nuclei-templates/http/exposed-panels: no such file or directory\n[\x1b[33mWRN\x1b[0m] Found 1 template[s] loaded with deprecated paths, update before v3 for continued support.\n[\x1b[34mINF\x1b[0m] Current nuclei version: v3.2.4 (\x1b[91moutdated\x1b[0m)\n[\x1b[34mINF\x1b[0m] Current nuclei-templates version:  (\x1b[91moutdated\x1b[0m)\n[\x1b[93mWRN\x1b[0m] Scan results upload to cloud is disabled.\n[\x1b[34mINF\x1b[0m] Targets loaded for current scan: 1\n[\x1b[34mINF\x1b[0m] No results found. Better luck next time!\n[\x1b[1;31mFTL\x1b[0m] Could not run nuclei: no templates provided for scan\n"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/boefjes/boefjes/job_handler.py", line 143, in handle
    boefje_results = self.job_runner.run(boefje_meta, boefje_meta.environment)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/boefjes/boefjes/local.py", line 56, in run
    raise JobRuntimeError("Boefje failed") from e
boefjes.runtime_interfaces.JobRuntimeError: Boefje failed
underdarknl commented 2 months ago

@noamblitz has done some work on these templates with the guys from Surf, maybe its just a case of updating the nuclei boefje image?