Author: dedsecLab
A powerful Burp Suite extension that injects custom HTTP headers into requests via session handling rules. Supports multiple header profiles, per-scope targeting, conditional injection, automatic header replacement, settings persistence, and more. Ideal for JWT Bearer tokens, API keys, CSRF tokens, and any custom auth scheme.
This extension is built upon the original Add Custom Header Burp extension by Lorenzo Grespan.
All thanks and credit goes to the original author for creating the foundation that made this project possible. HeaderForge extends the original with multi-profile support, settings persistence, conditional injection, and more.
| Feature | Description |
|---|---|
| Multiple Header Profiles | Define unlimited header configurations — each with its own name, header, value source, and conditions. All enabled profiles are evaluated on every request. |
| Settings Persistence | All settings are automatically saved to your Burp project file. They survive restarts and extension reloads — no more re-entering tokens every time. |
| Per-Scope Rules | Each profile has a URL regex scope. Only matching requests get the header injected. Leave blank to match all URLs. |
| Conditional Injection | Filter by HTTP method (e.g. GET,POST), or only inject when the header doesn't already exist. |
| Header Replacement | If the request already contains a header with the same name (e.g. Authorization: Basic xyz), it is automatically replaced with your configured value — no duplicate headers. |
| Import / Export | Export all profiles to a JSON file and import them on another machine or project. Great for team sharing. |
| Request Log | A dedicated "Log" tab shows every header injection in real time — timestamp, URL, method, profile, header value, and source. |
| Context Menu | Right-click any selected text in a request or response viewer → "Use as Custom Header Value" → pick a profile. The value is set instantly. |
- Open the Extender tab in Burp Suite
- Select Extensions → Add
- Pick the
burpHeaderForge.jarfile from this repository
If you don't trust the pre-built JAR, see Compilation from source below.
- Go to the HeaderForge tab that appears after installation
- The Profiles tab shows a table of header profiles (a "Default" profile is created on first run)
- Click Add to create a new profile, or edit the default one
Fill in the profile editor form:
| Field | Description | Example |
|---|---|---|
| Profile Name | A friendly name for this configuration | JWT Auth |
| Header Name | The HTTP header to inject | Authorization |
| Value Prefix | Static prefix prepended to the value (don't forget the trailing space if needed) | Bearer |
| Value Source | Choose one of three modes (see below) | — |
- Disabled — this profile is skipped during injection
- Hard-Coded Value — use a static token you paste into the text area
- Regular Expression — extract a token from a macro response using a regex capture group
- Go to Project Options → Sessions
- Add a Session Handling Rule
- Name it (e.g. "Inject custom headers") and click Add → Invoke a Burp Extension
- Select HeaderForge from the list
- Set the Scope to the URLs you want the rule to apply to (or "Include all URLs" for testing)
You're now ready to go. Every matching request will have your configured headers injected.
You can define as many profiles as you need. Each one injects a different header independently.
Example setup:
| Profile | Header | Mode |
|---|---|---|
| JWT Auth | Authorization: Bearer <token> |
Hard-Coded |
| API Key | X-API-Key: <key> |
Hard-Coded |
| CSRF Token | X-CSRF-Token: <extracted> |
RegExp |
Use the buttons below the table:
- Add — create a new blank profile
- Remove — delete the selected profile
- Duplicate — copy the selected profile (useful for similar configurations)
Each profile has a Scope (URL regex) field under the "Conditions" section.
- Leave it blank to match all URLs
- Enter a Java regex to restrict injection to matching URLs only
Examples:
| Pattern | Matches |
|---|---|
https://api\.example\.com/.* |
Only requests to api.example.com |
https?://.*\.internal\.net/.* |
Any request to *.internal.net |
/api/v2/.* |
Any URL containing /api/v2/ |
Two additional conditions are available per profile:
- HTTP Methods — comma-separated list of methods to match. Leave blank for all.
- Example:
GET,POST,PUT— only inject on these methods
- Example:
- Only inject if header doesn't already exist — checkbox. When enabled, the header is only added if the request doesn't already contain a header with that name.
If the request already contains a header with the same name as one of your profiles, HeaderForge automatically replaces it rather than adding a duplicate. The matching is case-insensitive by header name.
Example: If a request has Authorization: Basic dXNlcjpwYXNz and your profile injects Authorization: Bearer eyJhbG..., the old Basic header is removed and replaced with the Bearer header.
This is especially useful when:
- A browser or client sends default auth headers that you want to override
- You're switching between auth schemes (Basic → Bearer, etc.)
- Multiple tools in the session handling pipeline set the same header
This is useful when the token is dynamic (e.g. fetched from a login endpoint):
- In Burp, record a macro that sends a request to the endpoint returning the token (e.g.
POST /login) - In the session handling rule, add an action to Run a macro and select your macro
- Enable "After running the macro, invoke a Burp extension action handler" and select HeaderForge
- In the profile, set mode to Regular Expression and enter a regex with a capture group
Example regex for a JSON response like {"access_token":"eyJhbG...","token_type":"Bearer"}:
access_token":"(.*?)"
The first capture group (.*?) is used as the header value.
Share configurations across team members or Burp projects:
- Export JSON — saves all profiles to a
.jsonfile - Import JSON — loads profiles from a
.jsonfile (replaces current profiles)
Example JSON format:
{
"version": 1,
"profiles": [
{
"name": "JWT Auth",
"enabled": true,
"headerName": "Authorization",
"headerValuePrefix": "Bearer ",
"mode": "hardcoded",
"regexpPattern": "",
"hardcodedValue": "eyJhbGciOiJIUzI1NiIs...",
"scopePattern": "",
"httpMethods": "",
"onlyIfNotExists": false
}
]
}Switch to the Log tab to see a live feed of every header injection:
| Column | Description |
|---|---|
| Time | Timestamp of the injection |
| Method | HTTP method (GET, POST, etc.) |
| URL | Full request URL |
| Profile | Which profile was triggered |
| Header | Header name injected |
| Value | Full header value (prefix + token) |
| Source | hardcoded or regexp |
Use the Clear Log button to reset. The log auto-trims to the last 500 entries.
- Select any text in a request or response viewer in Burp (e.g. a token value)
- Right-click → Use as Custom Header Value
- Pick the target profile from the submenu
- The selected text is set as the profile's hard-coded value, and the profile switches to hard-coded mode
This is the fastest way to grab a token from a response and start using it immediately.
A Flask mock server is included for testing:
FLASK_DEBUG=1 FLASK_APP=server.py flask runThis starts a server on 127.0.0.1:5000:
POST /login— returns a JSON response with anaccess_tokenGET /stuff— echoes back the Authorization header it received
- Java JDK 8 or later
- The Burp Extender API JAR (either from Maven or exported from Burp)
gradle jarThe JAR will be in build/libs/.
-
Clone this repo
-
Download the Burp Extender API (or export from Burp → Extender → APIs → Save interface files):
mkdir lib curl -o lib/burp-extender-api-1.7.22.jar \ https://repo1.maven.org/maven2/net/portswigger/burp/extender/burp-extender-api/1.7.22/burp-extender-api-1.7.22.jar
-
Compile all source files:
mkdir build javac -source 8 -target 8 \ -cp lib/burp-extender-api-1.7.22.jar \ -d build \ burp/HeaderProfile.java \ burp/LogEntry.java \ burp/ProfileManager.java \ burp/ProfileTableModel.java \ burp/LogTableModel.java \ burp/MainPanel.java \ burp/BurpExtender.java \ burp/BurpTab.java
-
Create the JAR:
jar cvf burpHeaderForge.jar -C build .(Note: On Windows, if
jaris not in your PATH, you may need to use the full path to your JDK's jar executable. For example:)& "C:\Program Files\Java\jdk-25\bin\jar.exe" cvf burpHeaderForge.jar -C build .
-
Load
burpHeaderForge.jarinto Burp
| File | Description |
|---|---|
burp/BurpExtender.java |
Main extension entry-point — session handling, context menu, lifecycle |
burp/HeaderProfile.java |
Data model for a header injection profile |
burp/ProfileManager.java |
Profile CRUD, Burp project persistence, JSON import/export |
burp/ProfileTableModel.java |
Swing table model for the profile list |
burp/LogEntry.java |
Data model for a log entry |
burp/LogTableModel.java |
Swing table model for the injection log |
burp/MainPanel.java |
Main UI — tabbed panel with Profiles and Log tabs |
burp/BurpTab.java |
Legacy UI panel (kept for reference) |
server.py |
Flask mock server for testing |
- Reload the extension quickly: Hold the
CTRLkey when selecting the checkbox in the Extensions tab - Profile order matters: Profiles are evaluated top-to-bottom. If two profiles target the same header, the last one wins
- Existing headers are replaced: If the request already has a header with the same name, it's replaced — not duplicated
- Scope + Methods + Exists: All three conditions must pass for a header to be injected. Use them together for precise control
- Share configs with your team: Export profiles as JSON, commit to your repo, and teammates can import them
See LICENSE for details.