Skip to content

Commit

Permalink
Merge pull request #62 from Fox0x01/patch-1
Browse files Browse the repository at this point in the history
Adding case-insensitive regex
  • Loading branch information
iagox86 committed Aug 21, 2015
2 parents a5b80af + bdd5f1a commit 55629a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/driver_dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ def DriverDNS.get_domain_regex(domain, identifier, required_prefix = nil)
def DriverDNS.figure_out_name(name, domains)
# Check if it's one of our domains
domains.each do |domain|
if(name =~ /^(.*)\.(#{domain})/)
if(name =~ /^(.*)\.(#{domain})/i)
return $1, $2
end
end

# Check if it starts with dnscat, which is used when
# the server is unknown
if(name =~ /^dnscat\.(.*)$/)
if(name =~ /^dnscat\.(.*)$/i)
return $1, nil
end

Expand Down Expand Up @@ -168,7 +168,7 @@ def recv()
domain_regex = "(^dnscat\\.|" + (domains.map { |x| "\\.#{x}$" }).join("|") + ")"

# Only match proper domains with proper record types
match(/#{domain_regex}/, RECORD_TYPES.keys) do |transaction|
match(/#{domain_regex}/i, RECORD_TYPES.keys) do |transaction|
begin
# Determine the type
type = transaction.resource_class
Expand Down

0 comments on commit 55629a2

Please sign in to comment.