Skip to content

Burpy Functions

Miu edited this page Jul 1, 2023 · 4 revisions

Here are all the available functions that you can use with Burp.

Name Arguments Description
Concat first (string), second (string), ... more strings (optional) Concatenates two or more strings
Env key (string), default (string, optional) Gets an environment variable
Hash text (string) Hashes a string with argon2id
Home arguments (string) Prepends the home directory to the arguments
Add first (number), second (number), ... more numbers (optional) Adds two or more numbers
Sub first (number), second (number), ... more numbers (optional) Subtracts two or more numbers
Div first (number), second (number), ... more numbers (optional) Divides two or more numbers
Mpy first (number), second (number), ... more numbers (optional) Multiplies two or more numbers
Mod first (number), second (number), ... more numbers (optional) Uses modulo on two or more numbers
Random length (int, max length of 32767) Generates a random string with a specific length
Store key (string), value (string) Stores a value to the heap
Use key (string) Gets a value stored in the heap

Examples

Here are some examples of how you can use the available functions in Burp:

  1. Concatenating strings: [burp: Concat(hello, ,world, ,universe)] will result in hello world universe. Note that an empty argument is used to represent a space between the words.

  2. Retrieving environment variables: [burp: Env(GOPATH)] will return the value of the GOPATH environment variable, such as $HOME/.go.

  3. Hashing a string: [burp: Hash(hello world)] will hash the string "hello world" using the argon2id algorithm and return the hashed result, such as $argon2id$v=19$m=16,t=2,p=1$ZXRzdGVzdGVzdGV0$7E/Ari559oW6qWvyGPBNZQ.

  4. Performing arithmetic operations: [burp: Add(1,1,2)] will add the numbers 1, 1, and 2 together and return the result, such as 4. Similarly, you can use the Sub, Div, Mpy, and Mod functions to subtract, divide, multiply, and calculate the modulo of numbers, respectively.

  5. Generating a random string: [burp: Random(16)] will generate a random string of the specified length, such as CGJvTrl569OrfDxO.

  6. Storing and retrieving values from the heap: [burp: Store(hello, world)] will store the value "world" with the key "hello" in the heap. To retrieve the stored value, you can use the Use function: [burp: Use(hello)] will return world.

Evaluate

To test these functions, you can use the eval command in the Burp CLI:

$ burp eval "[burp: Add(1,1,2)]"
4

You can replace the function and its arguments within the square brackets to test different functions and see their results.