Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding case-insensitive regex #62

Merged
merged 1 commit into from
Aug 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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