|
28 | 28 | import org.apache.hc.client5.http.classic.methods.HttpTrace;
|
29 | 29 | import org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;
|
30 | 30 |
|
31 |
| -// import org.apache.hc.client5.http.fluent.Request; |
| 31 | +import org.apache.hc.client5.http.fluent.Request; |
32 | 32 | // import org.apache.hc.client5.http.protocol.RedirectLocations;
|
33 | 33 | // import org.apache.hc.client5.http.utils.URIUtils;
|
34 | 34 |
|
@@ -187,8 +187,8 @@ protected void doGet2(HttpServletRequest request, HttpServletResponse response)
|
187 | 187 | ClassicHttpRequests.create("method", uri.toString()); // $ SSRF
|
188 | 188 | ClassicHttpRequests.create("method", uri); // $ SSRF
|
189 | 189 |
|
190 |
| - BasicHttpRequests.delete(uri.toString()); // $ SSRF |
191 |
| - BasicHttpRequests.delete(uri); // $ SSRF |
| 190 | + ClassicHttpRequests.delete(uri.toString()); // $ SSRF |
| 191 | + ClassicHttpRequests.delete(uri); // $ SSRF |
192 | 192 |
|
193 | 193 | ClassicHttpRequests.get(uri.toString()); // $ SSRF
|
194 | 194 | ClassicHttpRequests.get(uri); // $ SSRF
|
@@ -243,4 +243,46 @@ protected void doGet2(HttpServletRequest request, HttpServletResponse response)
|
243 | 243 | // TODO: handle exception
|
244 | 244 | }
|
245 | 245 | }
|
| 246 | + |
| 247 | + // org.apache.hc.client5.http.fluent |
| 248 | + protected void doGet3(HttpServletRequest request, HttpServletResponse response) |
| 249 | + throws ServletException, IOException { |
| 250 | + try { |
| 251 | + |
| 252 | + String uriSink = request.getParameter("uri"); |
| 253 | + URI uri = new URI(uriSink); |
| 254 | + |
| 255 | + // org.apache.hc.client5.http.fluent.Request |
| 256 | + Request.create(Method.CONNECT, uri); // $ SSRF |
| 257 | + Request.create("method", uri.toString()); // $ SSRF |
| 258 | + Request.create("method", uri); // $ SSRF |
| 259 | + |
| 260 | + Request.delete(uri.toString()); // $ SSRF |
| 261 | + Request.delete(uri); // $ SSRF |
| 262 | + |
| 263 | + Request.get(uri.toString()); // $ SSRF |
| 264 | + Request.get(uri); // $ SSRF |
| 265 | + |
| 266 | + Request.head(uri.toString()); // $ SSRF |
| 267 | + Request.head(uri); // $ SSRF |
| 268 | + |
| 269 | + Request.options(uri.toString()); // $ SSRF |
| 270 | + Request.options(uri); // $ SSRF |
| 271 | + |
| 272 | + Request.patch(uri.toString()); // $ SSRF |
| 273 | + Request.patch(uri); // $ SSRF |
| 274 | + |
| 275 | + Request.post(uri.toString()); // $ SSRF |
| 276 | + Request.post(uri); // $ SSRF |
| 277 | + |
| 278 | + Request.put(uri.toString()); // $ SSRF |
| 279 | + Request.put(uri); // $ SSRF |
| 280 | + |
| 281 | + Request.trace(uri.toString()); // $ SSRF |
| 282 | + Request.trace(uri); // $ SSRF |
| 283 | + |
| 284 | + } catch (Exception e) { |
| 285 | + // TODO: handle exception |
| 286 | + } |
| 287 | + } |
246 | 288 | }
|
0 commit comments