maurosoria / dirsearch

Web path scanner
11.57k stars 2.29k forks source link

Broken output folder name when scheme isn't provided #1357

Open shelld3v opened 5 months ago

shelld3v commented 5 months ago

What is the current behavior?

When you provide a target without an URI scheme (-u example.com), the URI scheme will be missing in the output folder name, as below

image

What is the expected behavior?

Because dirsearch detects the scheme anyway, the scheme should appear in the folder name, as below

image

maurosoria commented 5 months ago

This should be easy to fix. Moreover, was the older behaviour

shelld3v commented 5 months ago

This should be easy to fix. Moreover, was the older behaviour

The fix is probably performing scheme detection before the creation of the report folder, I will work on this when I have time

nrathaus commented 2 months ago

I believe offending code is inside def setup_reports(self):

parsed = urlparse(options["urls"][0]) on: scanme.nmap.org returns no scheme

In def set_target(self, url):

When there is no scheme the code detect_scheme(host, port) is called, which returns http or https depending on the port provided

We could use the same in setup_reports