Linux中利用 iptables 封垃圾邮件(SPAM)和BT(磁力链接)、PT
一些人做Shadowsocks账号分享害怕用户发垃圾邮件(SPAM)和BT、PT导致VPS被IDC封杀。
再加上最近写了两篇 VPS下载BT(磁力链接)的教程,那就正好来一个 能够封垃圾邮件(SPAM)和BT(磁力链接)、PT的脚本(转载)。
一键脚本
1 |
wget -4qO- www.xuanlove.download/sh/Get_Out_Spam.sh|bash |
很简单,只要在VPS上面运行这个命令,就会自动添加iptables规则。
注意:既然是iptables防火墙规则,那VPS肯定是要安装iptables的,不过一般都安装的有,除了坑爹的CentOS7需要关闭自带的防火墙安装iptables。
注意:本脚本非常的暴力,直接封杀了所有的邮件端口,同时过滤任何包含BT(磁力链接)字眼的网站和链接!
脚本执行后的提示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
[root@li760-160 ~]# wget -4qO- onekey.sh/Get_Out_Spam|bash Chain OUTPUT (policy ACCEPT 1 packets, 104 bytes) num pkts bytes target prot opt in out source destination 1 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 25,26,465 state NEW,ESTABLISHED reject-with icmp-port-unreachable 2 0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 25,26,465 3 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 109,110,995 state NEW,ESTABLISHED reject-with icmp-port-unreachable 4 0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 109,110,995 5 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 143,218,220,993 state NEW,ESTABLISHED reject-with icmp-port-unreachable 6 0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 143,218,220,993 7 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 24,50,57,105,106,158,209,587,1109,24554,60177,60179 state NEW,ESTABLISHED reject-with icmp-port-unreachable 8 0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 24,50,57,105,106,158,209,587,1109,24554,60177,60179 Chain OUTPUT (policy ACCEPT 5 packets, 2008 bytes) num pkts bytes target prot opt in out source destination 1 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "Subject" ALGO name bm TO 65535 2 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "HELO" ALGO name bm TO 65535 3 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "SMTP" ALGO name bm TO 65535 4 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "torrent" ALGO name bm TO 65535 5 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match ".torrent" ALGO name bm TO 65535 6 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "peer_id=" ALGO name bm TO 65535 7 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "announce" ALGO name bm TO 65535 8 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "info_hash" ALGO name bm TO 65535 9 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "get_peers" ALGO name bm TO 65535 10 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "find_node" ALGO name bm TO 65535 11 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "BitTorrent" ALGO name bm TO 65535 12 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "announce_peer" ALGO name bm TO 65535 13 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "BitTorrent" ALGO name bm TO 65535 14 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "protocol" ALGO name bm TO 65535 15 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "announce.php?passkey=" ALGO name bm TO 65535 Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination 1 0 0 REJECT tcp * * ::/0 ::/0 multiport dports 25,26,465 state NEW,ESTABLISHED reject-with tcp-reset 2 0 0 DROP udp * * ::/0 ::/0 multiport dports 25,26,465 3 0 0 REJECT tcp * * ::/0 ::/0 multiport dports 109,110,995 state NEW,ESTABLISHED reject-with tcp-reset 4 0 0 DROP udp * * ::/0 ::/0 multiport dports 109,110,995 5 0 0 REJECT tcp * * ::/0 ::/0 multiport dports 143,218,220,993 state NEW,ESTABLISHED reject-with tcp-reset 6 0 0 DROP udp * * ::/0 ::/0 multiport dports 143,218,220,993 7 0 0 REJECT tcp * * ::/0 ::/0 multiport dports 24,50,57,105,106,158,209,587,1109,24554,60177,60179 state NEW,ESTABLISHED reject-with tcp-reset 8 0 0 DROP udp * * ::/0 ::/0 multiport dports 24,50,57,105,106,158,209,587,1109,24554,60177,60179 Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination 1 0 0 DROP all * * ::/0 ::/0 STRING match "Subject" ALGO name bm TO 65535 2 0 0 DROP all * * ::/0 ::/0 STRING match "HELO" ALGO name bm TO 65535 3 0 0 DROP all * * ::/0 ::/0 STRING match "SMTP" ALGO name bm TO 65535 4 0 0 DROP all * * ::/0 ::/0 STRING match "torrent" ALGO name bm TO 65535 5 0 0 DROP all * * ::/0 ::/0 STRING match ".torrent" ALGO name bm TO 65535 6 0 0 DROP all * * ::/0 ::/0 STRING match "peer_id=" ALGO name bm TO 65535 7 0 0 DROP all * * ::/0 ::/0 STRING match "announce" ALGO name bm TO 65535 8 0 0 DROP all * * ::/0 ::/0 STRING match "info_hash" ALGO name bm TO 65535 9 0 0 DROP all * * ::/0 ::/0 STRING match "get_peers" ALGO name bm TO 65535 10 0 0 DROP all * * ::/0 ::/0 STRING match "find_node" ALGO name bm TO 65535 11 0 0 DROP all * * ::/0 ::/0 STRING match "BitTorrent" ALGO name bm TO 65535 12 0 0 DROP all * * ::/0 ::/0 STRING match "announce_peer" ALGO name bm TO 65535 13 0 0 DROP all * * ::/0 ::/0 STRING match "BitTorrent" ALGO name bm TO 65535 14 0 0 DROP all * * ::/0 ::/0 STRING match "protocol" ALGO name bm TO 65535 15 0 0 DROP all * * ::/0 ::/0 STRING match "announce.php?passkey=" ALGO name bm TO 65535 |
Toyo Sun
2017 年 1 月 19 日 22:32
转载请注明源链接:https://doub.io/wlzy-14/