Made requested changes
parent
ff07e5d021
commit
564a32ce7c
|
@ -108,16 +108,17 @@ class Metasploit4 < Msf::Auxiliary
|
|||
'Content-Type' => 'text/xml; charset=UTF-8'
|
||||
}
|
||||
}, 45)
|
||||
if res and res.code != 500 and res.code != 200
|
||||
if res
|
||||
if res.code != 500 and res.code != 200
|
||||
print_error("[SAP] #{ip}:#{rport} - something went wrong!")
|
||||
return
|
||||
elsif res and res.body =~ /faultstring/
|
||||
elsif res.body =~ /faultstring/
|
||||
error = res.body.scan(%r{<faultstring>(.*?)</faultstring>}).flatten
|
||||
0.upto(output.length-1) do |i|
|
||||
print_error("[SAP] #{ip}:#{rport} - error #{error[i]}")
|
||||
end
|
||||
return
|
||||
elsif res
|
||||
end
|
||||
print_status("[SAP] #{ip}:#{rport} - got response")
|
||||
output = res.body.scan(%r{<MESSAGE>([^<]+)</MESSAGE>}).flatten
|
||||
result = []
|
||||
|
@ -143,14 +144,13 @@ class Metasploit4 < Msf::Auxiliary
|
|||
'Indent' => 1,
|
||||
'Columns' =>["Output"]
|
||||
)
|
||||
for i in 0..result.length/2-1
|
||||
0.upto(result.length/2-1) do |i|
|
||||
saptbl << [result[i].chomp]
|
||||
end
|
||||
print (saptbl.to_s)
|
||||
return
|
||||
else
|
||||
print_error("[SAP] #{ip}:#{rport} - Unknown error")
|
||||
return
|
||||
print_error("[SAP] #{ip}:#{rport} - no response")
|
||||
end
|
||||
rescue ::Rex::ConnectionError
|
||||
print_error("[SAP] #{ip}:#{rport} - Unable to connect")
|
||||
|
|
Loading…
Reference in New Issue