Linux中利用 iptables 封垃圾邮件(SPAM)和BT(磁力链接)、PT

作者: Mr.Xuan 分类: 技术交流 发布时间: 2016-12-22 23:34 ė
Warning: Use of undefined constant the_views - assumed 'the_views' (this will throw an Error in a future version of PHP) in /www/users/HA292220/WEB/wp-content/themes/TangStyle-master/single.php on line 11
12,219 views
6 1条评论

一些人做Shadowsocks账号分享害怕用户发垃圾邮件(SPAM)和BT、PT导致VPS被IDC封杀。

再加上最近写了两篇 VPS下载BT(磁力链接)的教程,那就正好来一个 能够封垃圾邮件(SPAM)和BT(磁力链接)、PT的脚本(转载)。


一键脚本

wget -4qO- www.xuanlove.download/sh/Get_Out_Spam.sh|bash

 

很简单,只要在VPS上面运行这个命令,就会自动添加iptables规则。

注意:既然是iptables防火墙规则,那VPS肯定是要安装iptables的,不过一般都安装的有,除了坑爹的CentOS7需要关闭自带的防火墙安装iptables。

注意:本脚本非常的暴力,直接封杀了所有的邮件端口,同时过滤任何包含BT(磁力链接)字眼的网站和链接!

脚本执行后的提示:

[[email protected] ~]# 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

 

本文出自Mr.Xuan,转载时请注明出处及相应链接。

本文永久链接: https://xuanlove.cn/jishujiaoliu/1799.html

一条评论

  1. Toyo Sun 2017 年 1 月 19 日 22:32 回复

    转载请注明源链接:https://doub.io/wlzy-14/

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

#9 #8 #73 #72 #71 #70 #7 #69 #68 #67 #66 #65 #64 #63 #62 #61 #60 #6 #59 #58 #57 #56 #55 #54 #53 #52 #51 #50 #5 #49 #48 #47 #46 #45 #44 #43 #42 #41 #40 #4 #39 #38 #37 #36 #35 #34 #33 #32 #31 #30 #3 #29 #28 #27 #26 #25 #24 #23 #22 #21 #20 #2 #19 #18 #17 #16 #15 #14 #13 #12 #11 #10 #1

Ɣ回顶部