Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ### Custom user script
- ### Called after internal iptables reconfig (firewall update)
- # ICMP filter rules - для модема можно убрать
- # iptables -t raw -N icmpcheck
- # iptables -t raw -I icmpcheck -j DROP
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 12/0 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 4/0 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 3/4 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 0 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 11/0 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 3/0 -j RETURN
- # iptables -t raw -I icmpcheck -p icmp -m icmp --icmp-type 3/1 -j RETURN
- # iptables -t raw -I PREROUTING ! -i br0 -p icmp -j icmpcheck
- # DNS redirect to router
- iptables -t nat -I PREROUTING -i br0 -p udp --dport 53 -j DNAT --to $(nvram get lan_ipaddr)
- # по TCP обычно никто на запрашивает DNS
- # iptables -t nat -I PREROUTING -i br0 -p tcp --dport 53 -j DNAT --to $(nvram get lan_ipaddr)
- # интересная и полезная строчка для модема
- # iptables -I FORWARD 2 ! -o br0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1280
- # iptables -t mangle -I POSTROUTING -s 192.168.5.0/24 -o weth0 -j TTL --ttl-set 65
- iptables -t nat -D PREROUTING 2
- iptables -D INPUT 7
- sleep 20
- URLS=" \
- http://adaway.org/hosts.txt \
- http://winhelp2002.mvps.org/hosts.txt \
- http://mirror.cedia.org.ec/malwaredomains/domains.hosts \
- https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext \
- https://www.malwaredomainlist.com/hostslist/hosts.txt \
- https://zerodot1.gitlab.io/CoinBlockerLists/hosts \
- /"
- wget --user-agent="Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0" -T40 -q -O- $URLS | grep -v "^#" | cut -d "#" -f 1 | sed 's/127\.0\.0\.1/0\.0\.0\.0/' | grep "^0.0.0.0" | sed 's/ */ /g' | sed 's/\t/ /g' |sed 's/\r//' | cut -d " " -f 1,2 | tr A-Z a-z | sort | uniq > /tmp/hosts
- sed -i '/0.0.0.0 localhost/d' /tmp/hosts
- sed -i '/0.0.0.0 localhost.localdomain/d' /tmp/hosts
- sed -i '/0.0.0.0 www.booking.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.c.booking.com/d' /tmp/hosts
- sed -i '/0.0.0.0 s-ec.bstatic.com/d' /tmp/hosts
- sed -i '/0.0.0.0 t-ec.bstatic.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cs715.wac.edgecastcdn.net/d' /tmp/hosts
- sed -i '/0.0.0.0 cs716.wac.edgecastcdn.net/d' /tmp/hosts
- sed -i '/0.0.0.0 tags.tiqcdn.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ad.admitad.com/d' /tmp/hosts
- sed -i '/0.0.0.0 api.cc.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 api.mcr.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 api.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 avatar.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 b.config.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 client-s.gateway.messenger.live.com/d' /tmp/hosts
- sed -i '/0.0.0.0 contacts.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 dev.microsofttranslator.com/d' /tmp/hosts
- sed -i '/0.0.0.0 diagnostics.support.microsoft.akadns.net/d' /tmp/hosts
- sed -i '/0.0.0.0 diagnostics.support.microsoft.com/d' /tmp/hosts
- sed -i '/0.0.0.0 edge.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 m.hotmail.com/d' /tmp/hosts
- sed -i '/0.0.0.0 mobile.pipe.aria.microsoft.com/d' /tmp/hosts
- sed -i '/0.0.0.0 msftncsi.com/d' /tmp/hosts
- sed -i '/0.0.0.0 msg.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 next-services.apps.microsoft.com/d' /tmp/hosts
- sed -i '/0.0.0.0 nexus.officeapps.live.com/d' /tmp/hosts
- sed -i '/0.0.0.0 profile.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 s.gateway.messenger.live.com/d' /tmp/hosts
- sed -i '/0.0.0.0 skype.net/d' /tmp/hosts
- sed -i '/0.0.0.0 ui.skype.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.msftncsi.com/d' /tmp/hosts
- sed -i '/0.0.0.0 stat.online.sberbank.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 s.click.aliexpress.com/d' /tmp/hosts
- sed -i '/0.0.0.0 star-mini.c10r.facebook.com/d' /tmp/hosts
- sed -i '/0.0.0.0 connect.facebook.net/d' /tmp/hosts
- sed -i '/0.0.0.0 graph.facebook.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cdn.siftscience.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ct.pinterest.com/d' /tmp/hosts
- sed -i '/0.0.0.0 api.pinterest.com/d' /tmp/hosts
- sed -i '/0.0.0.0 log.pinterest.com/d' /tmp/hosts
- sed -i '/0.0.0.0 widgets.pinterest.com/d' /tmp/hosts
- sed -i '/0.0.0.0 clck.yandex.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 mc.yandex.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 cdn.yandex.net/d' /tmp/hosts
- sed -i '/0.0.0.0 yandex.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 money.yandex.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 yastatic.net/d' /tmp/hosts
- sed -i '/0.0.0.0 analytics.mobile.yandex.net/d' /tmp/hosts
- sed -i '/0.0.0.0 informer.yandex.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 r.mail.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 c.fa.jd.com/d' /tmp/hosts
- sed -i '/0.0.0.0 whale.jd.com/d' /tmp/hosts
- sed -i '/0.0.0.0 saturn.jd.com/d' /tmp/hosts
- sed -i '/0.0.0.0 static.360buyimg.com/d' /tmp/hosts
- sed -i '/0.0.0.0 static.criteo.net/d' /tmp/hosts
- sed -i '/0.0.0.0 s.go-mpulse.net/d' /tmp/hosts
- sed -i '/0.0.0.0 ciuvo.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gia.jd.com/d' /tmp/hosts
- sed -i '/0.0.0.0 t.paypal.com/d' /tmp/hosts
- sed -i '/0.0.0.0 b.stats.paypal.com/d' /tmp/hosts
- sed -i '/0.0.0.0 l.deals.ebay.com/d' /tmp/hosts
- sed -i '/0.0.0.0 stats.ebay.com/d' /tmp/hosts
- sed -i '/0.0.0.0 rover.ebay.com/d' /tmp/hosts
- sed -i '/0.0.0.0 us1111.alicdn.com.edgekey.net/d' /tmp/hosts
- sed -i '/0.0.0.0 gj.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gm.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gm.gds.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ws.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gj.gds.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ynuf.alipay.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ynuf.aliapp.com/d' /tmp/hosts
- sed -i '/0.0.0.0 log.gds.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 perf.gds.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 c.go-mpulse.net/d' /tmp/hosts
- sed -i '/0.0.0.0 oneid.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gm.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 log.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 perf.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ynuf.mmstat.com/d' /tmp/hosts
- sed -i '/0.0.0.0 dmtracking2.alibaba.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cmap.alibaba.com/d' /tmp/hosts
- sed -i '/0.0.0.0 us.ynuf.aliapp.org/d' /tmp/hosts
- sed -i '/0.0.0.0 nocn-ru-aebridge.aliexpress.com/d' /tmp/hosts
- sed -i '/0.0.0.0 nocn-ru-aebridge.aliexpress.com.gds.alibabadns.com/d' /tmp/hosts
- sed -i '/0.0.0.0 sa-aebridge.aliexpress.com/d' /tmp/hosts
- sed -i '/0.0.0.0 sa-aebridge.aliexpress.com.gds.alibabadns.com/d' /tmp/hosts
- sed -i '/0.0.0.0 e1429.x.akamaiedge.net/d' /tmp/hosts
- sed -i '/0.0.0.0 ocsp.comodoca.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ocsp.comodoca.com.edgesuite.net/d' /tmp/hosts
- sed -i '/0.0.0.0 a652.dscb.akamai.net/d' /tmp/hosts
- sed -i '/0.0.0.0 report-uri.cloudflare.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.ojrq.net/d' /tmp/hosts
- sed -i '/0.0.0.0 letyshops.com/d' /tmp/hosts
- sed -i '/0.0.0.0 pochta.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 www.pochta.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 youtube.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.youtube.com/d' /tmp/hosts
- sed -i '/0.0.0.0 youtube-ui.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.google-analytics.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www-google-analytics.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ytstatic.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 google-analytics.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ssl.google-analytics.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ssl-google-analytics.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 analytics.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 id.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 connectivitycheck.gstatic.com/d' /tmp/hosts
- sed -i '/0.0.0.0 accounts.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 myaccount.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 hangouts.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www3.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 plus.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 fonts.gstatic.com/d' /tmp/hosts
- sed -i '/0.0.0.0 fonts.googleapis.com/d' /tmp/hosts
- sed -i '/0.0.0.0 gstaticadssl.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 googleadapis.l.google.com/d' /tmp/hosts
- sed -i '/0.0.0.0 googlehosted.l.googleusercontent.com/d' /tmp/hosts
- sed -i '/0.0.0.0 photos-ugc.l.googleusercontent.com/d' /tmp/hosts
- sed -i '/0.0.0.0 redirector.gvt1.com/d' /tmp/hosts
- sed -i '/0.0.0.0 platform-lookaside.fbsbx.com/d' /tmp/hosts
- sed -i '/0.0.0.0 dualstack.com.imgix.map.fastly.net/d' /tmp/hosts
- sed -i '/0.0.0.0 massdrop-s3.imgix.net/d' /tmp/hosts
- sed -i '/0.0.0.0 badges.instagram.com/d' /tmp/hosts
- sed -i '/0.0.0.0 graph.instagram.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ocsp.apple.com/d' /tmp/hosts
- sed -i '/0.0.0.0 world-gen.g.aaplimg.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.lightinthebox.com/d' /tmp/hosts
- sed -i '/0.0.0.0 c.media-amazon.com/d' /tmp/hosts
- sed -i '/0.0.0.0 m.media-amazon.com/d' /tmp/hosts
- sed -i '/0.0.0.0 autolinkmaker.itunes.apple.com/d' /tmp/hosts
- sed -i '/0.0.0.0 littlebuddy.apple.com/d' /tmp/hosts
- sed -i '/0.0.0.0 images-na.ssl-images-amazon.com/d' /tmp/hosts
- sed -i '/0.0.0.0 a.lmcdn.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 d.gcdn.co/d' /tmp/hosts
- sed -i '/0.0.0.0 iam.gcdn.co/d' /tmp/hosts
- sed -i '/0.0.0.0 js-agent.newrelic.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cdn.livechatinc.com/d' /tmp/hosts
- sed -i '/0.0.0.0 lu.api.mega.co.nz/d' /tmp/hosts
- sed -i '/0.0.0.0 www.ant.com/d' /tmp/hosts
- sed -i '/0.0.0.0 fresnel.vimeocdn.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ocsp.digicert.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cs9.wac.phicdn.net/d' /tmp/hosts
- sed -i '/0.0.0.0 secure.livechatinc.com/d' /tmp/hosts
- sed -i '/0.0.0.0 bitpay.com/d' /tmp/hosts
- sed -i '/0.0.0.0 cds.j3z9t3p6.hwcdn.net/d' /tmp/hosts
- sed -i '/0.0.0.0 app.getresponse.com/d' /tmp/hosts
- sed -i '/0.0.0.0 kssm.kuaipandata.com/d' /tmp/hosts
- sed -i '/0.0.0.0 www.turkishạirlines.com/d' /tmp/hosts
- sed -i '/0.0.0.0 ɢoogle.com/d' /tmp/hosts
- sed -i '/0.0.0.0 secret.ɢoogle.com/d' /tmp/hosts
- sed -i '/0.0.0.0 myètherwället.com/d' /tmp/hosts
- sed -i '/0.0.0.0 mÿethèrwallét.com/d' /tmp/hosts
- sed -i '/0.0.0.0 a.radikal.ru/d' /tmp/hosts
- sed -i '/0.0.0.0 cstatic.weborama.fr/d' /tmp/hosts
- sed -i '/0.0.0.0 displaycatalog.mp.microsoft.com/d' /tmp/hosts
- sed -i '/0.0.0.0 mediation.adnxs.com/d' /tmp/hosts
- sed -i '/0.0.0.0 pagead2.googlesyndication.com/d' /tmp/hosts
- killall -SIGHUP dnsmasq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement