HTTP Content Tampering Practice
Read the "Graphic http". Although a very light book, can be said in the following chapter of the various attacks to tickle the hands. Below simulates some bad operator's practice, gives the ordinary HTTP webpage to add the advertisement.
First, the software simulates the router-level HTTP forwarding of the carrier.
In order to quickly implement HTTP forwarding, find an HTTP proxy server on the Internet. Directly search ' Python HTTP agent server ', find a very useful proxy server proxpy, you can write your own plug-in to rewrite the HTTP request, response, it is the desired software. After SVN checkout down, refer to proxpy instructions, run the command
0.0.0.08080
After running, a proxy server is started locally and the default host is 0.0.0.0,port 8080.
The browser then sets the proxy server as the local proxy server created above.
Browser proxy settings in many ways, the recommended browser plugin, convenient and quick. The browser proxy plugin can be found in the browser store. Chrome can install the browser proxy plugin switchysharp. Create a proxy mode in Switchysharp, set the HTTP proxy, and the proxy host is 0.0.0.0,port to 8080 (consistent with the local proxy server parameters that were started above).
Finally, tamper with the webpage according to your own ideas.
Rewriting the process of processing response in changeagent.py, tampering with response. For example, use the following code to add an alert (1) to all the JS scripts.
def proxy_mangle_request(req): req.setHeader("User-Agent""ProxPy Agent") return reqdef proxy_mangle_response(res): res.body=res.body.replace("</script>",";alert(1)</script>") print res.body return res
It is important to note that the original response uses content compression and content encoding, otherwise the replace may not match.
Welcome to the Csdn-markdown editor