Skip to content

Commit

Permalink
Merge pull request #19873 from adfoster-r7/remove-report-note-calls-f…
Browse files Browse the repository at this point in the history
…rom-vuln-cert-finder

Remove report note calls from vuln cert finder
  • Loading branch information
smcintyre-r7 authored Feb 11, 2025
2 parents 517bf54 + 0fefe06 commit a9ab666
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions modules/auxiliary/gather/ldap_esc_vulnerable_cert_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -543,21 +543,14 @@ def find_enrollable_vuln_certificate_templates
ca_server_ip_address = get_ip_addresses_by_fqdn(ca_server_fqdn)&.first

if ca_server_ip_address
service = report_service({
report_service({
host: ca_server_ip_address,
port: 445,
proto: 'tcp',
name: 'AD CS',
info: "AD CS CA name: #{ca_server[:name][0]}"
})

report_note({
data: ca_server[:dn][0].to_s,
service: service,
host: ca_server_ip_address,
ntype: 'windows.ad.cs.ca.dn'
})

report_host({
host: ca_server_ip_address,
name: ca_server_fqdn
Expand Down Expand Up @@ -618,7 +611,7 @@ def print_vulnerable_cert_info
info = hash[:notes].select { |note| note.start_with?(prefix) }.map { |note| note.delete_prefix(prefix).strip }.join("\n")
info = nil if info.blank?

hash[:ca_servers].each do |ca_fqdn, ca_server|
hash[:ca_servers].each_value do |ca_server|
service = report_service({
host: ca_server[:ip_address],
port: 445,
Expand All @@ -641,14 +634,6 @@ def print_vulnerable_cert_info
else
vuln = nil
end

report_note({
data: hash[:dn],
service: service,
host: ca_fqdn.to_s,
ntype: 'windows.ad.cs.ca.template.dn',
vuln_id: vuln&.id
})
end
end
end
Expand Down

0 comments on commit a9ab666

Please sign in to comment.