The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

How to create a bcheck that injects something in the middle of an existing path ?

Iordache | Last updated: Sep 28, 2023 09:47AM UTC

Hello, I am trying to create a bcheck that runs for each request and then sends a request injecting something in the middle of the path (before the last `/`). So for instance : initial request -> /test.xxx desired request -> /xxx/test.xxx initial request -> / desired request -> /xxx/ initial request -> /yyy/test.xxx desired request -> /yyy/xxx/test.xxx All the query params should be preserved, if existing. I can solve the first 2 cases with : send request called xxx: replacing path: `/xxx{base.request.url.path}` But how to I solve the 3rd case that requires an analysis of the current path and injecting something in the middle? Is it currently possible? Thanks!

Michelle, PortSwigger Agent | Last updated: Sep 28, 2023 02:31PM UTC

Hi Have you looked into using regex to achieve this? Maybe look at an expression that would allow you to determine the last part of the string, then use not on the same expression to get the first part of the string and pull the three parts together to build your new path?

Michelle, PortSwigger Agent | Last updated: Oct 02, 2023 12:32PM UTC