Skip to content

Commit

Permalink
Merge pull request #82 from ctflearner/DetectSafehttp.bambda
Browse files Browse the repository at this point in the history
Create DetectSafeHttpMethods.bambda
  • Loading branch information
Hannah-PortSwigger authored Dec 19, 2024
2 parents e2928d8 + 71addc3 commit 5a13580
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Filter/Proxy/HTTP/DetectSafeHttpMethods.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Bambda Script to Detect "Safe or Typical HTTP Methods in Requests"
* @author ctflearner
* This script identifies HTTP requests that use typical or safe methods such as GET and POST,
* excluding less common or potentially unsafe methods like PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE, and CONNECT.
* It ensures that the HTTP method is not one of the excluded methods listed.
**/



return !requestResponse.request().method().equals("PUT") &&
!requestResponse.request().method().equals("PATCH") &&
!requestResponse.request().method().equals("DELETE") &&
!requestResponse.request().method().equals("HEAD") &&
!requestResponse.request().method().equals("OPTIONS") &&
!requestResponse.request().method().equals("TRACE") &&
!requestResponse.request().method().equals("CONNECT");

0 comments on commit 5a13580

Please sign in to comment.