mirror of https://github.com/daffainfo/nuclei.git
Added stop-at-first-match to http requests
parent
fb2ec8f5d2
commit
18d0858f31
|
@ -161,6 +161,9 @@ type Request struct {
|
||||||
//
|
//
|
||||||
// This allows matching on them later for multi-request conditions.
|
// This allows matching on them later for multi-request conditions.
|
||||||
ReqCondition bool `yaml:"req-condition,omitempty" jsonschema:"title=preserve request history,description=Automatically assigns numbers to requests and preserves their history"`
|
ReqCondition bool `yaml:"req-condition,omitempty" jsonschema:"title=preserve request history,description=Automatically assigns numbers to requests and preserves their history"`
|
||||||
|
// description: |
|
||||||
|
// StopAtFirstMatch stops the execution of the requests as soon as a match is found.
|
||||||
|
StopAtFirstMatch bool `yaml:"stop-at-first-match,omitempty" jsonschema:"title=stop at first match,description=Stop the execution after a match is found"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetID returns the unique ID of the request if any.
|
// GetID returns the unique ID of the request if any.
|
||||||
|
|
|
@ -249,7 +249,7 @@ func (r *Request) ExecuteWithResults(reqURL string, dynamicValues, previous outp
|
||||||
requestCount++
|
requestCount++
|
||||||
r.options.Progress.IncrementRequests()
|
r.options.Progress.IncrementRequests()
|
||||||
|
|
||||||
if request.original.options.Options.StopAtFirstMatch && gotOutput {
|
if (request.original.options.Options.StopAtFirstMatch || r.StopAtFirstMatch) && gotOutput {
|
||||||
r.options.Progress.IncrementErrorsBy(int64(generator.Total()))
|
r.options.Progress.IncrementErrorsBy(int64(generator.Total()))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue