enable tech detection for json output by default (#1732)

* enable tech detection for json output by default

* minor
This commit is contained in:
Dogan Can Bakir 2024-05-29 15:59:43 +03:00 committed by GitHub
parent a3ab5b470e
commit 23ff173eba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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.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"),

View File

@ -106,7 +106,7 @@ func New(options *Options) (*Runner, error) {
options: options,
}
var err error
if options.TechDetect {
if options.TechDetect || options.JSONOutput || options.CSVOutput {
runner.wappalyzer, err = wappalyzer.New()
}
if err != nil {
@ -276,7 +276,7 @@ func New(options *Options) (*Runner, error) {
scanopts.OutputResponseTime = options.OutputResponseTime
scanopts.NoFallback = options.NoFallback
scanopts.NoFallbackScheme = options.NoFallbackScheme
scanopts.TechDetect = options.TechDetect
scanopts.TechDetect = options.TechDetect || options.JSONOutput || options.CSVOutput
scanopts.StoreChain = options.StoreChain
scanopts.StoreVisionReconClusters = options.StoreVisionReconClusters
scanopts.MaxResponseBodySizeToSave = options.MaxResponseBodySizeToSave
@ -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 || r.options.JSONOutput || r.options.CSVOutput {
moreMatches := r.wappalyzer.FingerprintWithInfo(resp.Headers, []byte(headlessBody))
for match, data := range moreMatches {
technologies = append(technologies, match)