Skip to content

Commit 0c8be1b

Browse files
committed
延时关闭nucleiRunner,确保结果都发送到服务器 2022-10-05
1 parent d42caac commit 0c8be1b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

engine/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func init() {
111111
})
112112
default:
113113
util.DoDelayClear()
114-
util.DoSleep()
114+
//util.DoSleep()
115115
}
116116
}
117117
}()

projectdiscovery/nuclei_Yaml/nuclei_yaml.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
147147
}
148148

149149
readConfig(options)
150-
options.Targets = strings.Split(strings.TrimSpace(buf.String()), "\n")
150+
s001 := strings.TrimSpace(buf.String())
151+
options.Targets = strings.Split(s001, "\n")
151152
log.Printf("options.Targets = %+v", options.Targets)
152153
/////////////////////////////////////
153154
options.Verbose = false
@@ -187,7 +188,10 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
187188
outNuclei <- nil
188189
return
189190
}
190-
defer nucleiRunner.Close()
191+
util.RegDelayCbk(s001, func() {
192+
nucleiRunner.Close2()
193+
nucleiRunner.Close()
194+
}, nil, 0, 50)
191195
//data, _ := json.Marshal(options)
192196
//log.Printf("%+v", string(data))
193197
outNuclei <- nucleiRunner
@@ -198,6 +202,7 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, o
198202
gologger.Fatal().Msgf("Could not run nuclei: %s\n", err)
199203
}
200204
}
205+
201206
}
202207
func readConfig(options *types.Options) {
203208
pwd, _ := os.Getwd()

0 commit comments

Comments
 (0)