Skip to content

Commit

Permalink
延时关闭nucleiRunner,确保结果都发送到服务器 2022-10-05
Browse files Browse the repository at this point in the history
  • Loading branch information
hktalent committed Oct 5, 2022
1 parent d42caac commit 0c8be1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func init() {
})
default:
util.DoDelayClear()
util.DoSleep()
//util.DoSleep()
}
}
}()
Expand Down
9 changes: 7 additions & 2 deletions projectdiscovery/nuclei_Yaml/nuclei_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
}

readConfig(options)
options.Targets = strings.Split(strings.TrimSpace(buf.String()), "\n")
s001 := strings.TrimSpace(buf.String())
options.Targets = strings.Split(s001, "\n")
log.Printf("options.Targets = %+v", options.Targets)
/////////////////////////////////////
options.Verbose = false
Expand Down Expand Up @@ -187,7 +188,10 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
outNuclei <- nil
return
}
defer nucleiRunner.Close()
util.RegDelayCbk(s001, func() {
nucleiRunner.Close2()
nucleiRunner.Close()
}, nil, 0, 50)
//data, _ := json.Marshal(options)
//log.Printf("%+v", string(data))
outNuclei <- nucleiRunner
Expand All @@ -198,6 +202,7 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
gologger.Fatal().Msgf("Could not run nuclei: %s\n", err)
}
}

}
func readConfig(options *types.Options) {
pwd, _ := os.Getwd()
Expand Down

0 comments on commit 0c8be1b

Please sign in to comment.