metasploit-framework
metasploit-framework copied to clipboard
Metasploit crashes on bad hosts entry
Steps to reproduce
How'd you do it?
- Update msf to latest version (v6.4.0-dev)
- Add bad host line in /etc/hosts (ex.
127.0.0.1 badhost.host.
- with dot at the end) - Run
msfconsole
Done on rolling kali release.
Here's stacktrace:
root@kali:~# msfconsole
Metasploit tip: View all productivity tips with the tips command
/usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:84:in `add': Invalid hostname: intelligence.htb. (ArgumentError)
from /usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:48:in 'block (2 levels) in parse_hosts_file'
from /usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:47:in 'each'
from /usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:47:in 'block in parse_hosts_file'
from /usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:42:in 'foreach'
from /usr/share/metasploit-framework/lib/rex/proto/dns/static_hostnames.rb:42:in 'parse_hosts_file'
from /usr/share/metasploit-framework/lib/rex/proto/dns/resolver.rb:88:in 'initialize'
from /usr/share/metasploit-framework/lib/rex/proto/dns/cached_resolver.rb:25:in 'initialize'
from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:86:in 'new'
from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:86:in 'initialize'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in 'new'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in 'driver'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in 'start'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in 'start'
from /usr/bin/msfconsole:23:in '<main>'
Changed only some quote marks in dump to correctly show it here. The solution is to remove this "bad" hosts entry.
Were you following a specific guide/tutorial or reading documentation?
No
Expected behavior
Metasploit Framework should start
Current behavior
Because of bad hosts entry, msf won't start
Metasploit version
Framework: 6.4.0-dev Console : 6.4.0-dev