Skip to content

Commit 9c89656

Browse files
committed
fix: pocscan
1 parent e1a3391 commit 9c89656

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

pkg/pocscan/nuclei/poc.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/projectdiscovery/nuclei/v2/pkg/core"
1212
"github.com/projectdiscovery/nuclei/v2/pkg/output"
1313
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
14-
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/hosterrorscache"
1514
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/interactsh"
1615
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolinit"
1716
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolstate"
@@ -74,8 +73,8 @@ func ParsePoc(templateString string) {
7473
}
7574

7675
func InitExecuterOptions(dir string) (err error) {
77-
cache := hosterrorscache.New(30, hosterrorscache.DefaultMaxHostsCount)
78-
defer cache.Close()
76+
//cache := hosterrorscache.New(30, hosterrorscache.DefaultMaxHostsCount)
77+
//defer cache.Close()
7978

8079
mockProgress := &testutils.MockProgressClient{}
8180
reportingClient, _ := reporting.New(&reporting.Options{}, "")
@@ -110,16 +109,16 @@ func InitExecuterOptions(dir string) (err error) {
110109
catalog := disk.NewCatalog(dir)
111110

112111
ExecuterOptions = protocols.ExecuterOptions{
113-
Output: outputWriter,
114-
Options: options,
115-
Progress: mockProgress,
116-
Catalog: catalog,
117-
IssuesClient: reportingClient,
118-
Interactsh: interactClient,
119-
RateLimiter: ratelimit.New(context.Background(), 150, time.Second),
120-
HostErrorsCache: cache,
121-
Colorizer: aurora.NewAurora(true),
122-
ResumeCfg: types.NewResumeCfg(),
112+
Output: outputWriter,
113+
Options: options,
114+
Progress: mockProgress,
115+
Catalog: catalog,
116+
IssuesClient: reportingClient,
117+
Interactsh: interactClient,
118+
RateLimiter: ratelimit.New(context.Background(), 150, time.Second),
119+
//HostErrorsCache: cache,
120+
Colorizer: aurora.NewAurora(true),
121+
ResumeCfg: types.NewResumeCfg(),
123122
}
124123

125124
return
@@ -128,10 +127,11 @@ func InitExecuterOptions(dir string) (err error) {
128127
func InitEngine(timeout int, proxy string) (engine *core.Engine) {
129128
ExecuterOptions.Options.Timeout = timeout
130129
ExecuterOptions.Options.RateLimit = 1
131-
ExecuterOptions.Options.ProxyInternal = true
132130
if proxy == "" {
131+
ExecuterOptions.Options.ProxyInternal = false
133132
ExecuterOptions.Options.Proxy = []string{}
134133
} else {
134+
ExecuterOptions.Options.ProxyInternal = true
135135
ExecuterOptions.Options.Proxy = []string{proxy}
136136
}
137137

pkg/pocscan/nuclei/proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
func loadProxyServers(options *types.Options) error {
2020
var proxyURLList []url.URL // bug
2121
if len(options.Proxy) == 0 {
22+
types.ProxySocksURL = ""
23+
types.ProxyURL = ""
2224
return nil
2325
}
2426
for _, p := range options.Proxy {

pkg/pocscan/runner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Runner struct {
2727

2828
func NewRunner(options *Options, gobyPocs []*goby.Poc, xrayPocs []*xray.Poc, nucleiTemplates []*nuclei.Template) (runner *Runner, err error) {
2929
nucleiEngine := nuclei.InitEngine(options.Timeout, options.Proxy)
30+
//nucleiEngine = nuclei.InitEngine(options.Timeout, "")
3031
reqClient := utils.NewReqClient(options.Proxy, options.Timeout, options.Headers)
3132
runner = &Runner{
3233
gobyPocs: gobyPocs,

0 commit comments

Comments
 (0)