From b20a283617d06274308beb9f2e533ddcb1eb7afc Mon Sep 17 00:00:00 2001 From: Mo Sadek Date: Thu, 20 Aug 2015 13:57:16 -0500 Subject: [PATCH] Added report_note to suggester --- .../post/multi/recon/local_exploit_suggester.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/post/multi/recon/local_exploit_suggester.rb b/modules/post/multi/recon/local_exploit_suggester.rb index 64962b4ac6..f3ca1ca464 100644 --- a/modules/post/multi/recon/local_exploit_suggester.rb +++ b/modules/post/multi/recon/local_exploit_suggester.rb @@ -5,6 +5,8 @@ require 'msf/core' +include Msf::Auxiliary::Report + class Metasploit3 < Msf::Post def initialize(info={}) @@ -14,11 +16,10 @@ class Metasploit3 < Msf::Post This module suggests local meterpreter exploits that can be used. The exploits are suggested based on the architecture and platform that the user has a shell opened as well as the available exploits in - meterpreter. Additionally, the ShowDescription option can be set - to 'true' to a detailed description on the suggested exploits. + meterpreter. It's important to note that not all local exploits will be fired. - They are chosen based on these conditions: session type, + Exploits are chosen based on these conditions: session type, platform, architecture, and required default options. }, 'License' => MSF_LICENSE, @@ -138,7 +139,7 @@ class Metasploit3 < Msf::Post end show_found_exploits - + results = [] @local_exploits.each do |m| begin checkcode = m.check @@ -146,6 +147,7 @@ class Metasploit3 < Msf::Post if is_check_interesting?(checkcode) # Prints the full name and the checkcode message for the exploit print_good("#{m.fullname}: #{checkcode.second}") + results << [m.fullname, checkcode.second] # If the datastore option is true, a detailed description will show if datastore['SHOWDESCRIPTION'] # Formatting for the description text @@ -160,9 +162,13 @@ class Metasploit3 < Msf::Post vprint_error("#{e.class} #{m.shortname} failled to run: #{e.message}") end end + report_note( + :host => rhost, + :type => "les_results", + :data => results.inspect + ) end - def is_check_interesting?(checkcode) [ Msf::Exploit::CheckCode::Vulnerable,