Skip to content

Instantly share code, notes, and snippets.

@elico
Last active January 10, 2017 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elico/a54c2c8f8e1a2407b42210896b960f4b to your computer and use it in GitHub Desktop.
Save elico/a54c2c8f8e1a2407b42210896b960f4b to your computer and use it in GitHub Desktop.
bypass squid interception for skype
#!/usr/bin/env bash
set -x
if [ "$1" == "tproxy" ];then
export TABLE=mangle
export TARGET=DIVERT
iptables -t $TABLE -L DIVERT
if [ "$?" -eq "0"]; then
echo "DIVERT EXISTS"
else
iptables -t mangle -N DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
fi
else
export TABLE=nat
export TARGET=ACCEPT
fi
iptables -t $TABLE -L PREROUTING |grep bypascidrspool
if [ "$?" -ne "0" ];then
iptables -t $TABLE -I PREROUTING -m set --match-set bypascidrspool dst,src -j $TARGET
fi
ipset create bypascidrspool hash:net
while read item; do
echo $item
ipset add bypascidrspool $item
done < cidr-to-bypass.txt
set +x
157.56.135.64/26
157.56.185.0/26
157.56.52.0/26
157.56.53.128/25
157.56.198.0/26
157.60.0.0/16
157.54.0.0/15
13.107.3.128/32
13.107.3.129/32
111.221.64.0/18
91.190.216.0/21
91.190.218.0/24
40.126.129.109/32
65.55.223.0/26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment