From ef27a79ec38e84d24b515b428c2269652400a611 Mon Sep 17 00:00:00 2001 From: DoI <5291556+denandz@users.noreply.github.com> Date: Thu, 2 Jul 2020 19:33:47 +1200 Subject: [PATCH] Make domain matches in the dns.spoof module case insensitive --- modules/dns_spoof/dns_spoof_hosts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dns_spoof/dns_spoof_hosts.go b/modules/dns_spoof/dns_spoof_hosts.go index efc0f12d..a922a283 100644 --- a/modules/dns_spoof/dns_spoof_hosts.go +++ b/modules/dns_spoof/dns_spoof_hosts.go @@ -22,7 +22,8 @@ type HostEntry struct { } func (e HostEntry) Matches(host string) bool { - return e.Host == host || strings.HasSuffix(host, e.Suffix) || (e.Expr != nil && e.Expr.Match(host)) + lowerHost := strings.ToLower(host) + return e.Host == lowerHost || strings.HasSuffix(lowerHost, e.Suffix) || (e.Expr != nil && e.Expr.Match(lowerHost)) } type Hosts []HostEntry