-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #923 from akto-api-security/feature/ssrf_support
Feature/ssrf support
- Loading branch information
Showing
11 changed files
with
183 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...esting/src/main/java/com/akto/test_editor/filter/data_operands_impl/SsrfUrlHitFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.akto.test_editor.filter.data_operands_impl; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.akto.dto.test_editor.DataOperandFilterRequest; | ||
import com.akto.test_editor.Utils; | ||
|
||
public class SsrfUrlHitFilter extends DataOperandsImpl { | ||
|
||
@Override | ||
public Boolean isValid(DataOperandFilterRequest dataOperandFilterRequest) { | ||
|
||
Boolean result = false; | ||
List<String> querySet = new ArrayList<>(); | ||
String data; | ||
try { | ||
querySet = (List<String>) dataOperandFilterRequest.getQueryset(); | ||
data = (String) dataOperandFilterRequest.getData(); | ||
} catch(Exception e) { | ||
return result; | ||
} | ||
|
||
for (String queryString: querySet) { | ||
if(Utils.sendRequestToSsrfServer(queryString)){ | ||
result = true; | ||
break; | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters