Tram Ho


Currently a lot of websites embed ads to make a profit, I went to a movie site and the ad kept calling, watching a few new ads in the movie …. hmm, I really hate ads : v but for those who view the pagoda like me, you should also support those who are working hard to keep the website running, providing more content in the future.

Advertising is more and more genuine when it uses user data to provide more relevant and necessary content for users. Unfortunately, the more complicated the technology develops, the more hackers can use ads to transmit malicious code, even the big websites have been involved.

If your site is running ads, you are allowing third parties to add content to your website. Now we will see how ads can harm users


Internet advertisements are often delivered through a supply chain of intertwined services. Every domain in the supply chain can become a target for hackers. If hackers can break into the server or routing advertising , they will have a large number of objects (victims) to target, much more effective than hacking a website.

The compromised server will become an extremely useful tool for hackers to spread malicious code.

It is difficult for ad networks to detect because it is only the user being hacked, hackers also use various tricks – like delaying payloads or just targeting every nth user – to deceive them. automatic scanning.

Malware can range from annoying to harmful. One recent trend is the development of ransomware, which locks key files on your computer until the ransom is paid in bitcoin.

If a user gets malicious code when accessing your website, they may not visit again later, here are some ways to reduce the risk.



  1. Downloading malicious code: Users do not have to click on the ad, as simple as watching is enough to transmit payload. Malware is usually delivered through vulnerable versions like Flash and Adobe Acrobat.
  2. Redirects to another site: This is used to steal user information.
  3. Browser lockers: Malware will lock your browser, often referred to as a security alert.

Some common types of malicious code embedding

  • Malware in ad calls
  • Through post-click
  • in the video
  • in Flash video
  • Landing page
  • in pixels


  • Use reputable ad feeds : A selection of fully-licensed networks, such as Google. If you are using a new advertiser, you need to see if they have any large customers
  • Ad Provider Audits : Limit ads in relevant market segments, and if your ad network allows, consider including ads in separate white whitelists.
  • Implement content security policy : Use Content-Security Policy help control the content used in web-pages. But there are still many advertising toolkits (such as Google Adsense) that cannot be restricted in this way, so you can create a “soft” whitelite using Content-Security-Policy-Report-Only in the header.
  • Using client-side eror reporting tools : Several tools such as Sentry, TrackJS, Rollbar and Airbrake will help you detect unusual behavior and possibly pinpoint where malicious advertisements are.


Above is the basic introduction to Malvertising, hope to be helpful. Happy coding

Share the news now

Source : Viblo