Changes

Jump to: navigation, search

BlackBlockGoogle

1,358 bytes added, 16:48, 23 February 2020
add ipsets script
== Methods ==
 
There are different methods for blocking google..
=== Blocking using hosts file ===
You can edit your hosts file like the one showed [https://gist.github.com/Gaubee/6546308/ here].
An axample of [[hosts]] file, it contains a whole list of all google, twitter, facebook, etc... domains
Doing this all listed domains will be redirected to that ip address. You can easily change the ip addresses whit your local host 127.0.0.1 or whatever you want :)
 
=== Blocking using a firewall ===
echo "iptables -t mangle -X $2_ip" >> del_$2.sh
echo "iptables -t mangle -X $2_do" >> del_$2.sh
 
</pre>
 
 
== Use ipsets instead of iptables ==
 
If you block AS with a large number of entries, you will notice a performance hit when using iptables.
 
ipsets are much more efficient. Here is a similar script for setting up corporate monster blocking using ipsets on OpenWRT.
 
<pre>
#!/bin/sh
 
IP=`nslookup $1 | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1 | cut -d\ -f3`
AS=`wget -q -O - http://ipinfo.io/$IP/org | cut -f1 -d \ | sed -e 's/AS//'`
 
echo '#!/bin/sh' > add_$2.sh
chmod 750 add_$2.sh
echo '#!/bin/sh' > del_$2.sh
chmod 750 del_$2.sh
NETWORKS=`wget -O - http://stat.ripe.net/data/announced-prefixes/data.yaml?resource=$AS|grep prefix\:|grep -v \:\:|awk '{print $3}'`
 
echo "ipset create $2_ip hash:net" >> add_$2.sh
echo "iptables -A forwarding_rule -m set --match-set $2_ip dst -j reject" >> add_$2.sh
 
for i in $NETWORKS; do echo "ipset add $2_ip $i" >> add_$2.sh; done
 
echo "ipset destroy $2_ip" >> del_$2.sh
</pre>
Privacy badge [https://www.eff.org/privacybadger/] is a very easy friendly and powerful tool for blocking trackers and ads.
Ensure your browser only runs opensource/readable javascript code with librejs [https://addons.mozilla.org/en-US/firefox/addon/librejs/]<br>The link posted here is broken, but there is an Alpha version: [https://addons.mozilla.org/en-US/firefox/addon/gnu-librejs-7-0-alpha/]
Made your browser click and load random ads to obfuscate monitoring and tracking with adnauseam [https://adnauseam.io/]
Decentraleyes [https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/]
 
Cloud Firewall [https://addons.mozilla.org/en-US/firefox/addon/cloud-firewall/]<br>
This Add On is currently unavailable from mozilla, see a recent toot from the maintainer: [https://social.avareborn.de/@nipos/103696273631245687]
13
edits

Navigation menu