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

Cannot start msfconsole after upgrade #18198

Closed
Fancy-Hawaii opened this issue Jul 19, 2023 · 8 comments · Fixed by #18171
Closed

Cannot start msfconsole after upgrade #18198

Fancy-Hawaii opened this issue Jul 19, 2023 · 8 comments · Fixed by #18171
Assignees
Labels
bug Stale Marks an issue as stale, to be closed if no action is taken

Comments

@Fancy-Hawaii
Copy link

Fancy-Hawaii commented Jul 19, 2023

Steps to reproduce

  1. Update metasploit on Kali with apt-get update, apt-get upgrade etc.
  2. start msfconsole -> error

Were you following a specific guide/tutorial or reading documentation?

Updated kali packages as recommended

Expected behavior

msfconsole should start

Current behavior

error message!

> 
──(root💀kali)-[~/temp]
└─# msfconsole                                                                                                                    1 ⨯
/usr/share/metasploit-framework/lib/msf/core/payload_set.rb:181:in `stage_and_stager_compatible?': undefined method `dependencies' for nil:NilClass (NoMethodError)
	from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:239:in `calculate_staged_payload'
	from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:364:in `add_cached_module'
	from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:318:in `add_module'
	from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:108:in `on_module_load'
	from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:202:in `load_module'
	from /usr/share/metasploit-framework/lib/msf/core/module_manager/cache.rb:101:in `block in load_cached_module'
	from /usr/share/metasploit-framework/lib/msf/core/module_manager/cache.rb:98:in `each'
	from /usr/share/metasploit-framework/lib/msf/core/module_manager/cache.rb:98:in `load_cached_module'
	from /usr/share/metasploit-framework/lib/msf/core/module_set.rb:42:in `create'
	from /usr/share/metasploit-framework/lib/msf/core/module_set.rb:168:in `valid?'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:569:in `handle_payload'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:403:in `on_variable_set'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:224:in `block in load_preconfig'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:223:in `each_pair'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:223:in `load_preconfig'
	from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:88:in `initialize'
	from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:60:in `new'
	from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:60:in `driver'
	from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
	from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
	from /usr/bin/msfconsole:23:in `<main>'

Metasploit version

metasploit-framework (6.3.25-0kali1)

I deleted and reinstalled metasploit-framework, but still the same behaviour!

@dwelch-r7 dwelch-r7 self-assigned this Jul 19, 2023
@dwelch-r7
Copy link
Contributor

Hi @Fancy-Hawaii thanks for reporting this issue, could you take a look in your ~/.msf4/config file and find the section like this

[framework/ui/console]
ActiveModule=path/to/your/module

If you get that to me I might be able to replicate the issue
You can also try removing this section from the config and see if it lets framework boot up for you again to unblock you while we take a look at the issue

@Fancy-Hawaii
Copy link
Author

Thanks for your immediate reply.

Here it is:

[framework/ui/console] ActiveModule=exploit/multi/handler

Removing that section still throws that error.

@Fancy-Hawaii
Copy link
Author

Fancy-Hawaii commented Jul 19, 2023

ok, removing this

payload=windows/x64/meterpreter/reverse_tcp

from section
[framework/core]

lets the framework boot up!

@dwelch-r7
Copy link
Contributor

Good to hear!
I'll try and replicate this soon as I can, feel free to drop anymore similar issues you run into here if you can't load a module/payload even after framework has booted up

@dwelch-r7
Copy link
Contributor

dwelch-r7 commented Jul 25, 2023

~@Fancy-Hawaii I got a chance to look into this a bit, unfortunately (or fortunately depending on your pov) I haven't been able to replicate your issue on master ~

I don't suppose you have any more details you can share like what version of framework were you on before and after (I presume 6.3.25-0kali1 was the after) the update, and the remaining contents of your ~/.msf4/config directory (please make sure to redact any potential private data in there)

Don't worry if you don't have all/any of this but it might help narrow down the cause

In the meantime I'm working on a fix so that if someone runs into a similar issue in the future it won't completely crash msfconsole

Nevermind I replicated it! I totally glossed over this last time:

ok, removing this
payload=windows/x64/meterpreter/reverse_tcp
from section
[framework/core]

That happens if you setg payload path/to/payload which is not something I thought we could even do to be honest with you 😅

@Fancy-Hawaii
Copy link
Author

Fancy-Hawaii commented Aug 1, 2023

Ok cool, thanks for your effort and answer.

Maybe a logical bug in my brain then.... :-)

@github-actions
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Aug 31, 2023
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Stale Marks an issue as stale, to be closed if no action is taken
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants