欢迎您, 论坛游客 ( 登录 | 注册 )

 
Reply to this topic Start new topic
> mldonkey屏蔽leecher
评分 5 V
moh
[ 楼主 ]  发表 2009-10-29 22:26:13
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 11

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2008-11-24
编号: 6,323



名字起的有点大(IMG:style_emoticons/default/smile.gif)
最近搞好了TrafficShapping,这样mldonkey就可以全放开上传了,但是吸血骡,尤其是迅雷来吸的太多了.利用周末Google了一下,可以做到屏蔽部分吸血骡.但是有如下几个缺点:

1. 没有DLP这么全面,主要是屏蔽国内的迅雷,快车之类的.
2. 偶有漏网的.
3. 有误伤.
4. 可能会占用一部分资源,尤其是刚启动fail2ban时

所以完美主义者,骡道主义者就不要用了(IMG:style_emoticons/default/smile.gif) 期待你们开发出好的mldonkey可用的DLP:-)

下面是步骤,我用的是Gentoo系统,可能会与别的版本不太一样,但应该是大同小异.

1. 首先,要修改mldonkey的一个配置,用web控制,还是用Telnet敲命令,还是直接修改~/.mldonkey/download.ini都随便,命令是

set verbosity "mct"

完成后,去~/.mldonkey/mlnet.log看看,会发现有很多过去没有见过的log文件,mct的意思就是显示Client的Tag.当然还有很多的不同的选项可以改,具体可以看~/.mldonkey/download.ini里的解释.
2. 安装fail2ban,Gentoo就简单了,直接emerge就可以,其它的版本应该也不会太难.
3. 修改/etc/fail2ban/jail.conf,在末尾加上

[dlp-iptables]

enabled = true
filter = dlp
action = iptables-allports[name=dlp, protocol=tcp]
logpath = /home/xxxx/.mldonkey/mlnet.log
maxretry = 1

具体的logpath要换成自己的(IMG:style_emoticons/default/smile.gif)

4. 新建/etc/fail2ban/filter.d/dlp.conf,加入如下的内容

# Fail2Ban configuration file
#
# Author: Sparkplug
# http://sparkplug-moh.blogspot.com
#

[INCLUDES]

# Read common prefixes. If any customizations available -- read them from
# common.local
before = common.conf


[Definition]

