Skip to content

7.simple practice

lulianqi edited this page Mar 25, 2019 · 1 revision

Seven: simple practice

Goal: Replace the logo of the baidu homepage with the logo of google

Our first request to find the baidu homepage logo is: https://www.baidu.com/img/bd_logo1.png

We searched the web for a google logo: https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/220px-Google_2015_logo.svg.png (If you can't access this link, you You can choose any other image url to test)

With FreeHttp we have a variety of solutions to achieve the goal

1: Use "Request Modific" to modify the request url content so that he actually requests the google logo

Set the rules as shown above

The effect is as shown in the actual request for the baidu logo is actually modified to google (these changes are not visible to the client browser, but because it is an image file, please pay attention to the browser cache when testing)

2: Use "Response Replace" to modify the request to redirect to google's link

Set the rules as shown above (if you have just set the Request Modific rule for the link to the image, set the previous rule to unavailable in order not to affect the test process)

The effect is shown in the figure, the request of bd_logo1.png is actually redirected to the new address, which also achieves the effect just.

3: Use "Response Replace" to directly replace the returned image content

Set the rules as shown above (local images need to be prepared in advance)

The effect is as shown in the figure (the effect is the same, the actual principle is slightly different, this time is the request response directly using the local file change)

4: Use "Response Modific" to modify Baidu homepage HTML, and change the address of the image element to the link of google

Set the rules as shown above (note that this time is not to modify the response of https://www.baidu.com/img/bd_logo1.png , Url Filter matches https://www.baidu.com/ )

The effect is shown in the figure. You can see that the address of the HTML of the Baidu homepage has been directly modified. The browser parses the url that was tampered with and requests the wrong image.

Clone this wiki locally