How to block ads like a pro

Credit to Author: Adam McNeil| Date: Thu, 19 Jul 2018 17:24:34 +0000

In part one of this series, we had a look at a few reasons why you should be blocking online advertisements on your network and devices. From malvertising attacks and privacy-invading tracking systems to just being an outright annoyance, online ads and trackers are a nuisance that provides an attack vector for malware authors, compromise user security, and plainly, diminish the browsing experience.

In the second part of this series, we’ll cover a few of the common ad blocking utilities and how to best configure those tools for maximum effectiveness. We’ll take a look at tools that are easy enough to set up and run on mom’s computer, as well as a few tools that may require a bit more expertise. And later on, we’ll discuss a few tools that do a great job of blocking ads and protecting your privacy, but may require a shift in mindset before realizing the benefit. 

So, go grab your cup of Joe, sit back, and dive into the conclusion of “Everybody and their mother is blocking ads, so why aren’t you?”

A note about filter lists

You’ve read the reasons why it’s important to have a robust ad blocking policy on your network. You understand the risks that are posed by malvertising attacks and data-sucking exchange networks. You now want to configure ad blocking within your own network—but where do you start? Your first stop is to look at filter lists.

Several of the tools we’ll cover use sets of rules, known as filter lists, to help determine what should be blocked. These lists are created by individuals, open-source communities, and private organizations. Popular websites to obtain filter lists include the Adblock Plus subscription page and Filterlists.com.

Some filter lists can include specific, narrow qualifiers such as “coin miners,” while others are comprised of large subsets of data targeting multiple facets of advertising and tracking. Filter lists are also broken out into languages to help block ads in various regions.

When the browser requests a website, that site—and all the domains requested by that site—are checked against the filter list prior to being displayed. If a domain is on the filter list, then the ad blocker won’t allow the information to pass, effectively blocking the content. But, too many filter lists will result in too many look-ups. This results in a slowing of the browser and increased response times of websites. Users should be mindful when adding filters lists as to not add more than is required and not add duplicate lists.

Adblock Plus

The popular ad blocking extension made by Eyeo is the simplest and most popular of the tools we’ll cover—and it’s easy to see why. Adblock Plus has been blocking banner pop-ups, advertisements, and trackers for the last 12 years. The browser extension works in popular browsers such as Chromium, Mozilla, and Safari, and is easily configured to block a variety of threats. Adblock Plus runs with minimal interruption on PCs (and yes, this is actually configured on my mom’s PC). The company even has its own Adblock Plus browser that can be used on mobile devices (more on this later).

Though Adblock Plus works out-of-the-box without any other configurations needed, it’s best to dive into the settings to make a few adjustments.

Download

After using one of the previous links to install Adblock Plus to your preferred browser, the options menu can be accessed by clicking the red ABP icon that appears at the top of the browser. From there, click the Options button at the bottom of the window.

Adblock Plus encourages publishers to join their Acceptable Ads program. The Acceptable Ads program allows publishers who adhere to a prescribed set of guidelines an opportunity to have their ads shown to users who are using Adblock Plus. While this feature has caused a bit of flak for the company, the subsequent creation of the Acceptable Ads Committee has helped create a dialogue surrounding responsible advertising.

While those things are fine and dandy for publishers, we’re looking to block advertisements, so let’s disable those “acceptable” ads.

Set up

From within the General tab of the Settings window, uncheck the option for Allow Acceptable Ads. This will also be a good time to enable the Privacy and Security settings for Block additional tracking and Block social media icons tracking. Both settings will help prevent trackers from harvesting information about your browsing session (since social media buttons are used to track user behavior).

The default filter lists are shown under the advanced tab. Adblock Plus comes pre-loaded with several popular lists, including: EasyList and Fanboy’s Social Block List.  Additional filters can be downloaded and installed from the Adblock Plus subscription page, but the default lists will sufficiently weigh function and convenience to provide a modest ad blocking experience.

Test

That’s it! Just a few clicks are all that is required to get a baseline setup of Adblock Plus. Let’s test it out and see how it looks.

