-
Notifications
You must be signed in to change notification settings - Fork 0
/
explodingcan.rb
75 lines (69 loc) · 2.45 KB
/
explodingcan.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Scanner
def initialize(info = {})
super(update_info(info,
'Name' => 'Windows Server 2003 & IIS 6.0 - Remote Code Execution',
'Description' => %q{
Internet Information Services (IIS) 6.0 in Microsoft Windows Server 2003 R2
contains a buffer overflow vulnerability in the ScStoragePathFromUrl function
in the WebDAV service that could allow remote attackers to execute arbitrary
code via a long header beginning with "If <http://" in a PROPFIND request.
},
'Author' => [
'K3ysTr0K3R'
],
'References' => [
['URL', 'https://blog.0patch.com/2017/03/0patching-immortal-cve-2017-7269.html'],
['URL', 'https://github.com/danigargu/explodingcan/blob/master/explodingcan.py'],
['CVE', '2017-7269'],
['URL', 'https://github.com/edwardz246003/IIS_exploit'],
['URL', 'http://www.securitytracker.com/id/1038168']
],
'DisclosureDate' => '2017-03-27',
'License' => MSF_LICENSE
))
register_options(
[
Opt::RPORT(80),
OptInt.new('THREADS', [true, 'The number of concurrent threads', 10])
]
)
end
def run_host(ip)
print_status("Checking #{ip} for CVE-2017-7269 vulnerability...")
begin
res = send_request_cgi({
'method' => 'OPTIONS',
'uri' => '/',
})
if res && res.code == 200
headers = res.headers
if headers['Public']&.include?('PROPFIND') || headers['Allow']&.include?('PROPFIND')
print_good("#{ip} is vulnerable to CVE-2017-7269 (IIS 6.0 - WebDAV)")
report_vuln(
host: ip,
name: 'CVE-2017-7269',
refs: ['CVE-2017-7269'],
info: 'IIS 6.0 - WebDAV RCE vulnerability'
)
report_note(
host: ip,
type: 'vulnerability',
data: {
name: 'CVE-2017-7269',
description: 'IIS 6.0 - WebDAV RCE vulnerability',
refs: ['CVE-2017-7269']
}
)
else
print_status("#{ip} is not vulnerable to CVE-2017-7269")
end
else
print_error("Failed to get a response from #{ip}")
end
rescue ::Rex::ConnectionError, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
print_error("Connection failed to #{ip}: #{e}")
end
end
end