projectdiscovery / nuclei

Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
https://docs.projectdiscovery.io/tools/nuclei
MIT License
20.86k stars 2.52k forks source link

[BUG] Headless Options fails to split properly when comma is present in option value #5743

Closed r3naissance closed 3 weeks ago

r3naissance commented 1 month ago

Is there an existing issue for this?

Current Behavior

nuclei -target http://testphp.vulnweb.com -headless -nh -ho '--window-size=1280,800'

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.3.4

                projectdiscovery.io

[FTL] Could not create runner: [launcher] Failed to get the debug url: [1017/214522.609371:ERROR:command_line_handler.cc(103)] Malformed window size: 1280

Expected Behavior

Seems like the https://github.com/projectdiscovery/nuclei/blob/dev/cmd/nuclei/main.go#L408 is the cause of the issue where goflags.FileCommaSeparatedStringSliceOptions

Perhaps we could use a substitute character (':' || 'x')..?

-ho '--window-size=1280:800' OR -ho '--window-size=1280x800'

Then when the String[] is split on commas, logic could be added to replace the substitute character back to a comma?

I attempted to escape the comma but would throw the same error Malformed window size: 1280\,800

Steps To Reproduce

nuclei -target http://testphp.vulnweb.com -headless -nh -ho '--window-size=1280,800'

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.3.4

                projectdiscovery.io

[FTL] Could not create runner: [launcher] Failed to get the debug url: [1017/214522.609371:ERROR:command_line_handler.cc(103)] Malformed window size: 1280

Relevant log output

No response

Environment

Anything else?

:heart: ProjectDiscovery!

dogancanbakir commented 1 month ago

As a workaround, you can try '`--window-size=1280,800`'