diff --git a/modules/auxiliary/scanner/http/jenkins_enum.rb b/modules/auxiliary/scanner/http/jenkins_enum.rb index 5f5b2ebbe7..4f3558e3f5 100644 --- a/modules/auxiliary/scanner/http/jenkins_enum.rb +++ b/modules/auxiliary/scanner/http/jenkins_enum.rb @@ -164,52 +164,37 @@ class Metasploit3 < Msf::Auxiliary infos[td] = tds[idx+1].get_text.to_s.strip if infos.has_key?(td) end + fprint = {} + jinfo = {} + # print out the goodies infos.each do |k, v| next if v.nil? + v = v.strip + next if v.length == 0 + + jinfo[k.gsub(/\s+/, '_')] = v + case k when "os.name" vprint_line(" OS: #{v}") - report_host({:host => rhost, :os_name => v}) + fprint['os.product'] = v when "os.version" vprint_line(" OS Version: #{v}") - report_host({:host => rhost, :os_flavor => v}) + fprint['os.version'] = v when "sun.os.patch.level" vprint_line(" Patch Level: #{v}") when "os.arch" vprint_line(" Arch: #{v}") - report_note({ - :type => "system_arch", - :host => rhost, - :data => "Arch: #{v}", - :update => :unique_data - }) + fprint['os.arch'] = v when "user.name" vprint_line(" User: #{v}") - report_note({ - :type => "jenkins_user", - :host => rhost, - :port => rport, - :proto => 'tcp', - :data => "User: #{v}", - :update => :unique_data - }) when "USERDOMAIN" vprint_line(" Domain: #{v}") - report_note({ - :type => "system_domain", - :host => rhost, - :data => "Domain: #{v}", - :update => :unique_data - }) + fprint['host.domain'] = v when "COMPUTERNAME" vprint_line(" Computer Name: #{v}") - report_note({ - :type => "system_computer", - :host => rhost, - :data => "Computer Name: #{v}", - :update => :unique_data - }) + fprint['host.name'] = v when "SystemDrive" vprint_line(" System Drive: #{v}") when "SHELL" @@ -222,30 +207,20 @@ class Metasploit3 < Msf::Auxiliary vprint_line(" Home Directory: #{v}") when "user.language" vprint_line(" Language: #{v}") - report_note({ - :type => "system_lang", - :host => rhost, - :data => "Language: #{v}", - :update => :unique_data - }) + fprint['os.language'] = v when "user.country" vprint_line(" Country: #{v}") - report_note({ - :type => "system_country", - :host => rhost, - :data => "Country: #{v}", - :update => :unique_data - }) when "user.timezone" vprint_line(" Timezone: #{v}") - report_note({ - :type => "system_timezone", - :host => rhost, - :data => "Timezone: #{v}", - :update => :unique_data - }) end end + + # Report a fingerprint.match for OS fingerprinting support, tied to this service + report_note(:host => rhost, :port => rport, :proto => 'tcp', :ntype => 'fingerprint.match', :data => fprint) + + # Report a jenkins information note for future analysis, tied to this service + report_note(:host => rhost, :port => rport, :proto => 'tcp', :ntype => 'jenkins.info', :data => jinfo) + vprint_line('') end end