Variable System Overview
IronBullet uses a scoped variable system to store and pass data between blocks. Variables can hold strings, numbers, lists, booleans, and are accessed using special syntax for interpolation.Variables are the glue that connects blocks together - they store HTTP responses, parsed data, and intermediate values as your pipeline executes.
Variable Scopes
Fromsrc/pipeline/variable.rs:59-67:
Scope Types
input.*
Data from the current wordlist line. Populated by parsing according to
data_settings.Examples:input.USERinput.PASSinput.EMAIL
data.*
Response data and metadata from HTTP blocks.Auto-populated:
data.SOURCE- Response bodydata.RESPONSECODE- HTTP status codedata.HEADERS- Response headersdata.COOKIES- Response cookiesdata.ADDRESS- Final URL after redirects
globals.*
Variables set in startup blocks, accessible to all data entries.Example:
globals.API_KEYglobals.SESSION_ID
User Variables
Custom variables created by Parse blocks or SetVariable.Examples:
TOKENCSRFUSER_ID
Variable Values
Fromsrc/pipeline/variable.rs:13-41:
- String - Text values (most common)
- List - Arrays of strings
- Int - Integer numbers
- Float - Decimal numbers
- Bool - true/false values
Interpolation Syntax
IronBullet supports two interpolation syntaxes:Angle Bracket Syntax: <variable>
The primary syntax for embedding variables in strings. From src/pipeline/variable.rs:103-142:
Curly Brace Syntax: {{variable}}
Random Data Functions
IronBullet includes built-in random data generators accessible via therandom.* prefix. From src/pipeline/variable.rs:182-217:
Available Random Functions
Basic Generators
Basic Generators
| Function | Output Example | Description |
|---|---|---|
<random.email> | user@example.com | Random email address |
<random.uuid> | 550e8400-e29b-41d4-a716-446655440000 | Random UUID v4 |
<random.phone> | +1-555-0123 | Random phone number |
<random.string> | aB3xK9mP2qR7 | 16-char alphanumeric |
<random.number> | 42 | Number between 0-100 |
Names
Names
| Function | Output Example |
|---|---|
<random.name.first> | John |
<random.name.last> | Smith |
<random.name.full> | John Smith |
Addresses
Addresses
| Function | Output Example |
|---|---|
<random.address.street> | 123 Main Street |
<random.address.city> | Springfield |
<random.address.state> | California |
<random.address.zip> | 90210 |
Parameterized
Parameterized
| Function | Description |
|---|---|
<random.string.32> | 32-character random string |
<random.string.64> | 64-character random string |
<random.number.1.1000> | Random number 1-1000 |
<random.number.100.999> | Random number 100-999 |
Capturing Variables
When you parse data and want to include it in the output, mark it as a capture. From configs:src/pipeline/variable.rs:155-161:
Auto-Populated Variables
After every HTTP request block, these variables are automatically set:| Variable | Description | Example |
|---|---|---|
data.SOURCE | Response body | {"status":"ok"} |
data.RESPONSECODE | HTTP status code | 200 |
data.HEADERS | Response headers (JSON) | {"content-type":"application/json"} |
data.COOKIES | Response cookies | session=abc123 |
data.ADDRESS | Final URL after redirects | https://example.com/dashboard |
Variable Resolution
Fromsrc/pipeline/variable.rs:74-85, variables are resolved with this priority:
- Check for scope prefix (
input.,data.,globals.) - Resolve from that scope
- If no prefix, check user variables
- If not found, leave as-is (unresolved variables remain
<VARNAME>)
Common Patterns
Using Input Data in Requests
Using Input Data in Requests
john@example.com:secretpass, this becomes:Chaining Parsed Values
Chaining Parsed Values
Using Random Data
Using Random Data
Checking Response Code
Checking Response Code
Variable Snapshots
You can see all variables at any point using the snapshot feature (fromsrc/pipeline/variable.rs:163-179):
BlockResult.variables_after to show variable state after each block execution.
Best Practices
Naming
- Use UPPERCASE for variable names
- Be descriptive:
AUTH_TOKENnotT1 - Use underscores:
USER_IDnotUSERID
Captures
- Only mark final output as captures
- Don’t capture intermediate parsing
- Captures increase output file size
Scoping
- Use
input.*for wordlist data - Use
data.*for HTTP responses - Use
globals.*for startup values - User vars for parsed intermediate data
Debugging
- Use Log blocks to print variables
- Check BlockResult.variables_after
- Unresolved variables stay as
<NAME>