That’s pretty cool, huh? The advertisements in videos, articles, and search results are all removed. And because the ad content isn’t being displayed, the page response time is faster and the desired content is reduced to a smaller portion of the landscape. This reduces the time spent scrolling around the page.

Sometimes it doesn’t work

Though Adblock Plus works great to block ads on most websites, sometimes it may not. Ads may find their way onto the page, or notices may be shown advising to disable the ad blocker.

Indeed should the need arise, Adblock Plus is easy to disable simply by clicking the ABP logo and then clicking the check mark to disable/enable the service.

But this post is about blocking ads, not succumbing to the pressures of aggressive advertisers. And though it may be possible to configure Adblock Plus to block the majority of these ads and trackers, advanced users may prefer to use a solution which allows for more granularity and greater control over the page elements and individual page frames.

uBlock Origin

uBlock Origin, which is not to be confused with µBlock, is another browser-based plugin, which is available for both Chromium and Mozilla browsers. Like Adblock Plus, the product is widely popular and utilizes a variety of filter lists to help block advertisement and trackers. Unlike Adblock Plus, however, uBlock Origin is an open-source project, which helps to boost the popularity of the product and helps the company to remain free from the outside influence of advertisers and publishers.

Though uBlock Origin works well at its intended purpose, the product may not be suitable for all users due to the technical nature of the program and difficulty in navigating its user interface (UI). Some have complained about the increase in support cases due to the installation of the program from users who may not understand why their webpages don’t look the same. But for those who understand the advertising landscape and the potential for blocking ads to cause trouble, then uBlock Origin appears to be a preferred choice.

Download

Installing uBlock Origin is an almost identical process to installing Adblock Plus. Just head over to the Mozilla Add-ons page, Chrome Web Store, or Safari extensions page to grab a free copy of the software, and click the buttons to install the extension.

After installing uBlock Origin, a red icon will appear in the top right of the browser window. Options can be configured from this icon. Though uBlock Origin works well in the default state, we’ll take a look at the settings and configurations and make a few changes to help block some of the previously missed elements.

Set up

Clicking the uBlock Origin icon will open the panel window. The big blue button can be used to easily turn uBlock Origin off and on. The settings icon looks like a slider bar and will open the settings dashboard.

 

After opening the uBlock Origin dashboard, users are presented with a window with various tabs. There aren’t any configuration changes required, and the only setting worth noting is I am an advanced user, which will be discussed later.

One area uBlock Origin stands out above the competition is the inclusion of various filter lists. These lists can be enabled and disabled as necessary to allow a quick mechanism to block ads and trackers, but also malware, scam sites, and other annoying website elements. Though the defaults are pretty good, we’re going to add a few more lists to improve the blocking capabilities.

In addition to the default lists, the following lists will also be enabled:

  • uBlock filers – Annoyances
  • Adblock Warning Removal List
  • Malvertising filter list by Disconnect
  • Spam404
  • Fanboy’s Annoyance List
  • Fanboy’s Social Blocking List
  • hpHosts Ad and tracking servers

Once all are enabled, click the Apply changes button to save the settings, and then the Update now button to update the lists.

Test


uBlock Origin is configured to use most of the same filter lists as have been configured for Adblock Plus, so many of the same ads will be blocked as before. The inclusion of the additional filter lists will help to exclude some of the web elements that were previously remaining.

More difficult

Even with strict filtering, not all advertisements will be blocked. There are still videos that auto play from websites, or advertisements hosted on the visited site instead of from a known third-party advertiser. For these types of ads, it’s best to create custom rules to block the individual elements on the page.

Right-click the advertisement—or section of the page where the ad appears—and choose the block option. A window will appear allowing the rule to be previewed before creation. Click the create button, and the only thing we’re left watching is that video disappear!

Elements can also be blocked by clicking the uBlock Origin icon and using element zapper or element picker. The difference between these two is that the element zapper is temporary and only removes the element until the session is closed. Element picker adds the element code to the block list so that it will also be blocked on future visits.

