From 189bb69bb3150e596ec8b1e28dc556afa11c9581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Wed, 27 Nov 2024 07:04:40 +0300 Subject: [PATCH] use global pkg --- cmd/nuclei/main.go | 4 ---- go.mod | 4 ++-- go.sum | 8 ++++---- pkg/protocols/common/protocolinit/init.go | 1 + pkg/types/types.go | 2 -- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/cmd/nuclei/main.go b/cmd/nuclei/main.go index 62d0e6da6e..ae9fd8812b 100644 --- a/cmd/nuclei/main.go +++ b/cmd/nuclei/main.go @@ -18,7 +18,6 @@ import ( "github.com/projectdiscovery/utils/env" _ "github.com/projectdiscovery/utils/pprof" stringsutil "github.com/projectdiscovery/utils/strings" - "github.com/projectdiscovery/utils/sysutil" "github.com/projectdiscovery/goflags" "github.com/projectdiscovery/gologger" @@ -402,7 +401,6 @@ on extensive configurability, massive extensibility and ease of use.`) flagSet.DurationVarP(&options.InputReadTimeout, "input-read-timeout", "irt", time.Duration(3*time.Minute), "timeout on input read"), flagSet.BoolVarP(&options.DisableHTTPProbe, "no-httpx", "nh", false, "disable httpx probing for non-url input"), flagSet.BoolVar(&options.DisableStdin, "no-stdin", false, "disable stdin processing"), - flagSet.IntVarP(&options.MaxOSThreads, "max-os-threads", "most", 10000, "set the maximum number of operating system threads to use"), ) flagSet.CreateGroup("headless", "Headless", @@ -490,8 +488,6 @@ Additional documentation is available at: https://docs.nuclei.sh/getting-started goflags.DisableAutoConfigMigration = true _ = flagSet.Parse() - _ = sysutil.SetMaxThreads(options.MaxOSThreads) - // when fuzz flag is enabled, set the dast flag to true if fuzzFlag { // backwards compatibility for fuzz flag diff --git a/go.mod b/go.mod index 54fb7b9417..89ddf1b526 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/projectdiscovery/clistats v0.1.1 github.com/projectdiscovery/fastdialer v0.2.10 - github.com/projectdiscovery/hmap v0.0.67 + github.com/projectdiscovery/hmap v0.0.68 github.com/projectdiscovery/interactsh v1.2.0 github.com/projectdiscovery/rawhttp v0.1.74 github.com/projectdiscovery/retryabledns v1.0.86 @@ -97,7 +97,7 @@ require ( github.com/projectdiscovery/tlsx v1.1.8 github.com/projectdiscovery/uncover v1.0.9 github.com/projectdiscovery/useragent v0.0.78 - github.com/projectdiscovery/utils v0.2.19 + github.com/projectdiscovery/utils v0.2.21 github.com/projectdiscovery/wappalyzergo v0.2.4 github.com/redis/go-redis/v9 v9.1.0 github.com/seh-msft/burpxml v1.0.1 diff --git a/go.sum b/go.sum index 2e948c7072..280ff322f4 100644 --- a/go.sum +++ b/go.sum @@ -863,8 +863,8 @@ github.com/projectdiscovery/gostruct v0.0.2 h1:s8gP8ApugGM4go1pA+sVlPDXaWqNP5BBD github.com/projectdiscovery/gostruct v0.0.2/go.mod h1:H86peL4HKwMXcQQtEa6lmC8FuD9XFt6gkNR0B/Mu5PE= github.com/projectdiscovery/gozero v0.0.3 h1:tsYkrSvWw4WdIUJyisd4MB1vRiw1X57TuVVk3p8Z3G8= github.com/projectdiscovery/gozero v0.0.3/go.mod h1:MpJ37Dsh94gy2EKqaemdeh+CzduGVB2SDfhr6Upsjew= -github.com/projectdiscovery/hmap v0.0.67 h1:PG09AyXH6mchdZCdxAS7WkZz0xxsOsIxJOmEixEmnzI= -github.com/projectdiscovery/hmap v0.0.67/go.mod h1:WxK8i2J+wcdimIXCgpYzfj9gKxCqRqOM4KENDRzGgAA= +github.com/projectdiscovery/hmap v0.0.68 h1:/z1Cz2wKYedTJc97UNzBBgdm744xkXi6j7125b7toqg= +github.com/projectdiscovery/hmap v0.0.68/go.mod h1:B37g7giW6i7+X1pJAeG0NPoKFpFJ7M26a18gfwfLeEc= github.com/projectdiscovery/httpx v1.6.9 h1:ihyFclesLjvQpiJpRIlAYeebapyIbOI/arDAvvy1ES8= github.com/projectdiscovery/httpx v1.6.9/go.mod h1:zQtX5CtcDYXzIRWne1ztCVtqG0sXCnx84tFwfMHoB8Q= github.com/projectdiscovery/interactsh v1.2.0 h1:Al6jHiR+Usl9egYJDLJaWNHOcH8Rugk8gWMasc8Cmw8= @@ -899,8 +899,8 @@ github.com/projectdiscovery/uncover v1.0.9 h1:s5RbkD/V4r8QcPkys4gTTqMuRSgXq0Jpre github.com/projectdiscovery/uncover v1.0.9/go.mod h1:2PUF3SpB5QNIJ8epaB2xbRzkPaxEAWRDm3Ir2ijt81U= github.com/projectdiscovery/useragent v0.0.78 h1:YpgiY3qXpzygFA88SWVseAyWeV9ZKrIpDkfOY+mQ/UY= github.com/projectdiscovery/useragent v0.0.78/go.mod h1:SQgk2DZu1qCvYqBRYWs2sjenXqLEDnRw65wJJoolwZ4= -github.com/projectdiscovery/utils v0.2.19 h1:vN1RGixpRVsn6VCnOACTLZyntV1o5FYqUElYpQUYND0= -github.com/projectdiscovery/utils v0.2.19/go.mod h1:M/uyy352fsl9juI8YHZY+r79auR2y1U9lSdkQv6lZpc= +github.com/projectdiscovery/utils v0.2.21 h1:5YHyf+viDg0FFJnWFNEw0u608dXHj7nYdMGLUQzvwew= +github.com/projectdiscovery/utils v0.2.21/go.mod h1:LuiMbnvhvQV5qUQY44sQeGnfg4+fGEeuYFRRpxOyvwo= github.com/projectdiscovery/wappalyzergo v0.2.4 h1:fVEBM4mTJgGDOIFw8ykGw/YgA4jt/gcs1g7UImPmmLw= github.com/projectdiscovery/wappalyzergo v0.2.4/go.mod h1:1373aKrhlUGtX13KjYXH74lf9yl32StnWuwk1FWvTgo= github.com/projectdiscovery/yamldoc-go v1.0.4 h1:eZoESapnMw6WAHiVgRwNqvbJEfNHEH148uthhFbG5jE= diff --git a/pkg/protocols/common/protocolinit/init.go b/pkg/protocols/common/protocolinit/init.go index c8268337f5..20b7b7a100 100644 --- a/pkg/protocols/common/protocolinit/init.go +++ b/pkg/protocols/common/protocolinit/init.go @@ -9,6 +9,7 @@ import ( "github.com/projectdiscovery/nuclei/v3/pkg/protocols/network/networkclientpool" "github.com/projectdiscovery/nuclei/v3/pkg/protocols/whois/rdapclientpool" "github.com/projectdiscovery/nuclei/v3/pkg/types" + _ "github.com/projectdiscovery/utils/global" ) // Init initializes the client pools for the protocols diff --git a/pkg/types/types.go b/pkg/types/types.go index 9d2cd1880a..42674ebe34 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -303,8 +303,6 @@ type Options struct { InputReadTimeout time.Duration // Disable stdin for input processing DisableStdin bool - // MaxOSThreads is the maximum number of OS threads to use - MaxOSThreads int // IncludeConditions is the list of conditions templates should match IncludeConditions goflags.StringSlice // Enable uncover engine