From c84dd284ecf903648cf79e21babc2af9c95892a8 Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Sat, 16 Mar 2024 17:55:18 +0530 Subject: [PATCH] resolved comments for validation of ssrf hit --- apps/testing/src/main/java/com/akto/test_editor/Utils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/testing/src/main/java/com/akto/test_editor/Utils.java b/apps/testing/src/main/java/com/akto/test_editor/Utils.java index 738287c171..96e6ef7421 100644 --- a/apps/testing/src/main/java/com/akto/test_editor/Utils.java +++ b/apps/testing/src/main/java/com/akto/test_editor/Utils.java @@ -662,7 +662,7 @@ public static Boolean sendRequestToSsrfServer(String url){ if(!(url.startsWith("http"))){ requestUrl = "http://ssrf.akto.io/validate/" + url; } - + Request request = new Request.Builder() .url(requestUrl) .get() @@ -676,7 +676,9 @@ public static Boolean sendRequestToSsrfServer(String url){ if (!okResponse.isSuccessful()) { return false; }else{ - return okResponse.code() == 202; + ResponseBody responseBody = okResponse.body(); + BasicDBObject bd = BasicDBObject.parse(responseBody.string()); + return bd.getBoolean("url-hit"); } }catch (Exception e){ return false;