Skip to content

Commit 99d145e

Browse files
committed
made requested changes
1 parent 5d74145 commit 99d145e

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

modules/auxiliary/scanner/sap/sap_router_info_request.rb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
##
77

88
##
9-
# This module is based on, inspired by, or is a port of a plugin available in
10-
# the Onapsis Bizploit Opensource ERP Penetration Testing framework -
9+
# This module is based on, inspired by, or is a port of a plugin available in
10+
# the Onapsis Bizploit Opensource ERP Penetration Testing framework -
1111
# http://www.onapsis.com/research-free-solutions.php.
12-
# Mariano Nuñez (the author of the Bizploit framework) helped me in my efforts
12+
# Mariano Nunez (the author of the Bizploit framework) helped me in my efforts
1313
# in producing the Metasploit modules and was happy to share his knowledge and
14-
# experience - a very cool guy. I'd also like to thank Chris John Riley,
15-
# Ian de Villiers and Joris van de Vis who have Beta tested the modules and
14+
# experience - a very cool guy. I'd also like to thank Chris John Riley,
15+
# Ian de Villiers and Joris van de Vis who have Beta tested the modules and
1616
# provided excellent feedback. Some people just seem to enjoy hacking SAP :)
1717
##
1818

@@ -23,16 +23,15 @@ class Metasploit4 < Msf::Auxiliary
2323
include Msf::Auxiliary::Report
2424
include Msf::Auxiliary::Scanner
2525
include Msf::Exploit::Remote::Tcp
26-
26+
2727
def initialize
2828
super(
2929
'Name' => 'SAPRouter Admin Request',
30-
'Version' => '$Revision$',
3130
'Description' => %q{
3231
SAPRouter Admin Request (display remote route information).
3332
http://help.sap.com/saphelp_nw70ehp3/helpdata/en/48/6c68b01d5a350ce10000000a42189d/content.htm
3433
},
35-
'References' => [[ 'URL', 'http://labs.mwrinfosecurity.com' ]],
34+
'References' => [[ 'URL', 'http://labs.mwrinfosecurity.com/tools/2012/04/27/sap-metasploit-modules/' ]],
3635
'Author' => [ 'nmonkee' ],
3736
'License' => BSD_LICENSE
3837
)
@@ -41,23 +40,23 @@ def initialize
4140
Opt::RPORT(3299)
4241
], self.class)
4342
end
44-
43+
4544
def get_data(size, packet_len)
4645
info = ''
47-
for i in 1..size
46+
1.upto(size) do |i|
4847
data = sock.recv(1)
4948
packet_len -= 1
5049
if data == "\x00"
5150
sock.recv(size - i)
5251
packet_len -= size - i
5352
return info, packet_len
5453
break
55-
elsif
54+
else
5655
info << data
5756
end
5857
end
5958
end
60-
59+
6160
def run_host(ip)
6261
type = 'ROUTER_ADM'
6362
version = 0x26
@@ -86,15 +85,15 @@ def run_host(ip)
8685
connect
8786
rescue ::Rex::ConnectionRefused
8887
print_status("#{ip}:#{datastore['RPORT']} - connection refused")
89-
connected == 'false'
88+
connected = false
9089
rescue ::Rex::ConnectionError, ::IOError, ::Timeout::Error
9190
print_status("#{ip}:#{datastore['RPORT']} - connection timeout")
92-
connected == 'false'
91+
connected = false
9392
rescue ::Exception => e
9493
print_error("#{ip}:#{datastore['RPORT']} - exception #{e.class} #{e} #{e.backtrace}")
95-
connected == 'false'
94+
connected = false
9695
end
97-
if connected != 'false'
96+
if connected != false
9897
print_good("connected to saprouter")
9998
print_good("sending ROUTER_ADM packet info request")
10099
sock.put(ni_packet)
@@ -113,7 +112,7 @@ def run_host(ip)
113112
sock.recv(2)
114113
packet_len -= 2
115114
saptbl << [source, destination, service]
116-
while packet_len !=0
115+
while packet_len > 0
117116
sock.recv(13)
118117
packet_len -= 13
119118
source, packet_len = get_data(46,packet_len)

0 commit comments

Comments
 (0)