mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-21 23:05:29 +00:00
Adding response highlighting to websocket
This commit is contained in:
parent
a10b79d7a8
commit
75f18f169c
@ -96,7 +96,7 @@ func (r *Request) ExecuteWithResults(input string, dynamicValues, previous outpu
|
|||||||
data["not_after"] = float64(cert.NotAfter.Unix())
|
data["not_after"] = float64(cert.NotAfter.Unix())
|
||||||
data["ip"] = r.dialer.GetDialedIP(hostname)
|
data["ip"] = r.dialer.GetDialedIP(hostname)
|
||||||
|
|
||||||
event := eventcreator.CreateEventWithAdditionalOptions(r, data, r.options.Options.Debug || r.options.Options.DebugResponse, func(internalWrappedEvent *output.InternalWrappedEvent) {})
|
event := eventcreator.CreateEvent(r, data, r.options.Options.Debug || r.options.Options.DebugResponse)
|
||||||
callback(event)
|
callback(event)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/expressions"
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/expressions"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/generators"
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/generators"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/helpers/eventcreator"
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/helpers/eventcreator"
|
||||||
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/helpers/responsehighlighter"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/network/networkclientpool"
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/network/networkclientpool"
|
||||||
"github.com/projectdiscovery/nuclei/v2/pkg/types"
|
"github.com/projectdiscovery/nuclei/v2/pkg/types"
|
||||||
)
|
)
|
||||||
@ -278,12 +279,6 @@ func (r *Request) executeRequestWithPayloads(input, hostname string, dynamicValu
|
|||||||
r.options.Output.Request(r.options.TemplateID, input, "websocket", err)
|
r.options.Output.Request(r.options.TemplateID, input, "websocket", err)
|
||||||
gologger.Verbose().Msgf("Sent Websocket request to %s", input)
|
gologger.Verbose().Msgf("Sent Websocket request to %s", input)
|
||||||
|
|
||||||
if r.options.Options.Debug || r.options.Options.DebugResponse {
|
|
||||||
responseOutput := responseBuilder.String()
|
|
||||||
gologger.Debug().Msgf("[%s] Dumped Websocket response for %s", r.options.TemplateID, input)
|
|
||||||
gologger.Print().Msgf("%s", responseOutput)
|
|
||||||
}
|
|
||||||
|
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
for k, v := range previous {
|
for k, v := range previous {
|
||||||
data[k] = v
|
data[k] = v
|
||||||
@ -303,6 +298,11 @@ func (r *Request) executeRequestWithPayloads(input, hostname string, dynamicValu
|
|||||||
event := eventcreator.CreateEventWithAdditionalOptions(r, data, r.options.Options.Debug || r.options.Options.DebugResponse, func(internalWrappedEvent *output.InternalWrappedEvent) {
|
event := eventcreator.CreateEventWithAdditionalOptions(r, data, r.options.Options.Debug || r.options.Options.DebugResponse, func(internalWrappedEvent *output.InternalWrappedEvent) {
|
||||||
internalWrappedEvent.OperatorsResult.PayloadValues = payloadValues
|
internalWrappedEvent.OperatorsResult.PayloadValues = payloadValues
|
||||||
})
|
})
|
||||||
|
if r.options.Options.Debug || r.options.Options.DebugResponse {
|
||||||
|
responseOutput := responseBuilder.String()
|
||||||
|
gologger.Debug().Msgf("[%s] Dumped Websocket response for %s", r.options.TemplateID, input)
|
||||||
|
gologger.Print().Msgf("%s", responsehighlighter.Highlight(event.OperatorsResult, responseOutput, r.options.Options.NoColor))
|
||||||
|
}
|
||||||
|
|
||||||
callback(event)
|
callback(event)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user