Skip to content

Commit

Permalink
modified validator for checking ssrf hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark2307 committed Mar 16, 2024
1 parent c32f29f commit 3cc855a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion apps/testing/src/main/java/com/akto/test_editor/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,12 @@ public static ExecutorSingleOperationResp sendRequestToSsrfServer(String request
}
}

public static Boolean sendRequestToSsrfServer(String requestUrl){
public static Boolean sendRequestToSsrfServer(String url){
String requestUrl = "";
if(!(url.startsWith("http"))){
requestUrl = "http://ssrf.akto.io/validate/" + url;
}

Request request = new Request.Builder()
.url(requestUrl)
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import com.akto.dto.test_editor.DataOperandFilterRequest;
import com.akto.test_editor.Utils;

public class SsrfUrlHitFilter extends DataOperandsImpl {

Expand All @@ -21,8 +22,10 @@ public Boolean isValid(DataOperandFilterRequest dataOperandFilterRequest) {
}

for (String queryString: querySet) {
System.out.println(queryString);
// trigger function here
if(Utils.sendRequestToSsrfServer(queryString)){
result = true;
break;
}
}

return result;
Expand Down

0 comments on commit 3cc855a

Please sign in to comment.