_daemon = dlp

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}(IMG:style_emoticons/default/smile.gif) ?(?P[\w\-.^_]+)
# Values: TEXT
#
failregex = ip: <HOST>:.*(xthame|Flashget|VeryCD|QQDownload|FreeCD|dianlei|TUOTU|PPMule|eMuleBT|kaggo|Chinfo|21cn)
ip: <HOST>:.*\(version\)=\(60\) \(mod_version
ip: <HOST>:.*mod_version\)=\(.*(ery|easy)
ip: <HOST>:(80|65535)
<HOST>:.*(xthame|Flashget|VeryCD|QQDownload|FreeCD|dianlei|TUOTU|PPMule|eMuleBT|kaggo|Chinfo|21cn)
<HOST>:.*0.48a
<HOST>:.*mod_version.*(ery|easy)
<HOST>:(80|65535)
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
其中failregex里的红色部分是屏蔽了VeryCD的MOD,包括那个什么EasyMule,原因是它们违反了gpl协议,除了DLP不开源外,具体可以去Google:easymule amule;第一行里VeryCD的TAG,这样名字里VeryCD的Client也一样会屏蔽,如果不想屏蔽VC的MOD或者名字里加了VeryCD的 Client的话就不要加载这些了,直接去掉就可以.

这些只是屏掉了国内一些Client,有人能把DLP里的Username_Hard和Modstring_Hard整理出来做个完全的就更好了(IMG:style_emoticons/default/smile.gif)
另外,所有0.48a的emule版本都屏掉了,有误杀,阿弥陀佛,罪过罪过(IMG:style_emoticons/default/smile.gif)
5. 运行fail2ban,
/etc/init.d/fail2ban start
如果没有问题,
rc-update add fail2ban default

另外,也可以在mldonkey里输入
set verbosity "up"
再根据相应的调整/etc/filter.d/dlp.conf就可以吸这些吸血骡的血了,是不是太邪恶了:-?
Go to the top of the page
  User is offline Profile Card PM
链接: #1
yegle
[ 1楼 ]  发表 2009-10-29 22:28:17
+Quote Post


草塘结庐
**

组别: 初级会员
帖子: 148

精华帖数: 2
资源主题数: 0
精华资源数: 0
注册: 2008-11-24
编号: 6,645



专业!好东西!thx~


--------------------
出售高速OpenVPN帐号(AntiGFW,ipv6 enabled):
http://yegle.net/openvpn/
Go to the top of the page
  User is offline Profile Card PM
链接: #2
Feathia
[ 2楼 ]  发表 2009-10-29 22:29:53
+Quote Post


梦行者
*****

组别: 高级会员
帖子: 2,312

精华帖数: 69
资源主题数: 123
精华资源数: 64
注册: 2009-04-01
编号: 31,935



支持一下


--------------------
Happy birthday, my dear eMule!
--------------------------------------------
2002 5 13 —— 2010 5 13
Go to the top of the page
  User is offline Profile Card PM
链接: #3
moh
[ 3楼 ]  发表 2009-10-29 22:32:06
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 11

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2008-11-24
编号: 6,323



多谢两位,这个只用了几天,可能会有很多问题.在这里抛砖引玉,希望有高手可以做一个更好的Ban这些leecher的东东.
Go to the top of the page
  User is offline Profile Card PM
链接: #4
yegle
[ 4楼 ]  发表 2009-10-29 22:59:01
+Quote Post


草塘结庐
**

组别: 初级会员
帖子: 148

精华帖数: 2
资源主题数: 0
精华资源数: 0
注册: 2008-11-24
编号: 6,645



引用 (moh @ 2009-10-29 22:32:06) *
多谢两位,这个只用了几天,可能会有很多问题.在这里抛砖引玉,希望有高手可以做一个更好的Ban这些leecher的东东.

目前来说估计只能根据modstring来屏蔽了……


--------------------
出售高速OpenVPN帐号(AntiGFW,ipv6 enabled):
http://yegle.net/openvpn/
Go to the top of the page
  User is offline Profile Card PM
链接: #5
emerkur
[ 5楼 ]  发表 2009-10-30 14:17:21
+Quote Post


五湖信步
****

组别: 中级会员
帖子: 1,411

精华帖数: 0
资源主题数: 7
精华资源数: 0
注册: 2009-03-09
编号: 30,278



顶,希望高手越来越多!


--------------------
本人资源 不张贴 不发表 扔进共享 得之幸 不得之命
可怜的阉割'驴'用户对阉'驴'乱改昵称的抱怨

喜爱另人着迷的emule,不对任何公司感恩戴德。有幸与emule官方一起被"上海维西网络科技有限公司"某雇员骂为“电骡原教旨主义者”。
现在请求下载别人的资源我已经很少去关注进度了,往往有一天早上一看就会有意外的惊喜发现,也许一个一年飘红的资源竟然完成了,这也是一种心态吧,生活何尝不是如此。看着上传和等待队列栏里一个个来自不同国家的国旗在有序地排队才有一种天下大同的感觉,我想真正了解emule喜爱emule的朋友们都会有我一样的体会。加载ban vc 飘过~~~
Go to the top of the page
  User is offline Profile Card PM
链接: #6
fems
[ 6楼 ]  发表 2009-10-30 22:41:14
+Quote Post


草塘结庐
**

组别: 初级会员
帖子: 96

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2008-11-28
编号: 11,887



代码部分建议用添加代码文本来发,免得部分变成表情符


--------------------
Go to the top of the page
  User is offline Profile Card PM
链接: #7
睡在浴缸的人
[ 7楼 ]  发表 2009-11-03 14:24:06
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 3

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2009-09-27
编号: 39,448



mct : debug emule clients tags

mldonkey不能屏蔽吸血是比较麻烦,官方的态度是:你要功能自己写。

楼主提供了一种思路,挺好,感谢
Go to the top of the page
  User is offline Profile Card PM
链接: #8
3828669
[ 8楼 ]  发表 2009-11-03 16:30:12
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 27

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2009-01-18
编号: 21,946



好 我也是用mldonkey 一天到晚都开着 便宜了那些吸血的家伙!!!
Go to the top of the page
  User is offline Profile Card PM
链接: #9
ubuntuuser
[ 9楼 ]  发表 2009-11-19 18:43:12
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 38

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2009-10-10
编号: 40,053



引用 (睡在浴缸的人 @ 2009-11-03 14:24:06) *
mct : debug emule clients tags

mldonkey不能屏蔽吸血是比较麻烦,官方的态度是:你要功能自己写。

现在的开发以bugfix为主,spiralvoice自己说他“have no plan to dig in kad,and will stay that ”.再说ocaml毕竟是种冷僻的语言,指望更多的加入开发团队很难。
现在的开发主要就是spiralvoice,fatbar主要负责mips设备和nas机的移植。
Go to the top of the page
  User is offline Profile Card PM
链接: #10
A-KANG
[ 10楼 ]  发表 2009-12-10 16:48:43
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 3

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2009-06-16
编号: 35,217



太好了,做个记号,慢慢看。
Go to the top of the page
  User is offline Profile Card PM
链接: #11
玉鼎真人 · 隆美尔
[ 11楼 ]  发表 2009-12-10 19:18:38
+Quote Post


轻舟飘渺
*****

组别: 高级会员
帖子: 1,634

精华帖数: 4
资源主题数: 6
精华资源数: 3
注册: 2009-02-03
来自: 魔都
编号: 25,421



膜拜一下……自从amule有了dlp,一直纠结要不要换,但是mldonkey太顺手了……目前挺吸中……&


--------------------
Go to the top of the page
  User is offline Profile Card PM
链接: #12
3828669
[ 12楼 ]  发表 2009-12-11 11:58:12
+Quote Post


浪迹天涯
*

组别: 初级会员
帖子: 27

精华帖数: 0
资源主题数: 0
精华资源数: 0
注册: 2009-01-18
编号: 21,946



虽然我在用 但是我不会整
Go to the top of the page
  User is offline Profile Card PM
链接: #13

Reply to this topicStart new topic
1 位会员正在阅读此主题 (1 位游客和 0 位隐身会员)
0 位会员:

 



RSS 简化版本 当前时间: 10-09-04 03:23
www.ied2k.com 沪ICP备09046504号