Parsing parse tree elements

Let’s look at parsing the elements of the parse tree using the example of parsing the authorization header (parsing the request tree is described in detail in the section section 10). A similar request can be sent as follows:

curl waf_ip -d'authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' -H"x-real-ip:8.8.8.8" -H"referer:http://dvwa" -H"host:dvwa"

The sent request is shown in Figure 260.

image383

Figure 260 – Request with the Authorization field

To parse the authorization field you need:

  1. Go to the “Applications” -> “Requests” tab (see Figure 261).

image384

Figure 261 – “Queries” window

  1. In order to deepen the parse tree, you need to click on the “image385” icon in the part where you need to expand the parse tree - in this case, to the “URL Parsing” block. The settings of this block are shown in Figure 262.

image386

Figure 262 – “Parse step” window

  1. Next, we decode the first part of the request using a Base64 decoder. Its settings can be seen in Figure 263.

image387

Figure 263 – Setting up a request parsing block

  1. We further parse the decoded value using the JSON decoding method (see Figure 264).

image388

Figure 264 – Configuring the request parsing block

  1. Points 3 and 4 are repeated for the second block. As a result, the query data parsing model will look like Figure 265.

image389

Figure 265 – Parse tree for a request with a jwt token

As a result, the jwt token will be parsed in the parse tree and the value of the parameters decoded from Base64 will be displayed (see Figure 266).

image390

Figure 266 – Parse tree for a request with a jwt token