How to stop Pop-Up Ads on Ufone Internet connections

Ufone internet connection users are being bombarded with pop-up ads. In this post I explain how to stop said ads.

How the pop-up ads are being injected

Ufone is injecting the ads by acting as an MITM and redirecting requests for Google Analytics javascript code to their own pop-up ads script. Since Google Analytics is widely used on websites around the world simply replacing the javascript file with their own pop-up ad script allows them to inject pop-up ads in lots and lots of webpages. This only works for plain HTTP sites. Sites accessed via HTTPS are unaffected because they can’t MITM those encrypted connections.

How to block them

So this guide is for Firefox but the basic idea is the same in Chrome. Install AdBlock Plus extension and bring up the filter preferences window with Ctrl + Shift +F. Click on the Custom Filters tab and add your own group if there is no existing one there. Right click on the group and choose show/hide filters. Add a filter with the following rule:

||google-analytics.com^
Custom AdBlock Plus filter

Custom AdBlock Plus filter

That’s all you have to do. Now requests for Google Analytics tracking code will be blocked. Not only will the pop-up ads go away but your privacy will be enhanced as well.

8 thoughts on “How to stop Pop-Up Ads on Ufone Internet connections

  1. Could you elaborate as to how you figured out that PTCL is redirecting google analytics? Just want to learn.

    Even if PTCL is somehow exploiting google-analytics, it does not seem fair to punish google-analytics for PTCL’s crime. Google Analytics is a good thing, it allows webmasters to track and improve their websites to serve better content for YOU.

    It is a better solution to block scripts from PTCL’s server that serves the javascript for the ad ‘182.190.0.41’ or block images from ‘my.ptcl.net.pk’ that appear in an ad, rather than blocking all google analytics.

    I have written a post about it on my blog here: blog.hassannadeem.com/2015/12/ptcl-injecting-advertisements.html

    • I know for certain Ufone MITM it because I loaded the google analytics javascript file using a Ufone connection and it was a popup ads javascript file not the google analytics code. I’m guessing PTCL does the same thing because it is the parent company of Ufone.

      “it does not seem fair to punish google-analytics for PTCL’s crime. Google Analytics is a good thing, it allows webmasters to track and improve their websites to serve better content for YOU.”

      I use google analytics too but my site is SSL only so no one can MITM my visitors. Google analytics is useful for webmasters but it is bad for users’ privacy. Let’s not pretend we are doing our visitors any favours by tracking their movements. And if a user has a bad ISP that is intercepting and changing google analytics code then it makes sense to block it.

      “It is a better solution to block scripts from PTCL’s server that serves the javascript for the ad ‘182.190.0.41’ or block images from ‘my.ptcl.net.pk’ that appear in an ad, rather than blocking all google analytics.”

      Ok I think I’m going to remove “PTCL” from this article because I’m not sure what’s going on with them. I only know about Ufone for sure. Thank you for your feedback.

  2. ufone is doing this for sure. i tried publishing the same findings to propakistani and they refused to do so. contacted ufone and they told me to change browser. what a waste of time with both these jerks

  3. I also contacted with propakistani with proofs. I thought they are educated and trained in this field but they are loosers also. I sent the proof videos and screen to aamir showing adaware on propakistani.pk and other websites. They promised to resolve the matter but no use. I am now shifted to telenor as Ufone is the worst 3G internet provider in Pakistan. They are so expensive and bombared there users with spyware and adaware ads. On mobile phones its even worse you will see constant ads from malware companies like your phone have a virus etc. This problem does not exist if I switch the sim to telenor or other networks.

  4. Extract from Ufone wikipedia page.
    https://en.wikipedia.org/wiki/Ufone

    Scandal

    Ufone internet servers hijack popular google analytics scripts analytics.js and ga.js to inject adware and malware scripts on users computers.[7] Most of the users complaint to Ufone Facebook page and on social media however Ufone is unable to resolve this issue. Users are facing this problem since May, 2015, and most of the users stoped using Ufone 3G service.[8] [9][10]

  5. Marvelous! Wanna Gift Your loved one a special gift this valentine?? Stay connected for Special Valentine Gift Boxes.

  6. Great! Growth Xperts can help your business to reach thousands of potential customers on the internet as your digital marketing agency in Lahore.

Leave a Reply

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