Skip to content

Commit

Permalink
change -tech-detect flag var type (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir authored May 15, 2024
1 parent 441c13b commit 02558ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/integration-test/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type ScanOptions struct {
PreferHTTPS bool
NoFallback bool
NoFallbackScheme bool
TechDetect string
TechDetect bool
StoreChain bool
StoreVisionReconClusters bool
MaxResponseBodySizeToSave int
Expand Down Expand Up @@ -231,7 +231,7 @@ type Options struct {
OutputResponseTime bool
NoFallback bool
NoFallbackScheme bool
TechDetect string
TechDetect bool
TLSGrab bool
protocol string
ShowStatistics bool
Expand Down Expand Up @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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, ",")

Expand Down

0 comments on commit 02558ca

Please sign in to comment.