Changes

Jump to: navigation, search

BlackBlockGoogle

1,906 bytes added, 13:40, 12 September 2018
Blocking using hosts file
__TOC__
A == Methods ==  There are different methods for blocking google..  === Browser extensions ======= Using ublock ====Install the extension ublock origin [https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/] on your firefox installation.  1. Open ublock dashboard 2. Select the tab "My filters" 3. Past this list [https://gist.github.com/nipos/e572a37c1939bf5bcdf04a38ef229152] hosts to your ublock configuration.  === Blocking using hosts file ===You can edit your hosts file. An axample of tools[[hosts]] file, it contains a whole list of all google, twitter, facebook, please check their descriptions insideetc... domainsDoing 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 ===
https://addons.mozilla.org/en-US/firefox/addon/librejs/
https==== Using OpenWRT / iptables ====This is a script that would run on OpenWRT://addons.mozilla.org/en-US/firefox/addon/trackmenot/
https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/With some modification (maybe) to the output processing of the ''nslookup'' command, or use ''host'', it'll work on your local *NIX box
httpsYou would do, for example:* root@OpenWrt:~# .//wwwiptsetup.sh google.com gl 1* That would create for you add_gl.sh and del_gl.sh in the current working directory.eff* Then run .org/privacybadgeradd_gl.sh and all packets destined to google will be marked with MARK 1* So add a rule something like:
https://prism<pre>iptables -break.org/en/N rejectiptables -A OUTPUT -m mark --mark 1 -j rejectiptables -A reject -p tcp -j REJECT --reject-with tcp-resetiptables -A reject -j REJECT --reject-with icmp-port-unreachable
-------</pre>
IP=nslookup $1 | grep * You also need to feed traffic into the m_ip chain in your mangle table.* How you might wish to do this is left as an exercise to the reader ;-E ) (don'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1t just blindly "follow",3}\.[0-9]{1,3}' | tail -n1 | cut -d\ -f3Read up!!)
AS=wget -q -O - httpBut for example, you could do something as simple as this, seeing as how you are running on a router://ipinfo.io/$IP/org | cut -f1 -d \ | sed -e 's/AS//'
NETWORKS=wget -O - http://stat.ripe.net/data/announced-prefixes/data.yaml?resource=$AS|grep prefix\:|grep -v \:\:|awk '{print $3}'<pre>
for i in $NETWORKS; do echo "iptables -t mangle -A ggl_ip PREROUTING -d $i s lan-ip.of.user-that-not-want.google -j ggl_do"; donem_ip
</pre>
------
<pre>#!/bin/sh### iptsetup.sh domain.com name fwmark##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
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 "iptables -t mangle -N $2_ip" >> add_$2.sh
echo "iptables -t mangle -X $2_ip" >> del_$2.sh
echo "iptables -t mangle -X $2_do" >> del_$2.sh
root@OpenWrt</pre>  == Other tools ===== Useful addons for a private, free & open source internet === 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/] Made your browser click and load random ads to obfuscate monitoring and tracking with adnauseam [https:/usr/sbin#adnauseam.io/]13Trackmenot [https:03so you would do "iptsetup//addons.sh googlemozilla.com gl 1"org/en-US/firefox/addon/trackmenot/]13Decentraleyes [https:04that would create for you add_gl//addons.mozilla.org/en-US/firefox/addon/decentraleyes/]   === Prismbreak, a list of tools avoid massive surveillance ===A list of tools, please check their descriptions inside...sh and del_glhttps://prism-break.shorg/en/
34
edits

Navigation menu