Skip to content

Instantly share code, notes, and snippets.

@lanmaster53
Last active October 16, 2024 14:42
Show Gist options
  • Save lanmaster53/e0fe8d1ac22eba9822de0f008e3ac2af to your computer and use it in GitHub Desktop.
Save lanmaster53/e0fe8d1ac22eba9822de0f008e3ac2af to your computer and use it in GitHub Desktop.
Collection of Burp Suite Pro Bambdas.

Display the Server header from the response:

HttpResponse resp = requestResponse.response();
if (resp != null) {
    String val = resp.headerValue("Server");
    if (val != null) {
        return val;
    }
}
return "";

Display the GraphQL operation from the request (v1):

HttpRequest req = requestResponse.request();
if (req != null) {
    String val = req.parameterValue("operationName", HttpParameterType.JSON);
    if (val != null) {
        return val.split("\\{|\\(")[0];
    }
}
return "";

Display the GraphQL operation from the request (v2):

HttpRequest req = requestResponse.request();
if (req != null) {
    String val = req.parameterValue("query", HttpParameterType.JSON);
    if (val != null) {
        return val.split("\\{")[1];
    }
}
return "";

Display the .NET Event Target:

HttpRequest req = requestResponse.request();
if (req != null) {
    String val = req.parameterValue("__EVENTTARGET", HttpParameterType.BODY);
    if (val != null) {
        return utilities.urlUtils().decode(val);
    }
}
return "";

Display the .NET Event Argument:

HttpRequest req = requestResponse.request();
if (req != null) {
    String val = req.parameterValue("__EVENTARGUMENT", HttpParameterType.BODY);
    if (val != null) {
        return utilities.urlUtils().decode(val);
    }
}
return "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment