Fixes a nil
error if login is successful with ldap_login
module
#19438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue when
create_credential_and_login
inlib/metasploit/framework/data_service/proxy/credential_data_proxy.rb
is called, which doesn't call of tocreate_credential_login
at any point to initialize@report[rhost]
. This was causing thenil
error as theldap_login
module made use of theMsf::Auxiliary::ReportSummary
mixin but never calledcreate_credential_login
which is the method the mixin had original overridden. This also wasn't been caught on the CI LDAP acceptance testing as theldap_session_type
feature is set tofalse
by default currently.Before
After
Verification
features set ldap_session_type true
auxiliary/scanner/ldap/ldap_login
against an ldap server to get a session (an example of running an ldap container can be found in the ldap acceptance tests heremetasploit-framework/.github/workflows/ldap_acceptance.yml
Lines 67 to 71 in 33ffc14
SPEC_OPTS='--tag acceptance' SPEC_HELPER_LOAD_METASPLOIT=false bundle exec rspec ./spec/acceptance/ldap_spec.rb
and ensure those pass locally.