Skip to content

Commit 293ce0a

Browse files
committed
fix 优化naabu close bug 2022-07-08 23:13:1657293197
1 parent 0d3e079 commit 293ce0a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

nuclei_Yaml/nuclei_yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func readConfig() {
294294

295295
options.UpdateNuclei = false
296296
options.UpdateTemplates = false
297-
options.TemplatesDirectory = ""
297+
options.TemplatesDirectory = pwd + "/config/nuclei-templates"
298298
// 嵌入式集成私人版本nuclei-templates 共3744个YAML POC
299299
if "true" == pkg.GetVal("enablEmbedYaml") {
300300
options.Templates = []string{pwd + "/config/nuclei-templates"}

pkg/httpx/runner/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func (r *Runner) prepareInput() {
342342

343343
err := r.stats.Start(makePrintCallback(), time.Duration(r.options.StatsInterval)*time.Second)
344344
if err != nil {
345-
gologger.Warning().Msgf("Could not create statistics: %s\n", err)
345+
gologger.Warning().Msgf("Could not create statistics: %s \n", err)
346346
}
347347
}
348348
}
@@ -487,7 +487,7 @@ func makePrintCallback() func(stats clistats.StatisticsClient) {
487487
builder.WriteRune('%')
488488
builder.WriteRune(')')
489489

490-
builder.WriteRune('\n')
490+
builder.WriteRune('\r')
491491

492492
fmt.Fprintf(os.Stderr, "%s", builder.String())
493493
builder.Reset()

pkg/naabu/v2/pkg/runner/runner.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ func (r *Runner) ShowScanResultOnExit() {
412412
func (r *Runner) Close() {
413413
os.RemoveAll(r.targetsFile)
414414
r.scanner.IPRanger.Hosts.Close()
415+
r.scanner.State = scan.Done
416+
//r.scanner.CleanupHandlers()
417+
//r.scanner.Close()
418+
//r.wgscan
415419
}
416420

417421
// PickIP randomly

pkg/naabu/v2/pkg/scan/scan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99

1010
"github.com/google/gopacket"
1111
"github.com/google/gopacket/layers"
12+
"github.com/hktalent/scan4all/pkg/naabu/v2/pkg/privileges"
13+
"github.com/hktalent/scan4all/pkg/naabu/v2/pkg/result"
1214
"github.com/phayes/freeport"
1315
"github.com/projectdiscovery/cdncheck"
1416
"github.com/projectdiscovery/gologger"
1517
"github.com/projectdiscovery/ipranger"
1618
"github.com/projectdiscovery/networkpolicy"
17-
"github.com/hktalent/scan4all/pkg/naabu/v2/pkg/privileges"
18-
"github.com/hktalent/scan4all/pkg/naabu/v2/pkg/result"
1919
"golang.org/x/net/icmp"
2020
"golang.org/x/net/ipv4"
2121
"golang.org/x/net/proxy"

0 commit comments

Comments
 (0)