The proper way to hijack website traffic
What is website traffic hijacking: when a user opens a URL, an advertising page that does not fall within the scope of the site appears, or directly jumps to a sub-page of a website that does not belong to the site. As a result, a lot of traffic is hijacked to the destination.
How are website hijacking problems detected?
IIS7 website monitoring
Test whether the website is hijacked, DNS pollution detection and other information.
First analyze the effect of traffic hijacking in several forms?
1. A label
2. IMG tag
3. IFRAME tag
There is a common point, that is, there is a link, and the domain name of the link is not the link of the domain name of this site!
So one idea is to kill these nodes when they are added to the Dom, so you can almost get it done! The specific ideas are as follows:
1. Configure the whitelist domain name of this site
2. Bind MutationObserver* to Body and listen for related events appended by dom
3. Remove dropped the domain name that did not match
4. Report the deleted domain name (determine whether it is deleted by mistake)