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

Fix windows DNS crash on bootup #19523

Merged

Conversation

adfoster-r7
Copy link
Contributor

Closes #19516

Best reviewed with whitespace ignored

Verification

I manually set arr to match the user's resolv info of a nil searchlist.

Before

Crash

c:/a/metasploit-framework/lib/net/dns/resolver.rb:282:in `searchlist=': Wrong argument format, neither String nor Array (ResolverArgumentError)
        from c:/a/metasploit-framework/lib/net/dns/resolver.rb:1086:in `parse_config_file'
        from c:/a/metasploit-framework/lib/rex/proto/dns/resolver.rb:66:in `initialize'
        from c:/a/metasploit-framework/lib/rex/proto/dns/cached_resolver.rb:25:in `initialize'
        from c:/a/metasploit-framework/lib/msf/ui/console/driver.rb:86:in `new'
        from c:/a/metasploit-framework/lib/msf/ui/console/driver.rb:86:in `initialize'
        from c:/a/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in `new'
        from c:/a/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in `driver'
        from c:/a/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in `start'
        from c:/a/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
        from msfconsole:23:in `<main>'

After

verified there was no longer a crash:

msf6 >

else
self.nameservers += [ip_addr]
end
IO.foreach(@config[:config_file]) do |line|
Copy link
Contributor Author

@adfoster-r7 adfoster-r7 Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for me; but looks like there's an existing edge-case here, where we might be have partially parsed this file before encountering an error - and we don't revert state back, or continue parsing the rest of the file

@adfoster-r7 adfoster-r7 merged commit 2ea71c4 into rapid7:master Oct 1, 2024
36 checks passed
@adfoster-r7 adfoster-r7 deleted the fix-windows-dns-crash-on-bootup branch October 1, 2024 12:49
@jharris-r7 jharris-r7 added the rn-fix release notes fix label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

`searchlist=': Wrong argument format, neither String nor Array (ResolverArgumentError)
3 participants