|
|
@ -4,13 +4,14 @@ start on runlevel [2345] |
|
|
|
stop on runlevel [!2345] |
|
|
|
|
|
|
|
# CHOOSE ISP HERE. UNCOMMENT ONLY ONE LINE. |
|
|
|
env ISP=mns |
|
|
|
#env ISP=mns |
|
|
|
#env ISP=rt |
|
|
|
#env ISP=beeline |
|
|
|
#env ISP=domru |
|
|
|
env ISP=domru |
|
|
|
#env ISP=tiera |
|
|
|
|
|
|
|
# CHOSE NETWORK INTERFACE BEHIND NAT |
|
|
|
env SLAVE_ETH=eth1 |
|
|
|
env SLAVE_ETH=eth0 |
|
|
|
|
|
|
|
|
|
|
|
env QNUM=200 |
|
|
@ -33,6 +34,19 @@ pre-start script |
|
|
|
iptables -t mangle -I POSTROUTING -p tcp --dport 80 -m set --match-set zapret dst -j NFQUEUE --queue-num $QNUM --queue-bypass |
|
|
|
;; |
|
|
|
domru) |
|
|
|
adduser --disabled-login --no-create-home --system --quiet $TPWS_USER |
|
|
|
sysctl -w net.ipv4.conf.$SLAVE_ETH.route_localnet=1 |
|
|
|
iptables -t nat -C PREROUTING -p tcp --dport 80 -i $SLAVE_ETH -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || |
|
|
|
iptables -t nat -I PREROUTING -p tcp --dport 80 -i $SLAVE_ETH -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|
iptables -t nat -C OUTPUT -p tcp --dport 80 -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || |
|
|
|
iptables -t nat -I OUTPUT -p tcp --dport 80 -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|
# BLOCK SPOOFED DNS FROM DOMRU |
|
|
|
iptables -t raw -C PREROUTING -p udp --sport 53 -m string --hex-string "|5cfff164|" --algo bm -j DROP --from 40 --to 300 || |
|
|
|
iptables -t raw -I PREROUTING -p udp --sport 53 -m string --hex-string "|5cfff164|" --algo bm -j DROP --from 40 --to 300 |
|
|
|
iptables -t raw -C PREROUTING -p udp --sport 53 -m string --hex-string "|2a022698a00000000000000000000064|" --algo bm -j DROP --from 40 --to 300 || |
|
|
|
iptables -t raw -I PREROUTING -p udp --sport 53 -m string --hex-string "|2a022698a00000000000000000000064|" --algo bm -j DROP --from 40 --to 300 |
|
|
|
;; |
|
|
|
tiera) |
|
|
|
adduser --disabled-login --no-create-home --system --quiet $TPWS_USER |
|
|
|
sysctl -w net.ipv4.conf.$SLAVE_ETH.route_localnet=1 |
|
|
|
iptables -t nat -C PREROUTING -p tcp --dport 80 -i $SLAVE_ETH -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || |
|
|
@ -61,8 +75,13 @@ script |
|
|
|
NFEXE=$TPWS |
|
|
|
NFARG="--port=$TPPORT --hostcase --split-http-req=host --user=$TPWS_USER --bind-addr=127.0.0.1" |
|
|
|
;; |
|
|
|
tiera) |
|
|
|
NFEXE=$TPWS |
|
|
|
NFARG="--port=$TPPORT --split-http-req=host --user=$TPWS_USER --bind-addr=127.0.0.1" |
|
|
|
;; |
|
|
|
esac |
|
|
|
$NFEXE $NFARG |
|
|
|
[ -n "$NFEXE" ] && $NFEXE $NFARG |
|
|
|
end script |
|
|
|
|
|
|
|
pre-stop script |
|
|
@ -74,6 +93,13 @@ pre-stop script |
|
|
|
iptables -t mangle -D POSTROUTING -p tcp --dport 80 -m set --match-set zapret dst -j NFQUEUE --queue-num $QNUM --queue-bypass |
|
|
|
;; |
|
|
|
domru) |
|
|
|
sysctl -w net.ipv4.conf.$SLAVE_ETH.route_localnet=0 |
|
|
|
iptables -t nat -D PREROUTING -p tcp --dport 80 -i $SLAVE_ETH -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|
iptables -t nat -D OUTPUT -p tcp --dport 80 -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|
iptables -t raw -D PREROUTING -p udp --sport 53 -m string --hex-string "|5cfff164|" --algo bm -j DROP --from 40 --to 300 |
|
|
|
iptables -t raw -D PREROUTING -p udp --sport 53 -m string --hex-string "|2a022698a00000000000000000000064|" --algo bm -j DROP --from 40 --to 300 |
|
|
|
;; |
|
|
|
tiera) |
|
|
|
sysctl -w net.ipv4.conf.$SLAVE_ETH.route_localnet=0 |
|
|
|
iptables -t nat -D PREROUTING -p tcp --dport 80 -i $SLAVE_ETH -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|
iptables -t nat -D OUTPUT -p tcp --dport 80 -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|
|
|