Created
September 29, 2016 20:30
-
-
Save elico/e0faadf0cc63942c5aaade808a87deef to your computer and use it in GitHub Desktop.
iptables specific domains intercept bypass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
iptables -t nat -L PREROUTING |grep bypasspool | |
if [ "$?" -ne "0" ];then | |
iptables -t nat -I PREROUTING -m set --match-set bypasspool dst,src -j ACCEPT | |
fi | |
ipset create bypasspool hash:ip | |
while read item; do | |
echo $item | |
host -4 $item |grep "has address"|awk '{print $4}' |xargs -l1 ipset add bypasspool | |
done < domains-to-bypass.txt | |
set +x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dyn.web.whatsapp.com | |
www.youtube.com | |
www.microsoft.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment