From 8116cb720a5a7c052d758f8384d78448b4dab2c0 Mon Sep 17 00:00:00 2001 From: Ramana Reddy Date: Wed, 29 May 2024 09:20:32 +0530 Subject: [PATCH] Exclude tech results by default in cli output --- cmd/integration-test/library.go | 2 +- runner/options.go | 6 +++--- runner/runner.go | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/integration-test/library.go b/cmd/integration-test/library.go index 059fa411..4a06daaf 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 3a7243ec..79c2637b 100644 --- a/runner/options.go +++ b/runner/options.go @@ -76,7 +76,7 @@ type ScanOptions struct { PreferHTTPS bool NoFallback bool NoFallbackScheme bool - TechDetect bool + TechDetect string StoreChain bool StoreVisionReconClusters bool MaxResponseBodySizeToSave int @@ -231,7 +231,7 @@ type Options struct { OutputResponseTime bool NoFallback bool NoFallbackScheme bool - TechDetect bool + TechDetect string 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.BoolVarP(&options.TechDetect, "tech-detect", "td", true, "display technology in use based on wappalyzer dataset"), + flagSet.DynamicVarP(&options.TechDetect, "tech-detect", "td", "true", "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 b07bb76d..419f1697 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 { + if options.TechDetect != "false" { runner.wappalyzer, err = wappalyzer.New() } if err != nil { @@ -1780,7 +1780,7 @@ retry: technologyDetails := make(map[string]wappalyzer.AppInfo) var technologies []string - if scanopts.TechDetect { + if scanopts.TechDetect != "false" { matches := r.wappalyzer.FingerprintWithInfo(resp.Headers, resp.Data) for match, data := range matches { technologies = append(technologies, match) @@ -2004,7 +2004,7 @@ retry: // As we now have headless body, we can also use it for detecting // more technologies in the response. This is a quick trick to get // more detected technologies. - if r.options.TechDetect { + if r.options.TechDetect != "false" { moreMatches := r.wappalyzer.FingerprintWithInfo(resp.Headers, []byte(headlessBody)) for match, data := range moreMatches { technologies = append(technologies, match) @@ -2020,8 +2020,7 @@ retry: headlessBody = "" } } - - if scanopts.TechDetect && len(technologies) > 0 { + if scanopts.TechDetect == "true" && len(technologies) > 0 { sort.Strings(technologies) technologies := strings.Join(technologies, ",")