1
+ ##
2
+ # This module requires Metasploit: http://metasploit.com/download
3
+ # Current source: https://github.com/rapid7/metasploit-framework
4
+ ##
5
+
1
6
require 'msf/core'
2
7
3
8
class MetasploitModule < Msf ::Auxiliary
@@ -6,6 +11,7 @@ class MetasploitModule < Msf::Auxiliary
6
11
include Msf ::Exploit ::Remote ::SMB ::Client ::Authenticated
7
12
8
13
include Msf ::Auxiliary ::Scanner
14
+ include Msf ::Auxiliary ::Report
9
15
10
16
def initialize ( info = { } )
11
17
super ( update_info ( info ,
@@ -20,7 +26,7 @@ def initialize(info = {})
20
26
configurations. It can log on as the user "\" and connect to IPC$.
21
27
} ,
22
28
'Author' => [ 'Sean Dillon <[email protected] >' ] ,
23
- 'References' =>
29
+ 'References' =>
24
30
[
25
31
[ 'CVE' , '2017-0143' ] ,
26
32
[ 'CVE' , '2017-0144' ] ,
@@ -39,11 +45,18 @@ def run_host(ip)
39
45
begin
40
46
status = do_smb_probe ( ip )
41
47
42
- # STATUS_ACCESS_DENIED (Windows 10) and STATUS_INVALID_HANDLE (others)
43
- if status == "STATUS_ACCESS_DENIED" or status == "STATUS_INVALID_HANDLE"
44
- print_good ( "Host does NOT appear vulnerable." )
45
- elsif status == "STATUS_INSUFF_SERVER_RESOURCES"
48
+ if status == "STATUS_INSUFF_SERVER_RESOURCES"
46
49
print_warning ( "Host is likely VULNERABLE to MS17-010!" )
50
+ report_vuln (
51
+ :host => rhost ,
52
+ :port => rport ,
53
+ :proto => 'tcp' ,
54
+ :sname => 'SMB' ,
55
+ :info => "Vulnerable to MS17-010" ,
56
+ )
57
+ elsif status == "STATUS_ACCESS_DENIED" or status == "STATUS_INVALID_HANDLE"
58
+ # STATUS_ACCESS_DENIED (Windows 10) and STATUS_INVALID_HANDLE (others)
59
+ print_good ( "Host does NOT appear vulnerable." )
47
60
else
48
61
print_bad ( "Unable to properly detect if host is vulnerable." )
49
62
end
0 commit comments