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 SSH Key Display When Running creds #11058

Merged
merged 2 commits into from Dec 4, 2018

Conversation

Projects
None yet
2 participants
@jbarnett-r7
Contributor

jbarnett-r7 commented Dec 3, 2018

This PR fixes a display issue introduced in msf5 that caused SSH keys stored in the database to display the entire key, instead of the fingerprint.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • Import an SSH key into your database creds add user:admin ssh-key:</path/to/key>
  • Run the creds command and verify the output looks correct

@mkienow-r7 mkienow-r7 self-requested a review Dec 4, 2018

@mkienow-r7

This comment has been minimized.

Contributor

mkienow-r7 commented Dec 4, 2018

This appears to only resolve the issue when the user is connected to the local data service.

Remote data service

msf5 > creds add user:admin ssh-key:/home/msfdev/metasploit-framework/test_id_rsa
msf5 > creds
Credentials
===========

host  origin  service  public  private                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     realm  private_type
----  ------  -------  ------  -------                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     -----  ------------
                       admin   -----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAyNPIrYX6yf7Ovjh1UqJ66s+oFTOtL9/SItcpIbbuLgk1tkfp
nqQt/Ke5PWH/vEbTGi5PolhnHxaTDpRXraNtMmDHH/vt6Kcd7c9UTrckImFGnGpJ
<truncated...>
-----END RSA PRIVATE KEY-----
         Private

msf5 > db_status 
[*] Connected to remote_data_service: (https://localhost:8080). Connection type: http. Connection name: local-https-data-service.

Local data service

msf5 > db_disconnect 
Successfully disconnected from the data service: remote_data_service: (https://localhost:8080).
msf5 > db_status 
[*] Connected to msf. Connection type: postgresql.
msf5 > creds add user:admin ssh-key:/home/msfdev/metasploit-framework/test_id_rsa
msf5 > creds
Credentials
===========

host  origin  service  public  private                                          realm  private_type
----  ------  -------  ------  -------                                          -----  ------------
                       admin   a5:e3:90:cc:58:9a:74:c3:2c:0c:55:ce:65:6f:c9:d0         SSH key

@mkienow-r7 mkienow-r7 merged commit 8799c55 into rapid7:master Dec 4, 2018

2 checks passed

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

mkienow-r7 added a commit that referenced this pull request Dec 4, 2018

@mkienow-r7 mkienow-r7 added the msf5 label Dec 4, 2018

@mkienow-r7

This comment has been minimized.

Contributor

mkienow-r7 commented Dec 4, 2018

Release Notes

Fixes a creds command regression from the 4.x branch with the output of SSH keys.

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