This feature can be used to remove the empty element that remains on the previously examined page. Simply open uBlock Origin and click the Element Picker icon. Carefully select only the desired area of the page to be blocked. Be sure to use the preview option prior to creating the rule to ensure the block works as intended. After verifying, create the rule to remove the desired frame.

Advanced

There is nothing worse than opening a bunch of tabs only to later find one of them playing video from a small screen sequestered to the corner of a window. Sure, these elements can be blocked on an individual basis, but technically savvy users may desire a blanket approach to prevention. For that, uBlock Origin offers script blocking.

uBlock Origin logs all script activity on a webpage for analysis. Looking at the information helps reveal the number of trackers and ad networks in use on a particular website.

To use the logger feature, open the uBlock Origin panel and click the Logger icon. The logger window will appear. Press the refresh button to start the logger and reload the page. Information about the website will be logged to the window.

The blocking of web scripts tends to leave some websites lacking in functionality or just plain unusable. Blocking scripts should be reserved for those who understand the complications to be expected. The problematic nature prompted uBlock Origin to hide the feature behind the setting titled I am an advanced user. To gain full access to the settings, users must click the link for required reading.

After enabling the setting and reading the document, new options will appear within the uBlock Origin dashboard. The new options give users the ability to block first- and third-party scripts, as well as set individual policies per website.

Group settings based off script source will be displayed on top (red section), while the websites being called will appear below (blue section).

The two columns to the right of the names are used to define global (left) and local (right) policies. The combination of the two columns allows for a varying mixture of blocking capabilities.

For example, uBlock Origin can be configured to block all third-party scripts and frames, but first-party scripts will be blocked ONLY on the local site, since blocking first-party scripts globally will lead to problems loading webpages elsewhere.

Changes can be previewed by clicking the refresh circle. After verifying the changes, save the settings by clicking the lock icon at the top of the screen.

The resulting effect is that the auto-playing news story has now disappeared from all webpages on this site.

Not only did this stop the video, but if we go back and look at the logger, we see that all of the third-party scripts that were previously allowed are now being blocked.

Blocking scripts is one of the most effective mechanisms to block ads and invisible trackers, but will lead to unintended results.  Those who are interested in experimenting with script blocking—and who find the uBlock Origin UI intimidating—may find solace in the simplicity of the next plugin on our list.

A note about scripts

Website scripts come in a variety of forms including JavaScript, Java, and Flash. These scripting languages are used for advertising and tracking, but also to make the internet function.

Videos and graphics may be produced with scripting code. Webpage content may also be generated using these languages. Comment sections and other social media content are produced with scripting languages. As a result, users should expect the following:

Blocking scripts by default WILL cause some websites to fail.

Blocking scripts by default WILL prevent some content from loading.

Users who decide to implement global script-blocking policies will need to be aware of the potential issues and how to resolve such issues when they occur. Having an understanding of the domain landscapes and being able to analyze the necessary domains to enable desired content will also be needed. Simply whitelisting all websites will negate the value of blocking scripts, so understanding the how-to and why is important.

NoScript Security Suite

NoScript is a browser-based plugin for Mozilla browsers only. There is an alternative for Chromium called ScriptSafe, and Safari users have JS Blocker. Both will work similarly.

NoScript provides an extra layer of protection by ensuring that scripting code such as Java, JavaScript, and Flash is only executed by trusted websites. Blocking scripting languages from running on untrusted websites will prevent ads, trackers, and other forms of undesirable activity from occurring.

In addition to blocking scripts, NoScript comes with a robust set of anti-cross-site-scripting (XSS) and clickjacking protections to help prevent malicious actions and undesirable redirects.

NoScript and other script blockers are recommended for advanced users who understand the risks.

Download

The process is no different for NoScript than any other plugin. Jump over to the Mozilla Add-ons page and install the extension to the browser.

NoScript requires absolutely no setup and will begin working immediately after being installed. Unlike the other extensions we’ve covered, there is no way to disable NoScript. If users need to disable the plugin, it must be done through the Mozilla add-on configuration panel.

Using NoScript

Users may immediately notice a difference to their browsing experience after installing NoScript. Videos and gifs may not load correctly, content may not appear, or worse, pages may fail to load altogether. Though this sounds terrible, it’s easy to configure NoScript to your personal browsing needs.

The simple NoScript interface makes it easy to create exclusions and allow blocked content on either a temporary or permanent basis. Instead of settings and filter lists, NoScript simply uses a series of easy-to-understand buttons to control the content.

After NoScript has blocked content on a page, a numbered indicator will be shown on the NoScript icon. Click the icon to view the blocked domains.

This image shows elements being blocked on two domains. One of those would be a desired website; the other would be an ad network. Clicking the Trusted icon next to the desired website will allow scripts to run ONLY from that domain. Click the green refresh circle at the top to reload the page.

After allowing the root domain the privilege of running scripts, the website functionality may still be lacking. Additional domains may be shown after allowing the root domain, and some may need to be allowed before the content appears.

NoScript allows for temporarily allowing script execution from unknown domains. Simply click the Temp Trusted icon to allow code execution until the current session expires. Unfortunately, it may be a bit of trial-and-error to find the domain to allow before seeing the desired content.

Though not designated as an ad blocker, NoScript will block advertisements injected via third-party scripts. NoScript won’t remove the empty elements from the page, so a tool like uBlock Origin will still be required to de-clutter the page landscape.

NoScript comes with a list of already assigned permissions, but the list is not extensive. Users will need to configure the program for the websites they most frequent. If the desired website makes heavy use of third-party scripts and content, it will be necessary to individually allow all content-providing domains for the website to function as intended. Some websites make extensive use of outside content, so users may spend considerable time configuring permissions before streamlining the experience.

NoScript is a valuable tool in any security toolkit. Blocking scripts is an effective way to block malicious activity and unwanted content.  Users may have to overcome the steep configuration curve before recognizing the benefit of the tool, but those who do will be rewarded with a faster browsing experience and fewer online trackers compromising their online privacy.

A note about browsers

Browsers are the key to a successful ad blocking experience. Some browsers support the use of ad blocking extensions whereas others do not. This post has focused on ad blocking using the Mozilla Firefox browser. Though subjective, Firefox provides a better all-around ad blocking experience across platforms. In fact, our own extension blocks malicious sites and unwanted content on Firefox only. By using the same browser and plugins across machines, configurations and personal filter lists can be shared across devices. This reduces the configuration time on a per-machine basis and produces a similar web experience—regardless of device.

Though Google Chrome is an extremely popular browser, keep in mind that it is distributed freely by a company that makes a substantial portion of its annual revenue from advertising.

According to Statista, Google netted $95.38 billion dollars, or roughly 87 percent of its total revenue, through advertising. Not only is the company selling ad space on the network, but they also collect information about your browsing activity in order to give “contextually relevant suggestions” (a fancy way to say ads).

The Google Chrome Privacy Whitepaper and Chrome Privacy Policy provide plenty of information on Chrome’s collection capabilities, and is an eye-opening read for those concerned about data mining. Some concerning items are shown below with highlighting added for better clarity.

The United States Congress has also become interested in Internet tracking and has recently requested responses from both Google and Apple on user tracking practices.

Yes, other browsers will track your behavior, but the extent will be reduced when using an open-source browser without an advertising agenda. Those who may be interested in using an open-source browser, but are preferential towards the look and feel of Google Chrome, may be interested to experiment with the Chromium browser. Chromium is the open-source project behind Chrome and Opera, and functions almost identical to both—save for all the Google modifications.

Block ads on Android

After having used an ad blocked browser on mobile, returning to an ad-laced mobile Internet is more than just a diminishment of the user experience—rather, it’s a downright dreadful experience.

The mobile landscape is already limited in size by its design, yet publishers and website owners feel it necessary to inundate the screen with irrelevant content and banner ads. This renders the content from the main site barely viewable and forces many users to fumble through troublesome mechanisms simply to read an article.

Some may contend that it’s best to not click on the ads, but a better approach may simply be to get rid of the ads altogether. This will not only declutter the screen and remove the undesirable content, but also improve page response times and lessen the attack surface against devices.

As we’ve seen throughout this write-up, browser extensions have been key to a successful ad blocking experience—and mobile is no different.

