Skip to content

Commit 8f58c7b

Browse files
author
jvazquez-r7
committed
cleanup for sap_icf_public_info
1 parent 0dcfb51 commit 8f58c7b

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

modules/auxiliary/scanner/sap/sap_icf_rfc_system_info.rb renamed to modules/auxiliary/scanner/sap/sap_icf_public_info.rb

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@ class Metasploit4 < Msf::Auxiliary
2626

2727
def initialize
2828
super(
29-
'Name' => 'SAP /sap/public/info RFC_SYSTEM_INFO Function Sensitive Information Gathering',
29+
'Name' => 'SAP ICF /sap/public/info Service Sensitive Information Gathering',
3030
'Description' => %q{
31-
This module uses the RFC_SYSTEM_INFO function within SAP Internet Communication
31+
This module uses the /sap/public/info service within SAP Internet Communication
3232
Framework (ICF) to obtain the operating system version, SAP version, IP address
33-
and other information through /sap/public/info
34-
33+
and other information.
3534
},
3635
'Author' =>
3736
[
38-
# original sap_soap_rfc_system_info module
39-
'Agnivesh Sathasivam',
40-
'nmonkee',
41-
# repurposed for /sap/public/info (non-RFC)
42-
'ChrisJohnRiley'
37+
'Agnivesh Sathasivam', # original sap_soap_rfc_system_info module
38+
'nmonkee', # original sap_soap_rfc_system_info module
39+
'ChrisJohnRiley' # repurposed for /sap/public/info (non-RFC)
4340
],
4441
'License' => MSF_LICENSE
4542
)
4643
register_options(
4744
[
48-
OptString.new('PATH', [true, 'Path to SAP Application Server', '/'])
45+
Opt::RPORT(8000),
46+
OptString.new('TARGETURI', [true, 'Path to SAP Application Server', '/'])
4947
], self.class)
5048
end
5149

@@ -59,23 +57,23 @@ def extract_field(data, elem)
5957
def report_note_sap(type, data, value)
6058
# create note
6159
report_note(
62-
:host => rhost,
63-
:port => rport,
64-
:proto => 'tcp',
65-
:sname => 'sap',
66-
:type => type,
67-
:data => data + value
68-
) if data
60+
:host => rhost,
61+
:port => rport,
62+
:proto => 'tcp',
63+
:sname => 'sap',
64+
:type => type,
65+
:data => data + value
66+
) if data
6967
# update saptbl for output
7068
@saptbl << [ data, value ]
7169
end
7270

7371
def run_host(ip)
7472

75-
print_status("[SAP] #{ip}:#{rport} - Sending RFC_SYSTEM_INFO request to SAP Application Server")
76-
uri = normalize_uri(datastore['PATH'] + '/sap/public/info')
73+
print_status("[SAP] #{ip}:#{rport} - Sending request to SAP Application Server")
74+
uri = normalize_uri(target_uri.path, '/sap/public/info')
7775
begin
78-
res = send_request_raw({ 'uri' => uri }, 20)
76+
res = send_request_cgi({ 'uri' => uri })
7977
if res and res.code != 200
8078
print_error("[SAP] #{ip}:#{rport} - Server did not respond as expected")
8179
return
@@ -93,14 +91,12 @@ def run_host(ip)
9391
# create table for output
9492
@saptbl = Msf::Ui::Console::Table.new(
9593
Msf::Ui::Console::Table::Style::Default,
96-
'Header' => "[SAP] ICF RFC_SYSTEM_INFO",
97-
'Prefix' => "\n",
98-
'Postfix' => "\n",
99-
'Indent' => 1,
100-
'Columns' =>[
101-
"Key",
102-
"Value"
103-
])
94+
'Header' => "[SAP] ICF SAP PUBLIC INFO",
95+
'Prefix' => "\n",
96+
'Postfix' => "\n",
97+
'Indent' => 1,
98+
'Columns' => [ "Key", "Value" ]
99+
)
104100

105101
response = res.body
106102

0 commit comments

Comments
 (0)