diff --git a/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java b/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java index 47cb80dafa..794369a012 100644 --- a/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java +++ b/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java @@ -170,7 +170,7 @@ public static void addSampleData() { } try { - String mockServiceUrl = "http://sampl-aktol-1exannwybqov-67928726.ap-south-1.elb.amazonaws.com"; + String mockServiceUrl = "https://vulnerable-server.akto.io"; String data = convertStreamToString(InitializerListener.class.getResourceAsStream("/SampleApiData.json")); JSONArray dataobject = new JSONArray(data); for (Object obj: dataobject) { diff --git a/apps/testing/src/main/java/com/akto/test_editor/execution/Executor.java b/apps/testing/src/main/java/com/akto/test_editor/execution/Executor.java index 1d79c9394d..b77011816c 100644 --- a/apps/testing/src/main/java/com/akto/test_editor/execution/Executor.java +++ b/apps/testing/src/main/java/com/akto/test_editor/execution/Executor.java @@ -31,7 +31,6 @@ import com.akto.log.LoggerMaker.LogDb; import com.akto.rules.TestPlugin; import com.akto.test_editor.Utils; -import com.akto.testing.TestExecutor; import com.akto.util.Constants; import com.akto.util.modifier.JWTPayloadReplacer; import com.fasterxml.jackson.databind.ObjectMapper; @@ -165,6 +164,16 @@ public YamlTestResult execute(ExecutorNode node, RawApi rawApi, Map varMap, Boolean all int tsAfterReq = 0; try { tsBeforeReq = Context.nowInMillis(); + String url = testReq.getRequest().getUrl(); + if (url.contains("sampl-aktol-1exannwybqov-67928726")) { + try { + URI uri = new URI(url); + String newUrl = "https://vulnerable-server.akto.io" + uri.getPath(); + testReq.getRequest().setUrl(newUrl); + } catch (Exception e) { + // TODO: handle exception + } + } testResponse = ApiExecutor.sendRequest(testReq.getRequest(), followRedirect, testingRunConfig, debug, testLogs, com.akto.test_editor.Utils.SKIP_SSRF_CHECK); if (apiInfoKey != null && memory != null) { memory.fillResponse(testReq.getRequest(), testResponse, apiInfoKey.getApiCollectionId(), apiInfoKey.getUrl(), apiInfoKey.getMethod().name());