Burp Suite User Forum

Create new post

Writing Bambda Help

Shay | Last updated: May 05, 2024 12:49PM UTC

Hello, I'm attempting to write a bambda. The filter will search for requests that are to /intern/api and then if the headername contains x-name add a note + highlight the request. The issue im facing is that the filter works fine on all requests that have been performed prior to enabling the filter but no new requests get added to the history tab once the filter is in place: Set < String > ignoredQueries = Set.of("useQuery", "InternQuery", "useRefetchInternQuery", "refetchInternQuery"); if (!requestResponse.hasResponse()) { return false; } //filter only intern api if (!requestResponse.request().url().contains("/intern/api/")) { return false; } // remove uninteresting queries if (requestResponse.request().hasHeader("X-Name")) { String headerValue = requestResponse.request().headerValue("X-Name"); for (String qry: ignoredQueries) { // Check if the header value exactly matches any of the ignored queries if (headerValue.equals(qry)) { return false; } } //Highlight Mutations Yellow if (headerValue.contains("Mutation")) { requestResponse.annotations().setHighlightColor(HighlightColor.YELLOW); } // If you would like to highlight a query based on another key word uncomment and set key word and colour else if (headerValue.contains("Case")) { requestResponse.annotations().setHighlightColor(HighlightColor.PINK); } // Highlight everything else NONE else if (headerValue.contains("Query")) { requestResponse.annotations().setHighlightColor(HighlightColor.NONE); } // add GraqhQL Friendly Name to Note Column requestResponse.annotations().setNotes( "GraphQL Name: " + headerValue ); } return true; Any help would be appreciated ????

Michelle, PortSwigger Agent | Last updated: May 07, 2024 01:45PM UTC

Hi If you try a simplified version of your Bambda, for example, to just filter for requests to /intern/api, do you see the same issue?

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.