File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Bambda Script to Detect "101 Switching Protocols" in HTTP Response
3
+ @author Tur24Tur / BugBountyzip (https://github.com/BugBountyzip)
4
+ It identifies if the HTTP response status line contains "101 Switching Protocols".
5
+ * Upon detection, responses are highlighted in red and notes are appended, if enabled.
6
+ **/
7
+
8
+ boolean enableManualAnnotations = true;
9
+
10
+ // Ensure there is a response
11
+ if (!requestResponse.hasResponse()) {
12
+ return false;
13
+ }
14
+
15
+ boolean foundSwitchingProtocols = false;
16
+
17
+ // Get the entire response as a string
18
+ String response = requestResponse.response().toString();
19
+
20
+ // Get the first line of the response
21
+ String firstLine = response.split("\n")[0];
22
+
23
+ // Check if the first line contains "101 Switching Protocols"
24
+ if (firstLine.contains("101 Switching Protocols")) {
25
+ foundSwitchingProtocols = true;
26
+ if (enableManualAnnotations) {
27
+ requestResponse.annotations().setHighlightColor(HighlightColor.RED);
28
+ requestResponse.annotations().setNotes("Detected '101 Switching Protocols' in response");
29
+ }
30
+ }
31
+
32
+ return foundSwitchingProtocols;
You can’t perform that action at this time.
0 commit comments