adding support for unsafe host header

This commit is contained in:
Mzack9999 2020-08-23 22:15:42 +02:00
parent 671837eb38
commit 5787fbd949

View File

@ -23,6 +23,7 @@ import (
"github.com/projectdiscovery/httpx/common/slice"
"github.com/projectdiscovery/httpx/common/stringz"
"github.com/projectdiscovery/mapcidr"
"github.com/projectdiscovery/rawhttp"
"github.com/remeh/sizedwaitgroup"
)
@ -78,6 +79,14 @@ func main() {
options.rawRequest = string(rawRequest)
}
// disable automatic host header for rawhttp if manually specified
if options.Unsafe {
_, ok := httpxOptions.CustomHeaders["Host"]
if ok {
rawhttp.AutomaticHostHeader(false)
}
}
scanopts.Method = options.Method
protocol := "https"
scanopts.VHost = options.VHost