Skip to content

Commit

Permalink
implemented fixes requested by sinn3r
Browse files Browse the repository at this point in the history
Implemented the fixes, and re-tested the modules
  • Loading branch information
Bruno Morisson committed Jul 24, 2012
1 parent 397d708 commit dbc779e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
20 changes: 8 additions & 12 deletions modules/auxiliary/scanner/sap/sap_mgmt_con_getlogfiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize
],
'Author' =>
[ 'Chris John Riley', # original msf module
'Bruno Morisson <bm@integrity.pt>' # bulk file retrieval
'Bruno Morisson <bm[at]integrity.pt>' # bulk file retrieval
],
'License' => MSF_LICENSE
)
Expand All @@ -59,11 +59,7 @@ def rport
def run_host(ip)
res = send_request_cgi({
'uri' => "/#{datastore['URI']}",
'method' => 'GET',
'headers' =>
{
'User-Agent' => datastore['UserAgent']
}
'method' => 'GET'
}, 25)

if not res
Expand Down Expand Up @@ -91,6 +87,9 @@ def listfiles(rhost)
ns1 = 'ns1:ListLogFiles'
when /^TRACE/i
ns1 = 'ns1:ListDeveloperTraces'
else
print_error("#{rhost}:#{rport} [SAP] unsupported filetype #{datastore['FILETYPE']}")
return
end

data = '<?xml version="1.0" encoding="utf-8"?>' + "\r\n"
Expand Down Expand Up @@ -121,8 +120,6 @@ def listfiles(rhost)
env = []
if res and res.code == 200
case res.body
when nil
# Nothing
when /<file>(.*)<\/file>/i
body = []
body = res.body
Expand Down Expand Up @@ -179,6 +176,9 @@ def gettfiles(rhost,logfile,filelen)
ns1 = 'ns1:ReadLogFile'
when /^TRACE/i
ns1 = 'ns1:ReadDeveloperTrace'
else
print_error("#{rhost}:#{rport} [SAP] unsupported filetype: #{datastore['FILETYPE']}")
return
end

data = '<?xml version="1.0" encoding="utf-8"?>' + "\r\n"
Expand Down Expand Up @@ -210,8 +210,6 @@ def gettfiles(rhost,logfile,filelen)

if res and res.code == 200
case res.body
when nil
# Nothing
when /<item>([^<]+)<\/item>/i
body = []
body = res.body
Expand All @@ -220,8 +218,6 @@ def gettfiles(rhost,logfile,filelen)
end

case res.body
when nil
# Nothing
when /<name>([^<]+)<\/name>/i
name = $1.strip
success = true
Expand Down
11 changes: 2 additions & 9 deletions modules/auxiliary/scanner/sap/sap_mgmt_con_getprocesslist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Metasploit4 < Msf::Auxiliary
def initialize
super(
'Name' => 'SAP Management Console GetProcessList',
'Version' => '$Revision 1$',
'Description' => %q{
This module attempts to list SAP processes through the SAP Management Console SOAP Interface
},
Expand All @@ -21,7 +20,7 @@ def initialize
'Author' =>
[
'Chris John Riley', # most of the code this module is based on
'Bruno Morisson <bm@integrity.pt>' # request ProcessList and parsing output
'Bruno Morisson <bm[at]integrity.pt>' # request ProcessList and parsing output

],
'License' => MSF_LICENSE
Expand All @@ -43,11 +42,7 @@ def rport
def run_host(ip)
res = send_request_cgi({
'uri' => "/#{datastore['URI']}",
'method' => 'GET',
'headers' =>
{
'User-Agent' => datastore['UserAgent']
}
'method' => 'GET'
}, 25)

if not res
Expand Down Expand Up @@ -98,8 +93,6 @@ def getprocesslist(rhost)
if res and res.code == 200

case res.body
when nil
# Nothing
when /<process>(.*?)<\/process>/i
body = []
body = res.body
Expand Down

0 comments on commit dbc779e

Please sign in to comment.