adding dns label to matched dns queries

dev
Mzack9999 2020-04-24 15:59:40 +02:00
parent 11569cc8e8
commit cdcdb44b29
2 changed files with 3 additions and 2 deletions

View File

@ -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)
}

View File

@ -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