【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
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.
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.
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:
如果你对正则表达式不是很熟悉,可以参考如下网站
http://www.regular-expressions.info/quickstart.html
来源:oschina
链接:https://my.oschina.net/u/2308739/blog/744658