smb_login: Add report_service (regardless of RECORD_GUEST)

RECORD_GUEST = creds, not service
This commit is contained in:
g0t mi1k
2026-04-22 06:32:00 +01:00
parent 4f77df25ba
commit 76cae04e91
2 changed files with 11 additions and 5 deletions
@@ -311,7 +311,9 @@ class MetasploitModule < Msf::Auxiliary
connect(versions: [1, 2, 3])
end
smb_login
break unless enum_shares(ip)&.empty?
shares = enum_shares(ip)
next if shares.nil? || shares.empty?
break
rescue ::Interrupt
raise $ERROR_INFO
rescue Errno::ECONNRESET => e
+8 -4
View File
@@ -270,10 +270,6 @@ class MetasploitModule < Msf::Auxiliary
# Private can be nil if we authenticated with Kerberos and a cached ticket was used. No need to report this.
return unless result.credential.private
if !datastore['RECORD_GUEST'] && (result.access_level == Metasploit::Framework::LoginScanner::SMB::AccessLevels::GUEST)
return
end
service_data = {
address: ip,
port: port,
@@ -282,6 +278,14 @@ class MetasploitModule < Msf::Auxiliary
workspace_id: myworkspace_id
}
report_service(
host: service_data[:address],
port: service_data[:port],
proto: service_data[:protocol],
name: service_data[:service_name]
)
return if !datastore['RECORD_GUEST'] && result.access_level == Metasploit::Framework::LoginScanner::SMB::AccessLevels::GUEST
credential_data = {
module_fullname: fullname,
origin_type: :service,