Skip to content

[FEATURE] -maxtime maximum testing time per host (soft kill) and -jsonl writes directly to disk #5823

@JaneX8

Description

@JaneX8

Describe your feature request

On rare occasions nuclei hangs and doesn't stop the process. This is very inconvenient for unattended runs. I supply a hardkill switch simply by running nuclei with prefixed timeout 600 for example. However, this is not a neat way of doing things, as it hard kills the process and all previous findings and output is lost this way.

-mt,   -max-time int  sets maximum runtime before nuclei auto-stops (example -mt 1d)

The security scanner Nikto.pl had an -maxtime option for 'Maximum testing time per host' effectively a soft-kill, which stopped the scan after the maximum time was hit and saving the output to disk. For example mid-scan the following would happen and the process would gracefully close after writing the output:

+ ERROR: Host maximum execution time of 600 seconds reached
+ Scan terminated: 0 error(s) and 6 item(s) reported on remote host
+ End Time:           2024-11-14 19:10:32 (GMT0) (4 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

I would like a -maxtime option for nuclei too to achieve this.

In addition I think the behaviour of -jsonl should be changed too. Because the JSONLines format is perfect for directly writing each finding to disk when it's known instead of keeping it in memory. This way even if a process is hard killed the findings, up to that moment are still saved in the jsonl file.

Describe the use case of the feature

See previous description. In essence long running scans with hanging processes.

Describe alternatives you've considered

See description above. Hard-kill and different behaviour of -jsonl.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type: EnhancementMost issues will probably ask for additions or changes.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions