• Home
  • The Song
  • The Avatar
  • The Cat
  • Contact the Cat

Gyp the Cat dot Com

How to Block Ads on iPhone and iPad Jailbreak Free
Computers, internet, iPhone

How to Block Ads on iPhone and iPad Jailbreak Free

[alert style=”red”] Disclaimer – This walkthrough involves equipment other than your iPhone or iPad in order to work! [/alert]

This will also probably work on any other computer, smartphone or tablet that supports HTTP proxies.

[one_half]

iPad before Ad Blocking
iPad before Ad Blocking

[/one_half] [one_half_last]

iPad after Ad Blocking
iPad after Ad Blocking

[/one_half_last]
[toggle title=”Here Contains a Rant, You Won’t Miss Anything by Skipping It”]

Don’t get me wrong I know that online advertising is the life blood of the internet, some sites are very expensive to run. The guys who run these sites deserve to be able to defray their costs, and if they can turn a profit by having something useful I think that is a great idea.

Not only that but I’ve found that advertising can actually be very useful. If I’m reading something and someone is advertising something that I would not of normally found out about then I think this is great. I’m being educated and I like that.

I’ve also ran online advertising campaigns for a number of clients, and found them to be excellent ways in which to highlight a product, or to enable you to enter a market. It’s a new world, and I embrace it.

However web designers and advertisers please make note of the following… When I am on a tablet device or a phone, and your adverts have not been formatted to work on my screen then guess what? You completely ruin my browsing experience.

Actually I can go as far as saying you can DESTROY by browsing experience quite easily. Let me explain. Some adverts on pages don’t like you scrolling in to their pages, literally. You scroll in and it may focus in the advert but it destroys the text I actually want to read. If at the same time you stop me from using the inbuilt “reader” function then I’m sorry but you’ve just lost what could have been a loyal reader.

Other sites put that many adverts down the side of the pages (you know I navigate by touching the screen right?) that I can’t instinctively scroll down through your site without clicking on an ad. A certain popular social network is a major guilty partner in this one.

[/toggle]

I like non-obtrusive adverts, so we won’t be blocking them.

For this tutorial what you will need is a server running Ubuntu. We are going to install Squid, and use regular expressions to block adverts. We are also going to add a less intrusive replacement for the ads we will be removing. I used Ubuntu Server 11.10 for this tutorial and the excellent block lists over at http://pgl.yoyo.org

I’ll assume that you’ve got full root access too and will assume that your home network looks like this:

Router 192.168.0.1
Subnet Mask 255.255.255.0

Ubuntu Server 192.168.0.100
Subnet Mask 255.255.255.0

Logon to your Ubuntu server and install Squid:

apt-get install squid

We’ll get the block lists sorted before we make the appropriate changes in the Squid configuration. Type in the following each on it’s own line

wget -O /etc/squid3/ad_block.acl “‘http://pgl.yoyo.org/adservers/serverlist.php?hostformat=squid-dstdom-regex&showintro=0&mimetype=plaintext”
wget -O /usr/share/squid3/errors/English/ERR_ADBLOCKED “‘http://www.gypthecat.com/stationary/ERR_ADBLOCKED”

Now let’s dive into the Squid configuration settings, but we won’t be doing too much, just enough to get our ad blocker working. We’ll also assume that your network settings look like the network settings above, if not change them accordingly.

nano /etc/squid3/squid.conf

Put the following lines at the top of the file.

acl localnet src 192.168.0.0/24
acl ads dstdom_regex “/etc/squid3/ad_block.acl”
http_access deny ads
http_access allow localnet
deny_info ERR_ADBLOCKED ads

Press [CTRL]+O (Save the file), then [CTRL]+X (Exists Nano).

Now lets restart Squid to make the changes we made.

service squid3 restart

Now lets make our iPad go through the proxy. Go to your Settings, Wifi, click the little Blue Arrow. Down the bottom select “Manual” and enter your details.

Proxy Server 192.168.0.100
Port 3128 (this is the default Squid port, if you changed it you will have to put it in here.)

[one_half]

iPad Settings
iPad Settings

[/one_half] [one_half_last]

iPad Settings
iPad Settings

[/one_half_last]

Now you can surf away and most of the adverts that get in the way of your tablet surfing will be gone!

There are further steps you could take if fancy like putting further technology in place:

  • Why not host this on a Linux VPS so you can block adverts regardless of how you have connected to the internet?
  • (You will need to pay attention to security, may want to implement proxy HTTPS and probably will want to set Squid up with authentication.)
  • When you get your Raspberry Pi why don’t you install the above on there for a low energy and low cost tailored proxy server?
  • Why don’t you add additional block lists to keep your users safe?
Update: Thanks to the guys pointing out that this method didn’t work with Ubuntu 12.04, I’ve updated the instructions above.  Thanks guys.

Can you test this on any other smartphones or tablets and let me know if it works?

Related

Written by gyp - April 17, 2012 - 7457 Views
Tags | internet, iphone, linux, proxy, squid

You Might Also Like

Responding to a Website Defacement

June 19, 2012

3 Ethical Dilemma for Information Security Professionals

February 19, 2012

10 White Hat SEO Tips for IT Professionals

September 10, 2011

4 Comments

  • ducsu September 23, 2012 at 12:27 am

    Thanks for the info. Some sites just placard ads all over and it is very obtrusive to read what the actual page is all about. Anyway I can block them ads, I will. On my pc, I use admuncher. By far, this is the best app one can get to block annoying ads. It is not free, although, but it is worth the money.

    I wish they would create an app for the iphone as well. In the meantime, squid will have to do for any users who use mobile phones. Thanks again.

    Reply
    • gyp September 23, 2012 at 3:59 pm

      Glad to help and thanks for commenting 🙂 I’m glad I’m not the only one who finds some ads obtrusive.

      I’ve never come across AdMuncher but it looks pretty good. There are plenty of open source tools too, including PeerGuardian and AdBlock available for Chrome and Firefox.

      Reply
  • blanko3 March 19, 2013 at 9:11 pm

    Easiest way to Block all Ads is to just change your DNS server, its legal and takes 2 seconds.

    It blocks everything from Youtube ads to web ads to App ads.

    link below

    http://adstamp.blogspot.com.au/

    and it doesnt affect bandwidth

    Reply
    • gyp March 19, 2013 at 10:23 pm

      Wow, that looks good. Thanks for pointing it out, I will give it a go myself 🙂

      Reply

    Please Post Your Comments & Reviews
    Cancel reply

    Your email address will not be published. Required fields are marked *

    Previous Post
    Next Post

    Latest Posts

    • How to Convert CSV to Parquet Easily with Python on Linux Shell
    • Kusto Geolocation IP Lookup
    • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
    • HTTP to HTTPS Redirect on Azure CDN
    • Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway
    • Black Ops 3 NAT Type Strict & PS4 NAT Type 3 with pfSense Fixed!
    • Sorry for the lack of posts
    • How to Block Internet Access with Group Policy (GPO)
    • Enforcing Microsoft Office 365 and Azure Tennancy with McAfee Web Gateway (MWG)
    • Scanning Subnet for Issuing Certificate Authority with OpenSSL

    Top Posts & Pages

    • How to Block Internet Access with Group Policy (GPO)
      How to Block Internet Access with Group Policy (GPO)
    • How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
      How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
    • Kusto Geolocation IP Lookup
      Kusto Geolocation IP Lookup
    • Tinyproxy A Quick and Easy Proxy Server on Ubuntu
      Tinyproxy A Quick and Easy Proxy Server on Ubuntu
    • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
      Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
    • How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
      How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
    • How to Add Different Disclaimers using alterMIME and Postfix based on Domain
      How to Add Different Disclaimers using alterMIME and Postfix based on Domain
    • Blocking Countries on Nginx without the GeoIP Module
      Blocking Countries on Nginx without the GeoIP Module
    • How to Enable Squid Anonymous Stealth Mode
      How to Enable Squid Anonymous Stealth Mode
    • Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan
      Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan

    Tags

    apache2 azure azure log analytics blops business centos cheating cissp cloudflare cryptography dns game google gyp internet iphone ipsec isc linux mac marketing microsoft mw2 mx mysql nginx pfsense postfix proxy ps3 qualification radius revision security seo smtp socks squid ssh strongswan tinyproxy ubuntu windows 2012 wordpress xdecrypt.com
    Gyp the Cat dot Com

    Some rights retained Gyp the Cat Dot Com