mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 16:07:23 +00:00
Fixed dynamic values + misc
This commit is contained in:
parent
21e6577220
commit
76fe5ace40
@ -121,7 +121,7 @@ func (r *Operators) Execute(data map[string]interface{}, match MatchFunc, extrac
|
|||||||
}
|
}
|
||||||
// Write a final string of output if matcher type is
|
// Write a final string of output if matcher type is
|
||||||
// AND or if we have extractors for the mechanism too.
|
// AND or if we have extractors for the mechanism too.
|
||||||
if len(result.Extracts) > 0 || len(result.OutputExtracts) > 0 || matches {
|
if len(result.Extracts) > 0 || len(result.DynamicValues) > 0 || len(result.OutputExtracts) > 0 || matches {
|
||||||
return result, true
|
return result, true
|
||||||
}
|
}
|
||||||
return nil, false
|
return nil, false
|
||||||
|
|||||||
@ -120,6 +120,9 @@ func (r *Request) responseToDSLMap(req, resp *dns.Msg, host, matched string) out
|
|||||||
|
|
||||||
// MakeResultEvent creates a result event from internal wrapped event
|
// MakeResultEvent creates a result event from internal wrapped event
|
||||||
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
||||||
|
if len(wrapped.OperatorsResult.DynamicValues) > 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
||||||
|
|
||||||
// If we have multiple matchers with names, write each of them separately.
|
// If we have multiple matchers with names, write each of them separately.
|
||||||
|
|||||||
@ -79,6 +79,9 @@ func (r *Request) responseToDSLMap(raw string, host, matched string) output.Inte
|
|||||||
|
|
||||||
// MakeResultEvent creates a result event from internal wrapped event
|
// MakeResultEvent creates a result event from internal wrapped event
|
||||||
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
||||||
|
if len(wrapped.OperatorsResult.DynamicValues) > 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
||||||
|
|
||||||
// If we have multiple matchers with names, write each of them separately.
|
// If we have multiple matchers with names, write each of them separately.
|
||||||
|
|||||||
@ -116,6 +116,9 @@ func (r *Request) responseToDSLMap(resp *http.Response, host, matched, rawReq, r
|
|||||||
|
|
||||||
// MakeResultEvent creates a result event from internal wrapped event
|
// MakeResultEvent creates a result event from internal wrapped event
|
||||||
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
||||||
|
if len(wrapped.OperatorsResult.DynamicValues) > 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
||||||
|
|
||||||
// If we have multiple matchers with names, write each of them separately.
|
// If we have multiple matchers with names, write each of them separately.
|
||||||
|
|||||||
@ -341,10 +341,10 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam
|
|||||||
|
|
||||||
event := &output.InternalWrappedEvent{InternalEvent: outputEvent}
|
event := &output.InternalWrappedEvent{InternalEvent: outputEvent}
|
||||||
if r.CompiledOperators != nil {
|
if r.CompiledOperators != nil {
|
||||||
result, ok := r.CompiledOperators.Execute(outputEvent, r.Match, r.Extract)
|
var ok bool
|
||||||
if ok && result != nil {
|
event.OperatorsResult, ok = r.CompiledOperators.Execute(outputEvent, r.Match, r.Extract)
|
||||||
event.OperatorsResult = result
|
if ok && event.OperatorsResult != nil {
|
||||||
result.PayloadValues = request.meta
|
event.OperatorsResult.PayloadValues = request.meta
|
||||||
event.Results = r.MakeResultEvent(event)
|
event.Results = r.MakeResultEvent(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,6 +82,9 @@ func (r *Request) responseToDSLMap(req, resp string, host, matched string) outpu
|
|||||||
|
|
||||||
// MakeResultEvent creates a result event from internal wrapped event
|
// MakeResultEvent creates a result event from internal wrapped event
|
||||||
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent {
|
||||||
|
if len(wrapped.OperatorsResult.DynamicValues) > 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
results := make([]*output.ResultEvent, 0, len(wrapped.OperatorsResult.Matches)+1)
|
||||||
|
|
||||||
// If we have multiple matchers with names, write each of them separately.
|
// If we have multiple matchers with names, write each of them separately.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user