1
|
# Xunlei - Chinese P2P filesharing - http://xunlei.com
|
2
|
# Pattern attributes: good slow notsofast
|
3
|
# Protocol groups: p2p
|
4
|
# Wiki: http://www.protocolinfo.org/wiki/Xunlei
|
5
|
# Copyright (C) 2008 Matthew Strait, Ethan Sommer; See ../LICENSE
|
6
|
#
|
7
|
# This has been tested by a number of people.
|
8
|
#
|
9
|
# Written by wsgtrsys of www.routerclub.com. Improved by VeNoMouS.
|
10
|
# Improved more by wsgtrsys and platinum of bbs.chinaunix.net.
|
11
|
#
|
12
|
# Further additions of HTTP-like content by liangjunATdcuxD.Tcom, who
|
13
|
# says: "i find old pattern is not working . so i write a new pattern of
|
14
|
# xunlei,it's working with all of xunlei 5 version!" Matthew Strait notes
|
15
|
# in response:
|
16
|
#
|
17
|
# I've looked around and I'm fairly sure that Internet Explorer 5.0
|
18
|
# never identifies itself as "Mozilla/4.0 (compatible; MSIE 5.00;
|
19
|
# Windows 98)" and that Internet Explorer 6.0 never identifies itself as
|
20
|
# either "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; )" or
|
21
|
# "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)".
|
22
|
|
23
|
# The keep-alive part needs some examination too. These might validly
|
24
|
# occur in an HTTP/1.0 connection, although I think in practical cases
|
25
|
# they don't since there's general only one \x0d\x0a after it and/or the
|
26
|
# next line starts with a letter (especially because it's the client
|
27
|
# sending it). It wouldn't be crazy, though, if another protocol
|
28
|
# (besides Xunlei) used keep-alive in a way that did match this. But
|
29
|
# since I can't think of any examples, I'll assume it's ok for now.
|
30
|
|
31
|
xunlei
|
32
|
^([()]|get)(...?.?.?(reg|get|query)|.+User-Agent: (Mozilla/4\.0 \(compatible; (MSIE 6\.0; Windows NT 5\.1;? ?\)|MSIE 5\.00; Windows 98\))))|Keep-Alive\x0d\x0a\x0d\x0a[26]
|
33
|
|
34
|
|
35
|
# This was the pattern until 2008 11 08. It is safer than the above against
|
36
|
# overmatching ordinary HTTP connections
|
37
|
#^[()]...?.?.?(reg|get|query)
|
38
|
|
39
|
# More detail:
|
40
|
# From http://sourceforge.net/tracker/index.php?func=detail&aid=1885209&group_id=80085&atid=558668
|
41
|
#
|
42
|
##############################################################################
|
43
|
# Date: 2008-02-03
|
44
|
# Sender: hydr0g3n
|
45
|
#
|
46
|
# Xunlei (Chinese P2P) traffic is not matched anymore by layer7 xunlei
|
47
|
# pattern. It used to work in the past but not anymore. Maybe Xunlei was
|
48
|
# updated and pattern should be adapted?
|
49
|
#
|
50
|
# Apparently ipp2p was edited by Chinese people to detect pplive and xunlei.
|
51
|
# It is interesting and very recent:
|
52
|
# http://www.chinaunix.net/jh/4/914377.html
|
53
|
##############################################################################
|
54
|
# Date: 2008-02-03
|
55
|
# Sender: quadong
|
56
|
#
|
57
|
# Ok. Only some of the ipp2p function can be translated into an l7-filter
|
58
|
# regular expression. The first part of search_xunlei can't be, since it
|
59
|
# works by checking whether the length of the packet matches a byte in the
|
60
|
# packet. The second part of search_xunlei becomes:
|
61
|
#
|
62
|
# \x20.?\x01?.?[\x01\x77]............?.?.?.?\x38
|
63
|
#
|
64
|
# Or possibly:
|
65
|
#
|
66
|
# ^\x20.?\x01?.?[\x01\x77]............?.?.?.?\x38
|
67
|
#
|
68
|
# I'm not sure whether IPP2P looks at every packet or only the first of each
|
69
|
# connection.
|
70
|
#
|
71
|
# udp_search_xunlei says:
|
72
|
# \x01\x01\x01\xfe\xff\xfe\xff|\x01\x11\xa0\xfe\xff\xfe\xff
|
73
|
#
|
74
|
# Again, putting a ^ at the beginning might work:
|
75
|
#
|
76
|
# ^(\x01\x01\x01\xfe\xff\xfe\xff|\x01\x11\xa0\xfe\xff\xfe\xff)
|
77
|
#
|
78
|
# So this *might* work:
|
79
|
#
|
80
|
# ^(\x20.?\x01?.?[\x01\x77]............?.?.?.?\x38|\x01\x01\x01\xfe\xff\xfe\xff|\x01\x11\xa0\xfe\xff\xfe\xff)
|
81
|
#
|
82
|
# but the ^ might be wrong and it will not match the HTTP part of Xunlei.
|
83
|
##############################################################################
|