Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude tech results by default in cli output #1731

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 bool
TechDetect string
StoreChain bool
StoreVisionReconClusters bool
MaxResponseBodySizeToSave int
Expand Down Expand Up @@ -231,7 +231,7 @@ type Options struct {
OutputResponseTime bool
NoFallback bool
NoFallbackScheme bool
TechDetect bool
TechDetect string
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.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"),
Expand Down
9 changes: 4 additions & 5 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 {
if options.TechDetect != "false" {
runner.wappalyzer, err = wappalyzer.New()
}
if err != nil {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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, ",")

Expand Down
Loading