1. Support Center
  2. Documentation
  3. Desktop editions
  4. Useful functions
  5. Response extraction rules

Response extraction rules

Response extraction rules are used in various locations within Burp, to define the location within a response of a varying item that needs to be extracted. They are used to identify a custom session token in Sequencer, define an extract grep item in Intruder, and specify the location of a custom parameter value in a macro.

Because response extraction rules are designed to extract the same item from multiple responses that may differ in various ways, Burp provides very flexible ways of specifying the item's location.

The dialog to define an extraction rules shows the current configuration in the top panels, and a sample response in the lower panel. If the response has not yet been fetched from the target application, you can click the "Fetch response" to do this.

The easiest way to specify the item's location is simply to select it within the sample response. Provided the box "Update config based on selection below" is checked, Burp will then automatically create a suitable configuration in the top panels.

In some situations, you may need to modify the configuration manually, to ensure that it works when different responses are received. The available options are described below.

Define start and end

This option lets you define the start and end points of the item to be extracted:

Define from regex group

You can specify a regular expression containing a group, and the contents of the group will be extracted, if matched. For example, you could extract the contents of the HTML title tag using:

<title>(.*?)</title>

Or you could extract the first 6-digit number that appears in the response using:

(\d\d\d\d\d\d)

Testing your configuration

When you manually modify the configuration in the upper panels, Burp automatically highlights within the response the item that will be extracted (if any).

When you have completed the configuration, you can click the "Refetch response" button a few times to test the configuration. Burp will then refetch the response and automatically highlight the item that will be extracted, so that you can confirm that the configuration is working as intended.