From 827ed164616ac76a7530ac8b8f1606410d2795c3 Mon Sep 17 00:00:00 2001 From: shubhamrasal Date: Tue, 16 May 2023 17:37:46 +0530 Subject: [PATCH] remove fastdialer from runner object --- cmd/functional-test/testcases.txt | 1 + runner/runner.go | 16 +--------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/cmd/functional-test/testcases.txt b/cmd/functional-test/testcases.txt index 7a525c9..ad5f60d 100644 --- a/cmd/functional-test/testcases.txt +++ b/cmd/functional-test/testcases.txt @@ -16,5 +16,6 @@ scanme.sh {{binary}} -silent -body 'a=b' scanme.sh {{binary}} -silent -exclude-cdn scanme.sh {{binary}} -silent -ports https:443 scanme.sh {{binary}} -silent -ztls +scanme.sh {{binary}} -silent -jarm https://scanme.sh?a=1*1 {{binary}} -silent https://scanme.sh:443 {{binary}} -asn \ No newline at end of file diff --git a/runner/runner.go b/runner/runner.go index 4a7c7f0..f4eb16d 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -26,7 +26,6 @@ import ( "github.com/PuerkitoBio/goquery" asnmap "github.com/projectdiscovery/asnmap/libs" dsl "github.com/projectdiscovery/dsl" - "github.com/projectdiscovery/fastdialer/fastdialer" "github.com/projectdiscovery/httpx/common/customextract" "github.com/projectdiscovery/httpx/common/hashes/jarm" "github.com/projectdiscovery/mapcidr/asn" @@ -70,7 +69,6 @@ type Runner struct { options *Options hp *httpx.HTTPX wappalyzer *wappalyzer.Wappalyze - fastdialer *fastdialer.Dialer scanopts ScanOptions hm *hybrid.HybridMap stats clistats.StatisticsClient @@ -95,18 +93,6 @@ func New(options *Options) (*Runner, error) { os.RemoveAll(filepath.Join(options.StoreResponseDir, "response", "index.txt")) os.RemoveAll(filepath.Join(options.StoreResponseDir, "screenshot", "index_screenshot.txt")) } - dialerOpts := fastdialer.DefaultOptions - dialerOpts.WithDialerHistory = true - dialerOpts.MaxRetries = 3 - dialerOpts.DialerTimeout = time.Duration(options.Timeout) * time.Second - if len(options.Resolvers) > 0 { - dialerOpts.BaseResolvers = options.Resolvers - } - fastDialer, err := fastdialer.NewDialer(dialerOpts) - if err != nil { - return nil, errors.Wrap(err, "could not create dialer") - } - runner.fastdialer = fastDialer httpxOptions := httpx.DefaultOptions // Enables automatically tlsgrab if tlsprobe is requested @@ -1602,7 +1588,7 @@ retry: } jarmhash := "" if r.options.Jarm { - jarmhash = jarm.Jarm(r.fastdialer, fullURL, r.options.Timeout) + jarmhash = jarm.Jarm(r.hp.Dialer, fullURL, r.options.Timeout) builder.WriteString(" [") if !scanopts.OutputWithNoColor { builder.WriteString(aurora.Magenta(jarmhash).String())