Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

I'm receiving a 'non-zero exit status 137' error when running Nuclei as part of a script #4824

Closed
eitansha opened this issue Mar 3, 2024 · 7 comments
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@eitansha
Copy link

eitansha commented Mar 3, 2024

Hi all,

When I run Nuclei manually, everything goes well.

However, when I call it indirectly through a script that performs other tasks in between, I receive the following error from Nuclei:
'non-zero exit status 137'. Why does this happen?

The parameters/flags that I use are '-list' and '-o'.

@eitansha eitansha added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Mar 3, 2024
@dogancanbakir dogancanbakir self-assigned this Mar 3, 2024
@dogancanbakir
Copy link
Member

Can you share your script? You're receiving an exit code 137 error, which could be directly related to your script's memory usage.

@eitansha
Copy link
Author

eitansha commented Mar 4, 2024

Yes, here's the function that triggers nuclei:

def run_additional_tools():
    with open('sorted_subdomains.txt', 'r') as file:
        domains = file.read().splitlines()

    for domain in domains:
        domain = domain.replace('https://', '')  # Remove https:// for tool compatibility
        urls_file = f"{domain}_200_urls.txt"
        
        print(f"Running additional tools for domain: {domain}...")
        # Katana
        execute_command(f"katana -list {urls_file} -o {domain}_katana_results.txt")
        # Nuclei
        execute_command(f"nuclei -list {urls_file} -o {domain}_nuclei_results.txt")

@dogancanbakir
Copy link
Member

I have reviewed the code snippet you shared and cannot determine the exact cause of the OOM error you mentioned. However, I noticed that you are also running Katana, which could be a contributing factor to the error. To avoid such errors, ensure that your system has enough memory to support running multiple tools concurrently and storing the necessary data in memory.

@eitansha
Copy link
Author

eitansha commented Mar 4, 2024

Do you think running nuclei as the last tool will resolve this issue?

@dogancanbakir
Copy link
Member

This is my only suggestion since I don't know all the details -script, resource, etc.

@eitansha
Copy link
Author

eitansha commented Mar 4, 2024

I'm running this script on Ubuntu with 2 VCPUs and 2 GB of RAM. Might this not be enough?

@dogancanbakir
Copy link
Member

Better. It seems like you have tried running nuclei and did not encounter any errors. This suggests that the memory capacity of your system is sufficient for running nuclei. Similarly, if you run a script that includes only one tool, for instance, "nuclei", and it runs without any errors, it means that the memory capacity is also enough for running "nuclei" from your script. The same goes for "katana" as well. Therefore, I would suggest running one tool at a time to see how it performs. If the issue persists, try increasing the system resources and retry.

@projectdiscovery projectdiscovery locked and limited conversation to collaborators Mar 4, 2024
@dogancanbakir dogancanbakir converted this issue into discussion #4831 Mar 4, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

2 participants