Skip to content

Commit b676f5a

Browse files
committed
Clean up rapid7#4795
1 parent f6c871a commit b676f5a

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

modules/auxiliary/gather/f5_bigip_cookie_disclosure.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ def initialize(info = {})
1515
'Name' => 'F5 BigIP Backend Cookie Disclosure',
1616
'Description' => %q{
1717
This module identifies F5 BigIP load balancers and leaks backend
18-
information (pool name, backend's IP address and port, routed domain) through cookies inserted by the BigIP system.
18+
information (pool name, backend's IP address and port, routed domain)
19+
through cookies inserted by the BigIP system.
1920
},
20-
'Author' => [ 'Thanat0s <thanspam[at]trollprod.org>',
21-
'Oleg Broslavsky <ovbroslavsky[at]gmail.com>',
22-
'Nikita Oleksov <neoleksov[at]gmail.com>',
23-
'Denis Kolegov <dnkolegov[at]gmail.com>'
24-
],
21+
'Author' =>
22+
[
23+
'Thanat0s <thanspam[at]trollprod.org>',
24+
'Oleg Broslavsky <ovbroslavsky[at]gmail.com>',
25+
'Nikita Oleksov <neoleksov[at]gmail.com>',
26+
'Denis Kolegov <dnkolegov[at]gmail.com>'
27+
],
2528
'References' =>
2629
[
2730
['URL', 'http://support.f5.com/kb/en-us/solutions/public/6000/900/sol6917.html'],
@@ -69,11 +72,11 @@ def cookie_decode(cookie_value)
6972
host = $1.to_i(16)
7073
port = $2.to_i
7174
host = Rex::Socket.addr_itoa(host, v6=true)
72-
elsif cookie_value =~ /!(.){104}/
75+
elsif cookie_value =~ /!.{104}/
7376
host = nil
7477
port = nil
7578
end
76-
back_end = (host.nil?) ? nil : "#{host}:#{port}"
79+
host.nil? ? nil : "#{host}:#{port}"
7780
end
7881

7982
def get_cookie # request a page and extract a F5 looking cookie.
@@ -92,9 +95,8 @@ def get_cookie # request a page and extract a F5 looking cookie.
9295
# 5. Encrypted cookies - "BIGipServerWEB=!dcdlUciYEFlt1QzXtD7QKx22XJx7Uuj2I0dYdFTwJASsJyJySME9/GACjztr7WYJIvHxTSNreeve7foossGzKS3vT9ECJscSg1LAc3rc"
9396

9497
m = res.get_cookies.match(/([~_\.\-\w\d]+)=(((?:\d+\.){2}\d+)|(rd\d+o0{20}f{4}\w+o\d{1,5})|(vi([a-f0-9]{32})\.(\d{1,5}))|(rd\d+o([a-f0-9]{32})o(\d{1,5}))|(!(.){104}))(?:$|,|;|\s)/)
95-
cookie[:id] = (m.nil?) ? nil : m[1]
96-
cookie[:value] = (m.nil?) ? nil : m[2]
97-
98+
cookie[:id] = m.nil? ? nil : m[1]
99+
cookie[:value] = m.nil? ? nil : m[2]
98100
end
99101

100102
cookie
@@ -115,7 +117,7 @@ def run
115117
# If the cookie is not found, stop process
116118
if cookie.empty? || cookie[:id].nil?
117119
print_error("#{peer} - F5 BigIP load balancing cookie not found")
118-
break
120+
break
119121
end
120122

121123
# Print the cookie name on the first request

0 commit comments

Comments
 (0)