From cdcdb44b29aef5e8413a9e38bb8963ef69bf115e Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 24 Apr 2020 15:59:40 +0200 Subject: [PATCH] adding dns label to matched dns queries --- internal/runner/runner.go | 3 ++- pkg/matchers/match.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index e411c6f0..c6fdd3ec 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -317,11 +317,12 @@ func buildOutputDNS(template *templates.Template, msg *dns.Msg, extractorResults builder := &strings.Builder{} builder.WriteRune('[') builder.WriteString(template.ID) - builder.WriteString("] ") + builder.WriteString("] [dns] ") // domain name from question if len(msg.Question) > 0 { domain := msg.Question[0].Name + domain = strings.TrimSuffix(domain, ".") builder.WriteString(domain) } diff --git a/pkg/matchers/match.go b/pkg/matchers/match.go index ac293193..53f32ab3 100644 --- a/pkg/matchers/match.go +++ b/pkg/matchers/match.go @@ -55,7 +55,7 @@ func (m *Matcher) Match(resp *http.Response, body, headers string) bool { return false } -// MatchDNS matches a dns response again a given matcher +// MatchDNS matches a dns response against a given matcher func (m *Matcher) MatchDNS(msg *dns.Msg) bool { switch m.matcherType { // [WIP] add dns status code matcher