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

Conversation

Projects
None yet
4 participants
@space-r7
Copy link
Contributor

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-r7 wvu-r7 self-assigned this Jun 28, 2019

@wvu-r7

This comment has been minimized.

Copy link
Contributor

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-r7 wvu-r7 added the confirmed label Jun 28, 2019

wvu-r7 added a commit to wvu-r7/metasploit-framework that referenced this pull request Jun 28, 2019

@wvu-r7 wvu-r7 merged commit 6ebe192 into rapid7:master Jun 28, 2019

3 checks passed

Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wvu-r7 wvu-r7 removed the confirmed label Jun 28, 2019

@wvu-r7

This comment has been minimized.

Copy link
Contributor

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-r7

This comment has been minimized.

Copy link
Contributor

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 space-r7:creds_jtr_format_check branch Jun 28, 2019

@jmartin-r7 jmartin-r7 added the msf5 label Jun 28, 2019

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2019

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
You can’t perform that action at this time.