From 5ea6a1027aff4a41e2140166a951451d0ecc9aa0 Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 21 Apr 2009 05:59:46 +0000 Subject: [PATCH] report os detection in smb version scanner git-svn-id: file:///home/svn/framework3/trunk@6494 4d416f70-5f16-0410-b530-b9f4589650da --- modules/auxiliary/scanner/smb/version.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/auxiliary/scanner/smb/version.rb b/modules/auxiliary/scanner/smb/version.rb index 1f0141b409..6a6b68a20e 100644 --- a/modules/auxiliary/scanner/smb/version.rb +++ b/modules/auxiliary/scanner/smb/version.rb @@ -22,6 +22,7 @@ class Metasploit3 < Msf::Auxiliary # Scanner mixin should be near last include Msf::Auxiliary::Scanner + include Msf::Auxiliary::Report # Aliases for common classes SIMPLE = Rex::Proto::SMB::SimpleClient @@ -54,6 +55,20 @@ class Metasploit3 < Msf::Auxiliary if(res['os'] and res['os'] != 'Unknown') print_status("#{rhost} is running #{res['os']} #{res['sp']} (language: #{res['lang']})") + report_service(:host => ip, :port => info[0]) + case res['os'] + when /Windows/ + os = OperatingSystems::WINDOWS + else + os = OperatingSystems::UNKNOWN + end + report_host({ + :host => ip, + :os_flavor => res['os'], + :os_lang => res['lang'], + :os_name => os, + :os_sp => res['sp'], + }) else print_status("#{rhost} could not be identified") end