Skip to content

Commit 30093ea

Browse files
authored
Land #19012, Fix/dns/dot suffixed names
2 parents 919e6d4 + 6d1d20c commit 30093ea

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ GEM
419419
metasm
420420
rex-core
421421
rex-text
422-
rex-socket (0.1.56)
422+
rex-socket (0.1.57)
423423
rex-core
424424
rex-sslscan (0.1.10)
425425
rex-core

LICENSE_GEMS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ rex-powershell, 0.1.99, "New BSD"
149149
rex-random_identifier, 0.1.11, "New BSD"
150150
rex-registry, 0.1.5, "New BSD"
151151
rex-rop_builder, 0.1.5, "New BSD"
152-
rex-socket, 0.1.56, "New BSD"
152+
rex-socket, 0.1.57, "New BSD"
153153
rex-sslscan, 0.1.10, "New BSD"
154154
rex-struct2, 0.1.4, "New BSD"
155155
rex-text, 0.2.56, "New BSD"

lib/rex/proto/dns/resolver.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,15 @@ def initialize(config = {})
8484
raise ResolverArgumentError, "Option #{key} not valid"
8585
end
8686
end
87+
8788
self.static_hostnames = StaticHostnames.new(hostnames: static_hosts)
88-
self.static_hostnames.parse_hosts_file
89+
begin
90+
self.static_hostnames.parse_hosts_file
91+
rescue StandardError => e
92+
@logger.error 'Failed to parse the hosts file, ignoring it'
93+
# if the hosts file is corrupted, just use a default instance with any specified hostnames
94+
self.static_hostnames = StaticHostnames.new(hostnames: static_hosts)
95+
end
8996
end
9097
#
9198
# Provides current proxy setting if configured

0 commit comments

Comments
 (0)