Intercepted request through HTTP ToolKit headers won't change

252 Views Asked by At

So I've started this webSec course, and they gave us a bunch of different things to do, one of them is to catch HTTP requests and play with the headers. I downloaded HTTP ToolKit exactly for that purpose, but for some reason every time I change the headers and let the request continue, when I look at the sent request the changes were not made... (https://i.stack.imgur.com/nRYqZ.png) [in this image you can see that the user_level is 0] (https://i.stack.imgur.com/rfDw6.png)[in this image you can see that I changed it to 2] (https://i.stack.imgur.com/3HHWq.png) [in this image you can see the the sent request after editing it and how it didn't change for some reason] I also had the same problem when I tried to change the user agent....

1

There are 1 best solutions below

2
Tim Perry On

For all data in a proxy environment like this there are two different visions you could be interested in: how the client sent the data, and how the server received the data. These are the same by default, but when you start modifying traffic they diverge.

Right now, the content shown in HTTP Toolkit is always from the perspective of the client. In practice that's usually what you want, since HTTP proxies like these are very often used to understand client behaviour, but in this case it can be confusing. There's an open feature request to allow toggling between perspectives on this data that you can vote for here: https://github.com/httptoolkit/httptoolkit/issues/250

I the meantime, if you know the rule was applied (i.e. the breakpoint triggered and the request is marked as mocked) then the very likely reality is that your changes are indeed taking effect, and the only problem is that you're not seeing them as you expect. If you want to confirm this, the easiest way is to use an endpoint that echoes the request content back at you, such as https://httpbin.org/anything.