mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-23 01:45:28 +00:00
Integrated deserialization helpers to nuclei + Misc bug fixes
This commit is contained in:
parent
5af0f55ef8
commit
0fd65e2bf2
@ -268,6 +268,19 @@ func HelperFunctions() map[string]govaluate.ExpressionFunction {
|
|||||||
time.Sleep(time.Duration(seconds) * time.Second)
|
time.Sleep(time.Duration(seconds) * time.Second)
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deserialization Functions
|
||||||
|
functions["generate_java_gadget"] = func(args ...interface{}) (interface{}, error) {
|
||||||
|
gadget := args[0].(string)
|
||||||
|
cmd := args[1].(string)
|
||||||
|
|
||||||
|
var encoding string
|
||||||
|
if len(args) > 2 {
|
||||||
|
encoding = args[2].(string)
|
||||||
|
}
|
||||||
|
data := deserialization.GenerateJavaGadget(gadget, cmd, encoding)
|
||||||
|
return data, nil
|
||||||
|
}
|
||||||
return functions
|
return functions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import (
|
|||||||
"github.com/projectdiscovery/nuclei/v2/pkg/output"
|
"github.com/projectdiscovery/nuclei/v2/pkg/output"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/progress"
|
"github.com/projectdiscovery/nuclei/v2/pkg/progress"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/reporting"
|
"github.com/projectdiscovery/nuclei/v2/pkg/reporting"
|
||||||
"github.com/valyala/fasttemplate"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is a wrapped client for interactsh server.
|
// Client is a wrapped client for interactsh server.
|
||||||
@ -183,9 +182,7 @@ func (c *Client) ReplaceMarkers(data, interactshURL string) string {
|
|||||||
if !strings.Contains(data, interactshURLMarker) {
|
if !strings.Contains(data, interactshURLMarker) {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
replaced := fasttemplate.ExecuteStringStd(data, "{{", "}}", map[string]interface{}{
|
replaced := strings.NewReplacer("{{interactsh-url}}", interactshURL).Replace(data)
|
||||||
"interactsh-url": interactshURL,
|
|
||||||
})
|
|
||||||
return replaced
|
return replaced
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -426,7 +426,6 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, previ
|
|||||||
}
|
}
|
||||||
|
|
||||||
event := &output.InternalWrappedEvent{InternalEvent: outputEvent}
|
event := &output.InternalWrappedEvent{InternalEvent: outputEvent}
|
||||||
if !interactsh.HasMatchers(r.CompiledOperators) {
|
|
||||||
if r.CompiledOperators != nil {
|
if r.CompiledOperators != nil {
|
||||||
var ok bool
|
var ok bool
|
||||||
event.OperatorsResult, ok = r.CompiledOperators.Execute(finalEvent, r.Match, r.Extract)
|
event.OperatorsResult, ok = r.CompiledOperators.Execute(finalEvent, r.Match, r.Extract)
|
||||||
@ -436,7 +435,6 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, previ
|
|||||||
}
|
}
|
||||||
event.InternalEvent = outputEvent
|
event.InternalEvent = outputEvent
|
||||||
}
|
}
|
||||||
}
|
|
||||||
callback(event)
|
callback(event)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user