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

Consistently refer to black hole as two words #18974

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions lib/msf/ui/console/command_dispatcher/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def add_dns(*args)

comm = val
when nil
val = 'black-hole' if val.casecmp?('blackhole')
resolvers << val
else
raise ::ArgumentError.new("Unknown flag: #{opt}")
Expand Down Expand Up @@ -325,9 +326,9 @@ def add_dns_help
print_line @@add_opts.usage
print_line "RESOLVERS:"
print_line " ipv4 / ipv6 address - The IP address of an upstream DNS server to resolve from"
print_line " blackhole - Drop all queries"
print_line " static - Reply with statically configured addresses (only for A/AAAA records)"
print_line " system - Use the host operating systems DNS resolution functionality (only for A/AAAA records)"
print_line " #{Rex::Proto::DNS::UpstreamResolver::Type::BLACK_HOLE.to_s.ljust(19)} - Drop all queries"
print_line " #{Rex::Proto::DNS::UpstreamResolver::Type::STATIC.to_s.ljust(19) } - Reply with statically configured addresses (only for A/AAAA records)"
print_line " #{Rex::Proto::DNS::UpstreamResolver::Type::SYSTEM.to_s.ljust(19) } - Use the host operating systems DNS resolution functionality (only for A/AAAA records)"
print_line
print_line "EXAMPLES:"
print_line " Set the DNS server(s) to be used for *.metasploit.com to 192.168.1.10"
Expand Down
6 changes: 3 additions & 3 deletions lib/rex/proto/dns/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def send(argument, type = Dnsruby::Types::A, cls = Dnsruby::Classes::IN)
upstream_resolvers.each do |upstream_resolver|
case upstream_resolver.type
when UpstreamResolver::Type::BLACK_HOLE
ans = resolve_via_blackhole(upstream_resolver, packet, type, cls)
ans = resolve_via_black_hole(upstream_resolver, packet, type, cls)
when UpstreamResolver::Type::DNS_SERVER
ans = resolve_via_dns_server(upstream_resolver, packet, type, cls)
when UpstreamResolver::Type::STATIC
Expand Down Expand Up @@ -450,9 +450,9 @@ def resolve_via_dns_server(upstream_resolver, packet, type, _cls)
ans
end

def resolve_via_blackhole(upstream_resolver, packet, type, cls)
def resolve_via_black_hole(upstream_resolver, packet, type, cls)
# do not just return nil because that will cause the next resolver to be used
@logger.info "No response from upstream resolvers: blackholed"
@logger.info "No response from upstream resolvers: black-hole"
raise NoResponseError
end

Expand Down