How it works...
In this recipe, we used Burp Suite as a proxy to capture a request after it passed the validation mechanisms established client-side by the application, that is, in the browser, and then modified such request content by changing the Content-Type header and used that to bypass the file type restrictions in the application.
Content-Type is a standard HTTP header set by the client, particularly in POST and PUT requests, to indicate to the server the type of data it is receiving. It's not uncommon for web applications to use this field and the file's extension to filter out dangerous or unauthorized types in applications that allow users to upload files. As we just saw, this sole protective measure is insufficient when it comes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access