All of the tools covered in this post are available on mobile devices. But due to restrictions in Google Chrome on Android, users of that browser will be unable to set up the necessary configurations.

Thus, users who wish to block ads on their Android device will be forced to look to other browsers to accomplish the goal.

One simple solution that even dear old Mom will be able to use is the Adblock Plus browser. This Firefox-based browser is built by the same team that produces the Adblock Plus extension and incorporates all of the blocking capabilities in a pre-packaged browser that is configured for a modest ad blocking experience.

Users wanting more control over the various elements and frames may wish to consider the jump over to Mozilla where all of the plugins and configurations that were discussed in this write-up can be used to block the ads and declutter the screen. Those who opt for the change will see that dreadful mobile experience replaced with an ad-free view of how the page was originally intended to appear.

Mobile browser plugins perform exactly like their desktop counterparts, and will sufficiently block advertisements, trackers, and scripts from your mobile devices. Blocking the content not only improves the mobile web experience, but also helps to conserve battery life, decreases data-usage and the response times of websites, and reduces the attack surface for online threats.

But with the abundance of mobile devices, setting up policies on individual devices may not be the most efficient way to block advertisements. If there are a number of devices under your control, what would be the most efficient manner to block ads across them? For this, the final tool on our list will fill the void.

Pi-hole

Administrators of small businesses or moderate home networks who wish to engage in ad blocking practices without the concern of operating systems, browsers, and plugins may wish to implement a free and (moderately) simple network-based solution. For that need, we have Pi-hole.

Pi-hole is a Linux based, network-level advertising and tracker blocker that acts as a DNS sinkhole for blacklisted domains. This means that advertisements and trackers are blocked before making it into the network. This allows Pi-hole to block ads on not just computers and cell phones, but also smart TVs, third-party apps, and even streaming video services.

Like the other tools we’ve covered, Pi-hole uses filter lists to block undesirable content. The Pi-hole filter list is compiled from various third-party sources into a single list. As such, there will be overlap between the lists used between Pi-hole and other ad blockers like uBlock Origin and Adblock Plus.

Pi-hole has been designed to work seamlessly on single board computers, such as Raspberry Pi, but can just as easily function on other Linux machines or cloud-based implementations.

Although not all Pi-hole installations can be as pretty as the above setup, having a dedicated Linux machine to act as the DNS server will be a necessary requirement.

Set up

After having a device to configure Pi-hole, setup is easy and straightforward. The command to install Pi-hole is as simple as:

curl -sSL https://install.pi-hole.net | bash

Privacy-conscious users may wish to consider using the Cloudflare DNS for the upstream DNS provider. This privacy-focused DNS provider offers a fast and reliable lookup (except for the time it wasn’t). The address is: 1.1.1.1

After configuring your router DHCP options to force clients to use Pi-hole as the primary DNS server, setup will be complete.

The web-based panel can then be accessed by typing: http:/pi.hole/admin in your browser. The panel will give overall statistics regarding the number of blocked ads, number of DNS queries, and percentages of blocked traffic. Custom whitelists and blacklists can be configured using the tabs on the left.

Test

Now that it’s all set up, we can have a look to see how well Pi-hole blocks the content.

As you can see, Pi-hole does a good job of removing the ads from this page. None of the ads remain, and only a few web elements are left behind. Using the Block Element feature in uBlock Origin or AdBlock Plus (not covered) will clear those unnecessary elements from the page.

And though Pi-hole works great to block ads at the network level and for all devices, users may still be required to configure a per-device ad blocking policy in order to protect laptops and mobile devices when not under the protection of the Pi-hole DNS sinkhole. Pain though this may be, Pi-hole makes an excellent addition to any ad blocking arsenal. The benefits of blocking ads throughout your environment and across streaming platforms outweigh the duplication efforts involved.

A final note

In preparation for this article, I spoke with a number of friends and colleagues regarding their ad blocking preferences. Despite the fact that we are all in security and all read and share the same information, few of us block (or view) online advertisements and trackers the same way.

