Skip to content

Commit 26fc6bc

Browse files
author
zerosum0x0
committed
added report_vuln()
1 parent 4bd50b0 commit 26fc6bc

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

modules/auxiliary/scanner/smb/smb_ms17_010.rb

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
16
require 'msf/core'
27

38
class MetasploitModule < Msf::Auxiliary
@@ -6,6 +11,7 @@ class MetasploitModule < Msf::Auxiliary
611
include Msf::Exploit::Remote::SMB::Client::Authenticated
712

813
include Msf::Auxiliary::Scanner
14+
include Msf::Auxiliary::Report
915

1016
def initialize(info = {})
1117
super(update_info(info,
@@ -20,7 +26,7 @@ def initialize(info = {})
2026
configurations. It can log on as the user "\" and connect to IPC$.
2127
},
2228
'Author' => [ 'Sean Dillon <[email protected]>' ],
23-
'References' =>
29+
'References' =>
2430
[
2531
[ 'CVE', '2017-0143'],
2632
[ 'CVE', '2017-0144'],
@@ -39,11 +45,18 @@ def run_host(ip)
3945
begin
4046
status = do_smb_probe(ip)
4147

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"
4649
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.")
4760
else
4861
print_bad("Unable to properly detect if host is vulnerable.")
4962
end

0 commit comments

Comments
 (0)