-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Report CA and ADCS Template along with Pkcs12 in the database #19736
base: master
Are you sure you want to change the base?
Report CA and ADCS Template along with Pkcs12 in the database #19736
Conversation
…base - Update the `creds` command to add Pkcs12 private credentials with metadata. - Update `ms_icpr` module to store metadata.
@@ -414,11 +420,13 @@ def creds_search(*args) | |||
when 'password' | |||
Metasploit::Credential::Password | |||
when 'hash' | |||
Metasploit::Credential::PasswordHash | |||
Metasploit::Credential::NonreplayableHash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently hash
corresponds to a Nonreplayable hash instead of a PasswordHash. This change were required otherwise the specs were failing.
# realm: nil, | ||
# workspace: framework.db.workspace) | ||
# end | ||
let!(:ntlm_core) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are now working properly. I've added them back even if it is not related to the changes in this PR.
gem 'metasploit-credential', git: 'https://github.com/cdelafuente-r7/metasploit-credential', branch: 'enh/MS-9710/add_pkcs12_metadata' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be reverted before landing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file will need to be updated to point to the new metasploit-credential
gem is available instead of the this feature branch.
This adds support to the new Pkcs12 data format added in rapid7/metasploit-credential#183. Now, the CA and ADCS template can be added to the Pkcs12 as metadata in the database.
This PR needs the
metasploit-credentials
counterpart be landed first. I have updated the Gemfile to point to the feature branch to be able to test it. This will need to be reverted before landing.Verification
Testing
auxiliary/admin/dcerpc/icpr_cert
Follow the instructions here to set up an AD CS server for testing purposes.
msfconsole
use auxiliary/admin/dcerpc/icpr_cert
run verbose=true CA=<CA name> RHOSTS=<remote host> username=<username> password=<user password> CERT_TEMPLATE=User
creds
returns the generated Pkcs12irb
inmsfconsole
the Pkcs12 model has the expected data format"msf_pkcs12:<base64 Pkcs12>:<CA>:<ADCS Template>"
Testing
creds
commandmsfconsole
creds add user:testuser pkcs12:<pkcs12 filepath> ca:myca adcs-template:OtherTemplate
irb
inmsfconsole
the Pkcs12 model has the expected data format"msf_pkcs12:<base64 Pkcs12>:<CA>:<ADCS Template>"