What I’ve come to realize is ad blocking is often reflective of one’s personal experiences and perception of online threats. The level to which a person is willing to go to maintain personal security can depend on the level of tolerance and compromise that person is willing to extend in exchange for the belief that their activities are secure.

Case in point: Some colleagues block advertisements from third-party advertisers due to security concerns, but those same people may allow suggestions from their search provider on the notion that ads from reputable vendors don’t pose the same risk. Others may be adamant about blocking ads on their network as to not compromise proprietary information, but will tolerate ads on their mobile device as to not interfere with mobile browsing functionality.

A few take a hard-line approach and block as much as possible, which can render websites inoperable, while a majority are willing to compromise in exchange for a more user-friendly experience.

Though this article takes the position that all advertisements should be blocked, not everyone will agree. Some see the benefit in online advertising. Others may agree about blocking advertising content, but disagree with the methodology used in this post.

In a nutshell, there is no right or wrong way to block advertisements and trackers, and there seems to be little consensus regarding the most effective manner in which to do so.

Therefore, those wishing to configure an ad blocking policy within their environment will be encouraged to experiment with various products and methods to find what works best for their needs.

Block ads like a pro!

You’ve read this post and are hopefully coming away with the knowledge of why it’s important to block ads and the tools necessary to do so. But how should you set up your own network?

Of course, I can’t tell you that. You’ll have to come up with the system that best fits your needs, environment, and patience levels. But what I can tell you is how my personal setup is configured.

DesktopMobile
Default Browser:Mozilla Firefox with ad blocking protectionsDefault Browser:Mozilla Firefox with ad blocking protections
Secondary Browser(s):Chromium / Internet Explorer without protectionsSecondary Browser(s):Opera (currently, but this changes) no protections
Google Chrome:Rooted & Removed
Browser ExtensionsBrowser Extensions
Adblock Plus:uBlock Origin:
Adblock Warning Removal ListuBlock filters
Facebook annoyances blockeruBlockfilters – Badware risks
NoCoin Filter ListuBlock filters – Privacy
uBlock Origin:uBlock filters – Resource abuse
uBlock filtersuBlock filters – Unbreak
uBlockfilters – Badware risksAdguard Mobile Filters
uBlock filters – PrivacyEasyList
uBlock filters – Resource abuseEasyPrivacy
uBlock filters – UnbreakFanboy’s Enhanced Tracking List
EasyListMalware Domain List
EasyPrivacyMalware domains
Fanboy’s Enhanced Tracking ListPeter Lowe’s Ad and tracking server list
Malware Domain ListNoScript
Malware domainsDecentraleyes(not covered)
Fanboy’s Annoyance List
Fanboy’s Anti-Third-party Social
Fanboy’s Cookiemonster List
Fanboy’s Social Blocking List
Peter Lowe’s Ad and tracking server list
NoScript
Privacy Badger(not covered)
Decentraleyes(not covered)
  • Though not in my current setup, Ghostery deserves a shout-out. Users might consider giving it a try also.

These tools help to maintain a relatively ad-free experience, limit my exposure to privacy-invading trackers and online threats, and along with well-defined personal filter lists, help keep my favorite websites running smoothly and efficiently. Taken together (and considering the nifty calculation provided by uBlock), I’d estimate that anywhere from 18 to 33 percent of total traffic is blocked due to unwanted or unapproved content.

This concludes our series, “Everybody and their mother is blocking ads, so why aren’t you?”. We hope you are coming away with a better understanding of how online advertisements pose a threat to your online security and how trackers can jeopardize your personal privacy. You should now have the knowledge of why it’s important to block advertisements on your devices, and the know-how to create a robust and successful ad-blocking policy within your network and for your devices. Most importantly, we hope we’ve given you the tools and the empowerment to take back control of your browsing experience and to block ads in your own environment—just like the pros.

 This post reflects the opinion of the writer, serving as a review of the tools available to block online advertisements. Malwarebytes has no affiliations with and does not endorse any of the companies or tools listed in this write-up. 

The post How to block ads like a pro appeared first on Malwarebytes Labs.

https://blog.malwarebytes.com/feed/