mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-02-09 12:03:12 +08:00
add additional json fields: port,ip,scheme,url (#4417)
* add additional json fields: port,ip,scheme,url * include host field in case of ip input
This commit is contained in:
@@ -244,12 +244,21 @@ func (request *Request) Type() templateTypes.ProtocolType {
|
||||
}
|
||||
|
||||
func (request *Request) MakeResultEventItem(wrapped *output.InternalWrappedEvent) *output.ResultEvent {
|
||||
fields := protocolutils.GetJsonFieldsFromURL(types.ToString(wrapped.InternalEvent["input"]))
|
||||
if types.ToString(wrapped.InternalEvent["ip"]) != "" {
|
||||
fields.Ip = types.ToString(wrapped.InternalEvent["ip"])
|
||||
}
|
||||
data := &output.ResultEvent{
|
||||
TemplateID: types.ToString(request.options.TemplateID),
|
||||
TemplatePath: types.ToString(request.options.TemplatePath),
|
||||
Info: request.options.TemplateInfo,
|
||||
Type: types.ToString(wrapped.InternalEvent["type"]),
|
||||
Matched: types.ToString(wrapped.InternalEvent["input"]),
|
||||
Host: fields.Host,
|
||||
Port: fields.Port,
|
||||
Scheme: fields.Scheme,
|
||||
URL: fields.URL,
|
||||
IP: fields.Ip,
|
||||
Metadata: wrapped.OperatorsResult.PayloadValues,
|
||||
ExtractedResults: wrapped.OperatorsResult.OutputExtracts,
|
||||
Timestamp: time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user