A powerful Burp Suite extension that automatically captures and injects fresh bearer tokens into your security testing workflow, eliminating authentication failures during automated scans.
The Token Auto-Refresher extension solves a common problem in web application security testing: expired authentication tokens during automated scans. Instead of manually updating tokens or dealing with 401/403 responses, this extension automatically:
- Captures fresh bearer tokens from your proxy traffic
- Stores tokens per host for organized management
- Injects current tokens into Scanner, Intruder, Repeater, and other tool requests
- Refreshes tokens using time-based requests when needed
- Persists all settings per Burp project
- Proxy History: Automatically extracts tokens from manual browsing
- Time-Based Refresh: Configurable automated token renewal requests
- Flexible Header Configuration: Unified template system for extraction and injection
- Custom Patterns: Flexible regex-based token extraction
- Multiple Headers: Supports Authorization, X-Auth-Token, X-Access-Token, X-Api-Key and any custom headers
- Scanner: Keep automated scans authenticated
- Intruder: Maintain authentication during attacks
- Repeater: Always use fresh tokens in manual testing
- Sequencer: Authenticated entropy analysis
- Extensions: Token injection for other Burp extensions
- Host-Based Token Table: Visual display of all captured tokens organized by host with copy-to-clipboard functionality
- Automatic Updates: Real-time token refresh and lifecycle management
- Project Persistence: Token settings saved per Burp project automatically
- Go to Releases and download the latest
token-auto-refresher.jar - Open Burp Suite Professional or Community
- Go to Extensions → Installed → Add
- Select Extension type: Java
- Choose the downloaded
.jarfile
- Clone this repository
- Run
./gradlew buildto compile the extension - The JAR file will be created at
build/libs/bearer-token-auto-refresher.jar - Load the JAR file into Burp using the steps above
-
Enable the Extension
- Check "Enable automatic token refresh" in the main panel
- The extension starts monitoring proxy traffic immediately
-
Configure Tool Integration
- Select which tools should receive token injection:
- ✅ Scanner (recommended - enabled by default)
- ⬜ Intruder
- ⬜ Repeater
- ⬜ Sequencer
- ⬜ Other Extensions
- Select which tools should receive token injection:
-
Browse the Target Application
- Use Burp's browser to authenticate normally
- The extension automatically captures bearer tokens from responses
- Watch the "Current Tokens" table populate with captured tokens
For applications requiring periodic token renewal:
-
Enable Time-Based Requests
- Check "Time-based Requests" in Token Refresh Sources
- Note: When both Proxy and Time-based are enabled, Time-based tokens take priority for the configured host
-
Configure the Refresh Request
- Host: Target authentication endpoint (e.g.,
api.example.com) - Interval: Refresh frequency in seconds (e.g.,
300for 5 minutes) - Method: HTTP method (GET/POST/PUT)
- Request Configuration: Full HTTP request template:
POST /api/auth/refresh HTTP/1.1 Host: api.example.com Content-Type: application/json Authorization: Bearer {current_token} {"refresh_token": "your_refresh_token"}
- Host: Target authentication endpoint (e.g.,
-
Configure Token Extraction
- Extract from: Choose "Header" or "Response Body"
- Header extraction: Specify header name (e.g., "Authorization")
- Body extraction: Define start/end patterns:
- Start pattern:
"refresh_token": " - End pattern:
"
- Start pattern:
-
Start Automatic Refresh
- Click "Start" to begin automated token renewal
- Monitor the status indicator (🟢 RUNNING / 🔴 STOPPED)
The extension provides unified configuration that controls both token extraction and injection:
Token Extraction Pattern (Regex)
- Default:
Bearer\s+([A-Za-z0-9\-\._~\+\/]+=*) - Captures the token value from header contents
- Customizable for non-standard token formats
Header Template (Extract & Inject)
- Format:
HeaderName: Prefix [TOKEN] Suffix - Controls which header to check and how tokens are formatted
- Common presets:
Authorization: Bearer [TOKEN]- Standard RFC 6750 bearer tokensAuthorization: [TOKEN]- Raw tokens without prefixX-Api-Key: [TOKEN]- Custom API key headersAccess-Token: [TOKEN]- Alternative authentication headers
Note: You can define your own custom header template for any authentication scheme your application uses.
This unified approach ensures tokens are extracted from and injected into the same header, providing consistency across your testing workflow.
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}Configuration:
- Extract from: Response Body
- Start pattern:
"access_token":" - End pattern:
"
HTTP/1.1 200 OK
X-Auth-Token: abc123def456ghi789
Content-Type: application/jsonConfiguration:
- Extract from: Header
- Header name:
X-Auth-Token
GET /api/data HTTP/1.1
Host: api.example.com
X-Api-Key: Bearer sk_live_abc123def456Configuration:
- Header Template:
X-Api-Key: Bearer [TOKEN] - Token Extraction Pattern:
Bearer\s+([A-Za-z0-9\-\._~\+\/]+=*)
The extension automatically saves all settings per Burp project:
- ✅ Project-Specific: Each project maintains its own configuration
- ✅ Temporary Projects: Use default settings (no persistence)
Saved Settings Include:
- Extension enabled/disabled state
- Tool injection preferences
- Token source selections
- Time-based configuration (host, interval, request template)
- Token extraction settings (patterns, headers)
- Custom token regex patterns
- Injection Logs: Shows when tokens are injected
- Capture Logs: Indicates when new tokens are discovered
- Error Logs: Displays configuration or network issues
- Show Response Button: Displays the latest time-based refresh response in logs for debugging
- Export Logs: Save complete activity log for analysis
| Contributor | Module |
|---|---|
| Vasilis Flengas | Idea, Development |
Join the Hackcraft community discord server here. On the server you can receive support and discuss issues related to Token Auto Refresher.