Open xavier-gerondeau-stoik opened 1 year ago
@xavier-gerondeau-stoik this is now fixed with latest release - https://github.com/projectdiscovery/nuclei/releases/tag/v2.9.10
Hi @ehsandeep,
Thanks for the fix!
It seems that the issue remains on v2.9.10
.
After updating the code to call SetWithProbe
, nuclei logs the following warnings:
{"level":"WRN","msg":"[CVE-2021-24947] Could not execute request for google.com: [raw:RUNTIME] failed to create request with url ://google.com/wp-login.php got [:RUNTIME] failed to parse url <- parse \"://google.com/wp-login.php\": missing protocol scheme <- [:RUNTIME] failed to parse url <- parse \"://google.com/wp-login.php\": missing protocol scheme","timestamp":"2023-08-09T11:55:19+0000"}
{"level":"WRN","msg":"[CVE-2021-24947] Could not make http request for https://google.com: unresolved variables found: username,password","timestamp":"2023-08-09T11:55:19+0000"}
Do you know why ?
Thanks!
Also, it seems that adding the following
+ input := &inputs.SimpleInputProvider{Inputs: inputArgs}
+
+ httpxOptions := httpx.DefaultOptions
+ httpxOptions.Timeout = 5 * time.Second
+ httpxClient, err := httpx.New(&httpxOptions)
+ if err != nil {
+ return fmt.Errorf("httpx.New: %w", err)
+ }
+ input.SetWithProbe(opts.target, httpxClient)
Like you added on the updated example in the PR.
It leads to a duplicate call of outputWriter.WriteCallback
with the same finding.
Nuclei version:
v2.9.5
Current Behavior:
I'm using the nuclei go lib to run a scan through GO code on an hostname. Httpx is automatically used to probe the host for web services in order to run HTTP based templates. However, certain templates, specifically those utilizing the http raw methods, fail to work. For instance, CVE-2010-1081 functions correctly, but CVE-2021-24947 does not. The error message is:
It seems that the protocol scheme is not appended properly to the queried URL on templates using raw http queries.
Expected Behavior:
When running nuclei on an hostname, I expect httpx to be used to identified all web services in order to run HTTP based templates.
Steps To Reproduce:
The code below is an almost exact replica of the example here https://github.com/projectdiscovery/nuclei/blob/main/v2/examples/simple.go with small modifications on the used templates and gologger configuration:
When run, you should see outputs similar to:
Anything else:
While this issue is similar to https://github.com/projectdiscovery/nuclei/issues/454, this is not the same issue. It seems that at the time, httpx was not used to probe hostname for web services (which is now the case), the current issue is about httpx integration with web based templates.