# Bambdas and BChecks > Burp's two lightweight extensibility layers: **Bambdas** are Java lambda snippets compiled inside Burp against the Montoya API (filters, columns, match-and-replace, Repeater actions, scan checks); **BChecks** are custom scan checks in a small declarative language run by Burp Scanner (Pro and DAST). Extensibility in Burp is three things: extensions (BApps), Bambdas, and BChecks. Reach for the lightest one that does the job — see the decision table at the end. Full extensions are covered in [[Burp Suite Extensions]]. ## Bambdas ### Script types | Type | Where | Edition | |---|---|---| | Table filters | Proxy HTTP history, WebSockets history, Logger (incl. **capture filter**), Site map | Community + Pro | | Custom columns | Proxy/Logger/Site map tables (⋮ → **Add custom column**) | Pro | | Match and replace rules | HTTP and WebSocket messages passing the proxy (limited Montoya access) | Pro | | Repeater custom actions | Extract/transform/analyze messages in Repeater; 2025.5 added AI-powered actions and a race-condition template | Pro | | Custom scan checks | Active and passive checks written in Java | Pro | Introduced in 2023.10.3 as HTTP-history filters; the filter receives `requestResponse` (`ProxyHttpRequestResponse`) plus `utilities()`, and must `return true` to keep a row. ### Workflow - **Proxy > HTTP history** → click the filter bar → **Script mode** → paste/write → **Apply** (compiles; fix errors in the *Compilation errors* panel) → **Apply & close**. Applies retroactively to every logged item and to future traffic. Toggle **Filter on/off** to compare without resetting. - Convert an existing GUI filter into a script, or start from a built-in template. - Shortcuts in the editor: **Ctrl/Cmd+S** save, **Ctrl/Cmd+Shift+S** save as, **Ctrl/Cmd+N** new, **Ctrl/Cmd+O** load recent. - **Bambda library:** **Extensions > Bambda library > Import** — select `.bambda` files or a folder (recursive). Re-import to update; Burp asks before overwriting. Scripts are reusable across projects. - **Debug:** `logging.logToOutput(...)` → **Bambda output console** (early versions had no logging or stepping; runtime traces pointed at Burp's loader, not your line). - **Warning:** Bambdas run arbitrary code — vet anything imported. ### Example: hunt non-standard JWT algs across 100k+ requests Dana Epp used this to find new endpoints signed with HS512 (target normally HS256), which led to a vulnerable token-exchange service and a P1: ```java if (!requestResponse.hasResponse()) return false; var req = requestResponse.request(); if (req.hasHeader("Authorization") && req.headerValue("Authorization").startsWith("Bearer")) { String tok = req.headerValue("Authorization").split(" ")[1].trim(); if (tok.contains(".")) { String hdr = utilities().base64Utils().decode(tok.split("\\.")[0]).toString(); return hdr.split("\"alg\":\"")[1].toUpperCase().startsWith("HS512"); } } return false; ``` Workshop exercises in PortSwigger's *Burp, But Yours* follow the same pattern: filters for proxy-history noise, custom columns surfacing `X-Cache` headers or the JWT `alg` claim, match-and-replace rules — tested against Academy labs. ### Sources of Bambdas - `PortSwigger/bambdas` — official repo by type (`CustomAction`, `MatchAndReplace`, `CustomScanChecks`, filters, columns). Java scan checks live here; BCheck-language checks live in `PortSwigger/BChecks`. - `254Labs/awesome-bambdas` — community filters split into `request-filters` / `response-filters`. - **AI Bambda Generator** (BApp, uses Burp AI credits) drafts a Bambda from plain English; **autoBambda** (Tib3rius) is a Claude Code loop that writes the Java body, compiles against a stub Montoya API, runs fake-request harnesses, checks false positives and emits an importable YAML. Read what they produce. See [[Burp AI and MCP]]. ## BChecks ### Language essentials - `.bcheck` files; mandatory `metadata` block with `name`; also `language` (`v1-beta`, newer `v2-beta`), `description`, `author`, `tags` (e.g. a CWE). - One `given … then` scope per check: `response`, `request`, `host`, `any insertion point` (default), `query insertion point`, `header insertion point`, `body insertion point`, `cookie insertion point`. - `send request [called name]:` with `method`, `replacing path`, `headers:` overrides; `run for each: var = "a", "b"` loops; `{base.request.url}`, `{check.response.status_code}` variables; `matches` regex, `in` substring, `to_lower()`. - `report issue:` with `severity`, `confidence`, `detail`, `remediation`. **Backtick strings interpolate** `{vars}`; double-quoted strings are literal. - `{generate_collaborator_address()}` + `if http interactions then` for OAST — see [[Burp Collaborator]]. ### Examples Missing auth on JSON responses (passive-ish, CWE-864): ``` metadata: language: v1-beta name: "Possible missing Authorization header" tags: "CWE-864" given response then if {to_lower(base.response.headers)} matches "application/json" then if not ("authorization:" in {to_lower(base.response.headers)}) then report issue: severity: medium confidence: firm detail: `Possible API call without an Authorization header at {base.request.url}.` end if end if ``` Host-level probe: ``` run for each: potential_path = "/security.txt", "/.well-known/security.txt" given host then send request called check: method: "GET" replacing path: {potential_path} if {check.response.status_code} is "200" then report issue: severity: info confidence: firm detail: `security.txt at {check.request.url.host}{potential_path}` end if ``` ### Running them - Editor: **Extensions > BChecks > New** (template picker; built-in editor with syntax highlighting and test tools in Pro). - To run **only** BChecks: build a custom audit config — Dashboard → New scan → Scan configuration → *Use a custom configuration* → New → Auditing → *Issues reported* → *Select individual issues* → keep only **BCheck generated issue** → *Save to library*. Use it for targeted scans. - BChecks import into **Burp Suite DAST** too, so a check written during a test becomes fleet-wide regression coverage. ### Repo highlights `PortSwigger/BChecks` examples: Blind SSRF (OOB), exposed `.git`, leaked AWS tokens, Log4Shell (OOB), server-side prototype pollution, suspicious input transformation, plus CVE-specific checks. `vulnerability-classes/injection` contains `CRLFInjection`, `CSVinjection`, hidden-input-field XSS, `SSRFInjection` / `ExtendedSSRFInjection`, `SSTI-Razor`, `Spring4Shell`, `template-injection`. ### Rapid response pattern For PHP2Shell (CVE-2026-109618/-109619), PortSwigger shipped within hours: a Java **custom scan check** (Bambda) for active + passive detection, a **DAST-compatible BCheck**, an ActiveScan++ update, and a Burp AT skill. The general lesson: a new CVE is often a one-file BCheck/Bambda away from coverage across every tester and the DAST estate. ## Bambda vs BCheck vs extension | Need | Use | |---|---| | Find/sort rows in huge history, surface a field as a column | Bambda filter / column | | Rewrite traffic in flight with logic | Bambda match-and-replace (or Reshaper/Hackvertor) | | Quick one-request scan check, portable to DAST | BCheck | | Scan check needing real code (parsing, state) | Bambda custom scan check (Java) | | UI tabs, state across requests, protocol decoding, background threads, Collaborator polling | Full extension (Montoya) | Dana Epp's trade-off: Bambdas skip all extension scaffolding but force Java; BChecks are far quicker than a BApp when you just want to add a check to the scanner. ## Related - [[Burp Suite]] (hub) - [[Burp Suite Extensions]] - [[Burp Suite Workflows]] - [[Burp Collaborator]] - [[Burp AI and MCP]] - [[JSON Web Tokens]] · [[JWT Algorithm Confusion]] ## Sources - [[raw/portswigger.net/bambdas-portswigger-documentation-4827|Bambdas - PortSwigger Documentation]] - [[raw/portswigger.net/filtering-the-http-history-with-scripts-bambdas-4824|Filtering the HTTP history with scripts (Bambdas)]] - [[raw/portswigger.net/filtering-the-websockets-history-with-scripts-4823|Filtering the WebSockets history with scripts]] - [[raw/danaepp.com/writing-burp-bambda-filters-like-a-boss-2222|Writing Burp Bambda Filters Like a Boss]] - [[raw/github.com/bambdas-collection-for-burp-suite-professional-and-community-4239|Bambdas Collection for Burp Suite Professional and Community]] - [[raw/github.com/254labs-awesome-bambdas-a-collection-of-burp-suite-lambda-filters-bamb-2218|254Labs/awesome-bambdas: A collection of Burp Suite Lambda Filters ~ Bambda]] - [[raw/portswigger.net/burp-but-yours-bambda-workshop-14382|Burp, But Yours: Bambda workshop]] - [[raw/scip.ch/burp-suite-extensions-overview-and-introduction-with-kotlin-4246|Burp Suite Extensions - Overview and Introduction with Kotlin]] - [[raw/danaepp.com/improve-your-api-security-testing-with-burp-bcheck-scripts-2224|Improve your API Security Testing with Burp BCheck Scripts]] - [[raw/github.com/portswigger-bchecks-bchecks-collection-for-burp-suite-professional-5576|PortSwigger/BChecks: BChecks collection for Burp Suite Professional]] - [[raw/github.com/bchecks-vulnerability-classes-injection-at-main-portswigger-bchecks-gi-5566|BChecks/vulnerability-classes/injection at main · PortSwigger/BChecks · GitHub]] - [[raw/portswigger.net/example-collaborator-based-check-5574|Example Collaborator-based check]] - [[raw/portswigger.net/php2shell-x-burp-suite-detection-within-a-day-of-disclosure-12790|PHP2Shell x Burp Suite: detection within a day of disclosure]] - [[raw/portswigger.net/burp-extensibility-2026-awards-talks-and-highlights-14070|Burp Extensibility 2026: awards, talks and highlights]] - [[raw/portswigger.net/burp-suite-professional-2025-5-release-3409|Burp Suite Professional 2025.5 Release]]