From e774104f4192cb2578e6e7ad12331882b9a77d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Zamanillo?= Date: Thu, 27 Aug 2020 22:13:42 +0200 Subject: [PATCH] Add template name to JSON output Fixes #258 --- pkg/executer/http_utils.go | 1 + pkg/executer/output_dns.go | 1 + pkg/executer/output_http.go | 1 + 3 files changed, 3 insertions(+) diff --git a/pkg/executer/http_utils.go b/pkg/executer/http_utils.go index 65e97686ca..5c0416cdf5 100644 --- a/pkg/executer/http_utils.go +++ b/pkg/executer/http_utils.go @@ -12,6 +12,7 @@ type jsonOutput struct { Matched string `json:"matched"` MatcherName string `json:"matcher_name,omitempty"` ExtractedResults []string `json:"extracted_results,omitempty"` + Name string `json:"name"` Severity string `json:"severity"` Author string `json:"author"` Description string `json:"description"` diff --git a/pkg/executer/output_dns.go b/pkg/executer/output_dns.go index 182fbf4fca..5bbbe4b61d 100644 --- a/pkg/executer/output_dns.go +++ b/pkg/executer/output_dns.go @@ -18,6 +18,7 @@ func (e *DNSExecuter) writeOutputDNS(domain string, req, resp *dns.Msg, matcher Template: e.template.ID, Type: "dns", Matched: domain, + Name: e.template.Info.Name, Severity: e.template.Info.Severity, Author: e.template.Info.Author, Description: e.template.Info.Description, diff --git a/pkg/executer/output_http.go b/pkg/executer/output_http.go index 0b40a2fb80..8da2576b88 100644 --- a/pkg/executer/output_http.go +++ b/pkg/executer/output_http.go @@ -20,6 +20,7 @@ func (e *HTTPExecuter) writeOutputHTTP(req *requests.HTTPRequest, resp *http.Res Template: e.template.ID, Type: "http", Matched: URL, + Name: e.template.Info.Name, Severity: e.template.Info.Severity, Author: e.template.Info.Author, Description: e.template.Info.Description,