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 creds error #12029

Merged
merged 1 commit into from
Jun 28, 2019
Merged

Fix creds error #12029

merged 1 commit into from
Jun 28, 2019

Conversation

space-r7
Copy link
Contributor

@space-r7 space-r7 commented Jun 28, 2019

Calling creds when core.private is nil results in a crash. The fix was made prior to calling reload_lib in the output below.

Related: #11433

msf5 > creds
[-] Error while running command creds: undefined method `jtr_format' for nil:NilClass

Call stack:
/Users/space/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:474:in `block in creds_search'
/Users/space/.rvm/gems/ruby-2.6.2@metasploit-framework/gems/activerecord-4.2.11.1/lib/active_record/relation/delegation.rb:46:in `each'
/Users/space/.rvm/gems/ruby-2.6.2@metasploit-framework/gems/activerecord-4.2.11.1/lib/active_record/relation/delegation.rb:46:in `each'
/Users/space/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:441:in `creds_search'
/Users/space/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:112:in `cmd_creds'
/Users/space/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:523:in `run_command'
/Users/space/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:474:in `block in run_single'
/Users/space/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:468:in `each'
/Users/space/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:468:in `run_single'
/Users/space/metasploit-framework/lib/rex/ui/text/shell.rb:151:in `run'
/Users/space/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/Users/space/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
./msfconsole:49:in `<main>'
msf5 > reload_lib lib/msf/ui/console/command_dispatcher/creds.rb
[*] Reloading /Users/space/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb
msf5 > creds
Credentials
===========

host            origin          service         public       private                                                       realm  private_type        JtR Format
----            ------          -------         ------       -------                                                       -----  ------------        ----------
                192.168.37.246                  secondUser                                                                                            
                                                blah         blahpassword                                                         Password   

@wvu wvu self-assigned this Jun 28, 2019
@wvu
Copy link
Contributor

wvu commented Jun 28, 2019

msf5 > creds add user:space
msf5 > creds
[-] Error while running command creds: undefined method `jtr_format' for nil:NilClass

Call stack:
/rapid7/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:474:in `block in creds_search'
/Users/wvu/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/activerecord-4.2.11.1/lib/active_record/relation/delegation.rb:46:in `each'
/Users/wvu/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/activerecord-4.2.11.1/lib/active_record/relation/delegation.rb:46:in `each'
/rapid7/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:441:in `creds_search'
/rapid7/metasploit-framework/lib/msf/ui/console/command_dispatcher/creds.rb:112:in `cmd_creds'
/rapid7/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:523:in `run_command'
/rapid7/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:474:in `block in run_single'
/rapid7/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:468:in `each'
/rapid7/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:468:in `run_single'
/rapid7/metasploit-framework/lib/rex/ui/text/shell.rb:151:in `run'
/rapid7/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/rapid7/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
./msfconsole:49:in `<main>'
msf5 >

@wvu wvu added the confirmed Issues confirmed by a committer label Jun 28, 2019
wvu added a commit to wvu/metasploit-framework that referenced this pull request Jun 28, 2019
@wvu wvu merged commit 6ebe192 into rapid7:master Jun 28, 2019
@wvu wvu removed the confirmed Issues confirmed by a committer label Jun 28, 2019
@wvu
Copy link
Contributor

wvu commented Jun 28, 2019

msf5 > creds add user:space
msf5 > creds
Credentials
===========

host  origin  service  public  private  realm  private_type  JtR Format
----  ------  -------  ------  -------  -----  ------------  ----------
                       space

msf5 >

@wvu
Copy link
Contributor

wvu commented Jun 28, 2019

Release Notes

This fixes a crash in the creds command when a credential doesn't have a private object associated with it.

@space-r7 space-r7 deleted the creds_jtr_format_check branch June 28, 2019 20:03
@jmartin-tech
Copy link
Contributor

Added msf5 as jtr overhaul is currently not in 4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants