Block anything from certain IP, injected from ISP when tethering from phone

Block anything from certain IP, injected from ISP when tethering from phone

My ISP injects JavaScript files - most notabily bmi.js - and certain other unwanted additions to web requests when tethering from my phone.

It would be OK if the JavaScript was useful, but it is programmed terribly - and as a JavaScript developer, this really annoys me when the injected scripts break my own work! It looks like it annoys some other people too...

I'd like to block any activity to the IP address 1.2.3.*. I've noticed 1.2.3.4 and 1.2.3.8 in use, or if anyone can give me any better solutions, I'd be happy to try.

Thanks!

EDIT

I have to agree with George Edison with That sounds like a terrible ISP. The plot thickens ... while playing around with iptables and the like, I noticed that as soon as I blocked 1.2.3.4, the script was simply injected from another domain. I blocked that, it moved on to another.

In my web browser, I can access the script from ANY DOMAIN! What the heck is the ISP doing here? For example, these URIs all respond with the script:

  • http://1.2.3.4/bmi-int-js/bmi.js
  • http://1.2.3.5/bmi-int-js/bmi.js
  • http://4.3.2.1/bmi-int-js/bmi.js

and nauseatingly:

  • http://ScriptInjection-WhyDoYouExist.com/bmi-int-js/bmi.js
  • http://google.com/bmi-int-js/bmi.js
  • http://askubuntu.com/bmi-int-js/bmi.js

face palm

答え1

In Firefox NoScript add-on open Options > Advanced > ABE, USER ruleset, then add:

Site */bmi.js
Deny INCLUSION(SCRIPT)

Of course you can also use regular expressions, and combine multiple URL patterns in the same rule.

You can find more info here: http://noscript.net/abe.

答え2

The page you linked to in your question contains the following comment:

I have found a solution! :D
On your iPhone go to Settings > General > Network > Cellular Data Network
Then Under “Cellular Data” change the APN to “mobile.o2.co.uk”
And change the Username to “bypass” (no quotes in both cases)
Then save the settings and restart your iPhone and the bmi.js file should no longer show up while tethering. Leaving you with full resolution browsing! The iPhone browser also appears a lot better since it was also affected by the js file.

答え3

aim your web browser @ 1.2.3.50 and you'll be able to turn off image compression which will remove that annoying javascript injection (worked on t-mobiles network anyway)

if that does not work, use adblock for firefox/chrome to blacklist the bmi.js file

関連情報