Match and replace
Let's imagine that you are testing an application designed for mobile devices using a standard
browser from your computer. In most cases, the web server examines the user-agent provided
by the browser to identify the specific platform and respond with customized resources that
better fit mobile phones and tablets. Under these circumstances, you will particularly find the
match and replace function, provided by Burp Proxy, very useful. Let's configure Burp Proxy in
order to tamper the user-agent HTTP header field:
1. In the options tab of Burp Proxy, scroll down to the match and replace section.
2. Under the match and replace table, a drop-down list and two text fields allow to create
a customized rule. Select request header from the drop-down list since we want to
create a match condition pertaining to HTTP requests.html
3. Type ^User-Agent.*$ in the first text field. This field represents the match within the
HTTP request. Burp Proxy's match and replace feature allows you to use simple strings
as well as complex regular expressions.web
4. In the second text field, type Mozilla/5.0 (iPhone; U; CPU like Mac
OS X; en) AppleWebKit/4h20+ (KHTML, like Gecko) Version/3.0
Mobile/1C25 Safari/419.3 or any other fake user-agent that you want to
impersonate.
5. Click add and verify that the new match has been added to the list; this button is
shown here:正則表達式
若是你對正則表達式不是很熟悉,能夠參考以下網站express