Restrict SSRF Regexes
This commit is contained in:
parent
0795ff0fc5
commit
cbf2e153d9
@ -44,12 +44,12 @@ public class SSRFTask1 extends AssignmentEndpoint {
|
||||
try {
|
||||
StringBuilder html = new StringBuilder();
|
||||
|
||||
if (url.matches("images/tom.png")) {
|
||||
if (url.matches("images/tom\\.png")) {
|
||||
html.append(
|
||||
"<img class=\"image\" alt=\"Tom\" src=\"images/tom.png\" width=\"25%\""
|
||||
+ " height=\"25%\">");
|
||||
return failed(this).feedback("ssrf.tom").output(html.toString()).build();
|
||||
} else if (url.matches("images/jerry.png")) {
|
||||
} else if (url.matches("images/jerry\\.png")) {
|
||||
html.append(
|
||||
"<img class=\"image\" alt=\"Jerry\" src=\"images/jerry.png\" width=\"25%\""
|
||||
+ " height=\"25%\">");
|
||||
|
@ -46,7 +46,7 @@ public class SSRFTask2 extends AssignmentEndpoint {
|
||||
}
|
||||
|
||||
protected AttackResult furBall(String url) {
|
||||
if (url.matches("http://ifconfig.pro")) {
|
||||
if (url.matches("http://ifconfig\\.pro")) {
|
||||
String html;
|
||||
try (InputStream in = new URL(url).openStream()) {
|
||||
html =
|
||||
|
Loading…
x
Reference in New Issue
Block a user