Lab: Exploiting HTTP request smuggling to deliver reflected XSS

After starting the exercise, the blog should look similar to the one shown in the following figure.

Now we select any blog entry and click on the View post button to open the entry. We then switch to Burp Suite and open Burp Proxy. In the HTTP history tab, we look for the request that was sent by clicking on the View post button. In this example, it is the request GET /post?postId=1 HTTP/2. In the Response section, we take a closer look at the following section.

In line 3, we see that the value of our User-Agent header can be seen in a hidden <input> tag:

We now send this request to the Burp Repeater using the key combination CTRL + R and switch over there. We now insert the XSS payload (/><script>alert(1)</script>) into our User-Agent header. Our request should now look like this.

We now send the request to the application and see in the response that a <script> tag (line 3) with the alert() function has been inserted there.

Now let's switch back to Burp Proxy and go to the HTTP history tab. There, we search for the request GET / HTTP/2 and send it to the Burp Repeater using the key combination CTRL + R.

In Burp Repeater, we now modify the request GET / HTTP/2. First, we change the HTTP method from GET to POST and from HTTP/2 to HTTP/1.1. Then we remove all headers except for Host, Content-Type and Content-Length. At the end of the request, we add the Transfer-Encoding header with the value chunked. Then we press the ENTER key twice and add a 0. The request should now look like this:

We now copy the second request and paste it into the first request. We then adjust the second request. To do this, we remove all headers except Host, User-Agent, Content-Type and Content-Length. The complete request should now look like this:

We now send this request to the application and switch to the browser. There we wait a moment and refresh the browser tab. It may be necessary to repeat this process several times. When your request reaches the other user, the exercise is successfully completed.

Video solution

Last updated