made requested changes

unstable
nmonkee 2012-11-14 23:25:25 +00:00
parent 3be7ad06c4
commit a252dbc5d7
1 changed files with 21 additions and 23 deletions

View File

@ -1,15 +1,15 @@
## ##
# This file is part of the Metasploit Framework and may be subject to # This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit # redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use. # Framework web site for more information on licensing and terms of use.
# http://metasploit.com/ # http://metasploit.com/framework/
## ##
## ##
# This module is based on, inspired by, or is a port of a plugin available in # This module is based on, inspired by, or is a port of a plugin available in
# the Onapsis Bizploit Opensource ERP Penetration Testing framework - # the Onapsis Bizploit Opensource ERP Penetration Testing framework -
# http://www.onapsis.com/research-free-solutions.php. # http://www.onapsis.com/research-free-solutions.php.
# Mariano Nuñez (the author of the Bizploit framework) helped me in my efforts # Mariano Nunez (the author of the Bizploit framework) helped me in my efforts
# in producing the Metasploit modules and was happy to share his knowledge and # in producing the Metasploit modules and was happy to share his knowledge and
# experience - a very cool guy. I'd also like to thank Chris John Riley, # experience - a very cool guy. I'd also like to thank Chris John Riley,
# Ian de Villiers and Joris van de Vis who have Beta tested the modules and # Ian de Villiers and Joris van de Vis who have Beta tested the modules and
@ -27,12 +27,11 @@ class Metasploit4 < Msf::Auxiliary
def initialize def initialize
super( super(
'Name' => 'SAP SOAP RFC_PING', 'Name' => 'SAP SOAP RFC_PING',
'Version' => '$Revision$',
'Description' => %q{ 'Description' => %q{
Calls the RFC_PING RFC module via SOAP to test the availability of the function. Calls the RFC_PING RFC module via SOAP to test the availability of the function.
The function simply tests connectivity to remote RFC destinations. The function simply tests connectivity to remote RFC destinations.
}, },
'References' => [[ 'URL', 'http://labs.mwrinfosecurity.com' ]], 'References' => [[ 'URL', 'http://labs.mwrinfosecurity.com/tools/2012/04/27/sap-metasploit-modules/' ]],
'Author' => [ 'Agnivesh Sathasivam','nmonkee' ], 'Author' => [ 'Agnivesh Sathasivam','nmonkee' ],
'License' => BSD_LICENSE 'License' => BSD_LICENSE
) )
@ -41,7 +40,7 @@ class Metasploit4 < Msf::Auxiliary
[ [
OptString.new('CLIENT', [true, 'Client', nil]), OptString.new('CLIENT', [true, 'Client', nil]),
OptString.new('USERNAME', [true, 'Username ', 'SAP*']), OptString.new('USERNAME', [true, 'Username ', 'SAP*']),
OptString.new('PASSWORD', [true, 'Password ', '06071992']), OptString.new('PASSWORD', [true, 'Password ', '06071992'])
], self.class) ], self.class)
register_autofilter_ports([ 8000 ]) register_autofilter_ports([ 8000 ])
end end
@ -68,18 +67,17 @@ class Metasploit4 < Msf::Auxiliary
'SOAPAction' => 'urn:sap-com:document:sap:rfc:functions', 'SOAPAction' => 'urn:sap-com:document:sap:rfc:functions',
'Cookie' => 'sap-usercontext=sap-language=EN&sap-client=' + client, 'Cookie' => 'sap-usercontext=sap-language=EN&sap-client=' + client,
'Authorization' => 'Basic ' + user_pass, 'Authorization' => 'Basic ' + user_pass,
'Content-Type' => 'text/xml; charset=UTF-8', 'Content-Type' => 'text/xml; charset=UTF-8'
} }
}, 45) }, 45)
if (res and res.code != 500 and res.code != 200) if res and res.code != 500 and res.code != 200
# to do - implement error handlers for each status code, 404, 301, etc. if res and res.body =~ /<h1>Logon failed<\/h1>/
if res.body =~ /<h1>Logon failed<\/h1>/
print_error("[SAP] #{ip}:#{rport} - login failed!") print_error("[SAP] #{ip}:#{rport} - login failed!")
else else
print_error("[SAP] #{ip}:#{rport} - something went wrong!") print_error("[SAP] #{ip}:#{rport} - something went wrong!")
end end
return return
elsif res.body =~ /Response/ elsif res and res.body =~ /Response/
print_status("[SAP] #{ip}:#{rport} - RFC service is alive") print_status("[SAP] #{ip}:#{rport} - RFC service is alive")
else else
print_status("[SAP] #{ip}:#{rport} - RFC service is not alive") print_status("[SAP] #{ip}:#{rport} - RFC service is not alive")