From 02558cacad0a17251f24b7bc950c933b1b3342d9 Mon Sep 17 00:00:00 2001 From: Dogan Can Bakir <65292895+dogancanbakir@users.noreply.github.com> Date: Wed, 15 May 2024 15:06:47 +0300 Subject: [PATCH] change `-tech-detect` flag var type (#1702) --- cmd/integration-test/library.go | 2 +- runner/options.go | 6 +++--- runner/runner.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/integration-test/library.go b/cmd/integration-test/library.go index 4a06daafc..059fa4119 100644 --- a/cmd/integration-test/library.go +++ b/cmd/integration-test/library.go @@ -74,7 +74,7 @@ func (h *httpxLibraryWithStream) Execute() error { RateLimit: 150, Retries: 2, Timeout: 10, - TechDetect: "true", + TechDetect: true, Stream: true, SkipDedupe: true, OnResult: func(r runner.Result) { diff --git a/runner/options.go b/runner/options.go index 79c2637bf..8a94fceb9 100644 --- a/runner/options.go +++ b/runner/options.go @@ -76,7 +76,7 @@ type ScanOptions struct { PreferHTTPS bool NoFallback bool NoFallbackScheme bool - TechDetect string + TechDetect bool StoreChain bool StoreVisionReconClusters bool MaxResponseBodySizeToSave int @@ -231,7 +231,7 @@ type Options struct { OutputResponseTime bool NoFallback bool NoFallbackScheme bool - TechDetect string + TechDetect bool TLSGrab bool protocol string ShowStatistics bool @@ -330,7 +330,7 @@ func ParseOptions() *Options { flagSet.BoolVar(&options.ExtractTitle, "title", false, "display page title"), flagSet.DynamicVarP(&options.ResponseBodyPreviewSize, "body-preview", "bp", 100, "display first N characters of response body"), flagSet.BoolVarP(&options.OutputServerHeader, "web-server", "server", false, "display server name"), - flagSet.DynamicVarP(&options.TechDetect, "tech-detect", "td", "true", "display technology in use based on wappalyzer dataset"), + flagSet.BoolVarP(&options.TechDetect, "tech-detect", "td", false, "display technology in use based on wappalyzer dataset"), flagSet.BoolVar(&options.OutputMethod, "method", false, "display http request method"), flagSet.BoolVar(&options.OutputWebSocket, "websocket", false, "display server using websocket"), flagSet.BoolVar(&options.OutputIP, "ip", false, "display host ip"), diff --git a/runner/runner.go b/runner/runner.go index af59f9eb0..ee32f94ab 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -106,7 +106,7 @@ func New(options *Options) (*Runner, error) { options: options, } var err error - if options.TechDetect != "false" { + if options.TechDetect { runner.wappalyzer, err = wappalyzer.New() } if err != nil { @@ -1779,14 +1779,14 @@ retry: } var technologies []string - if scanopts.TechDetect != "false" { + if scanopts.TechDetect { matches := r.wappalyzer.Fingerprint(resp.Headers, resp.Data) for match := range matches { technologies = append(technologies, match) } } - if scanopts.TechDetect == "true" && len(technologies) > 0 { + if scanopts.TechDetect && len(technologies) > 0 { sort.Strings(technologies) technologies := strings.Join(technologies, ",")