Skip to content

Commit 35604ac

Browse files
committed
Normalizing caps and expanding description a bit
Be nice to have a couple more lines on the description
1 parent 5d7197d commit 35604ac

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

modules/auxiliary/scanner/sap/sap_router_info_request.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize
1717
super(
1818
'Name' => 'SAPRouter Admin Request',
1919
'Description' => %q{
20-
Display remote route information.
20+
Display the remote connection table from a SAPRouter.
2121
},
2222
'References' => [
2323
[ 'URL', 'http://labs.mwrinfosecurity.com/tools/2012/04/27/sap-metasploit-modules/' ],
@@ -56,6 +56,7 @@ def get_data(size, packet_len)
5656
end
5757

5858
def run_host(ip)
59+
host_port = "#{ip}:#{datastore['RPORT']}"
5960
type = 'ROUTER_ADM'
6061
version = 0x26
6162
cmd = 0x2
@@ -82,21 +83,21 @@ def run_host(ip)
8283
begin
8384
connect
8485
rescue ::Rex::ConnectionRefused
85-
print_status("#{ip}:#{datastore['RPORT']} - connection refused")
86+
print_status("#{host_port} - Connection refused")
8687
connected = false
8788
rescue ::Rex::ConnectionError, ::IOError, ::Timeout::Error
88-
print_status("#{ip}:#{datastore['RPORT']} - connection timeout")
89+
print_status("#{host_port} - Connection timeout")
8990
connected = false
9091
rescue ::Exception => e
91-
print_error("#{ip}:#{datastore['RPORT']} - exception #{e.class} #{e} #{e.backtrace}")
92+
print_error("#{host_port} - Exception #{e.class} #{e} #{e.backtrace}")
9293
connected = false
9394
end
9495
if connected != false
95-
print_good("connected to saprouter")
96-
print_good("sending ROUTER_ADM packet info request")
96+
print_good("#{host_port} - Connected to saprouter")
97+
print_good("#{host_port} - Sending ROUTER_ADM packet info request")
9798
sock.put(ni_packet)
9899
packet_len = sock.read(4).unpack('H*')[0].to_i 16
99-
print_good("got INFO response")
100+
print_good("#{host_port} - Got INFO response")
100101
while packet_len !=0
101102
count += 1
102103
case count
@@ -122,7 +123,7 @@ def run_host(ip)
122123
end
123124
packet_len = sock.recv(4).unpack('H*')[0].to_i 16
124125
else
125-
print_error("no connected clients :'(")
126+
print_error("#{host_port} - No connected clients")
126127
sock.recv(packet_len)
127128
packet_len = sock.recv(4).unpack('H*')[0].to_i 16
128129
end
@@ -150,6 +151,7 @@ def run_host(ip)
150151
end
151152
end
152153
disconnect
154+
# TODO: This data should be saved somewhere. A note on the host would be nice.
153155
print(saptbl.to_s)
154156
end
155157
end

0 commit comments

Comments
 (0)