Skip to content

Commit 472674c

Browse files
authored
Update SSRF.java
1 parent 95f1e46 commit 472674c

File tree

1 file changed

+0
-33
lines changed
  • src/main/java/org/joychou/controller

1 file changed

+0
-33
lines changed

src/main/java/org/joychou/controller/SSRF.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,6 @@ public class SSRF {
2626
private static Logger logger = LoggerFactory.getLogger(SSRF.class);
2727

2828

29-
/**
30-
* http://localhost:8080/ssrf/urlConnection/vuln?url=file:///etc/passwd
31-
*
32-
* The default setting of followRedirects is true.
33-
* Protocol: file ftp mailto http https jar netdoc
34-
* UserAgent is Java/1.8.0_102.
35-
*/
36-
@RequestMapping(value = "/urlConnection/vuln", method = {RequestMethod.POST, RequestMethod.GET})
37-
public String URLConnectionVuln(String url) {
38-
return HttpUtils.URLConnection(url);
39-
}
40-
41-
42-
@GetMapping("/urlConnection/sec")
43-
public String URLConnectionSec(String url) {
44-
45-
// Decline not http/https protocol
46-
if (!SecurityUtil.isHttp(url)) {
47-
return "[-] SSRF check failed";
48-
}
49-
50-
try {
51-
SecurityUtil.startSSRFHook();
52-
return HttpUtils.URLConnection(url);
53-
} catch (SSRFException | IOException e) {
54-
return e.getMessage();
55-
} finally {
56-
SecurityUtil.stopSSRFHook();
57-
}
58-
59-
}
60-
61-
6229
/**
6330
* The default setting of followRedirects is true.
6431
* UserAgent is Java/1.8.0_102.

0 commit comments

Comments
 (0)