diff options
author | pavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-19 23:07:00 +0000 |
---|---|---|
committer | pavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-19 23:07:00 +0000 |
commit | 3b8c7ad8bbd2eaa1228b6c90de0f0de55acbb3c1 (patch) | |
tree | 6370b802508b461d852e6a55c249cba87652729b /package/iptables/files/l7/ftp.pat | |
parent | 3fa28b55eaa173d2e17ccaf551bacf88e5b30beb (diff) |
update stripped subset of l7 patterns to 11-03-2007 patterns
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9582 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iptables/files/l7/ftp.pat')
-rw-r--r-- | package/iptables/files/l7/ftp.pat | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/package/iptables/files/l7/ftp.pat b/package/iptables/files/l7/ftp.pat index 9593ffd1bd..a7f9e0eeaa 100644 --- a/package/iptables/files/l7/ftp.pat +++ b/package/iptables/files/l7/ftp.pat @@ -1,30 +1,41 @@ # FTP - File Transfer Protocol - RFC 959 -# Pattern quality: great fast +# Pattern attributes: great notsofast fast +# Protocol groups: document_retrieval ietf_internet_standard +# Wiki: http://protocolinfo.org/wiki/FTP # # Usually runs on port 21. Note that the data stream is on a dynamically # assigned port, which means that you will need the FTP connection # tracking module in your kernel to usefully match FTP data transfers. # -# This pattern is well tested. If it does not -# work for you, or you believe it could be improved, please post to -# l7-filter-developers@lists.sf.net . This list may be subscribed to at -# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers +# This pattern is well tested. # -# Matches the first two things a server should say. Most servers say -# something after 220, even though they don't have to, and it usually -# includes the string "ftp" (l7-filter is case insensitive). -# This includes proftpd, vsftpd, wuftpd, warftpd, pureftpd, Bulletproof -# FTP Server, and whatever ftp.microsoft.com uses. Just in case, the next -# thing the server sends is a 331. All the above servers also send -# something including "password" after this code. +# Handles the first two things a server should say: +# +# First, the server says it's ready by sending "220". Most servers say +# something after 220, even though they don't have to, and it usually +# includes the string "ftp" (l7-filter is case insensitive). This +# includes proftpd, vsftpd, wuftpd, warftpd, pureftpd, Bulletproof FTP +# Server, and whatever ftp.microsoft.com uses. Almost all servers use only +# ASCII printable characters between the "220" and the "FTP", but non-English +# ones might use others. +# +# The next thing the server sends is a 331. All the above servers also +# send something including "password" after this code. By default, we +# do not match on this because it takes another packet and is more work +# for regexec. + ftp -# actually, let's just do the first for now, it's faster +# by default, we allow only ASCII ^220[\x09-\x0d -~]*ftp -# This is ~10x faster if the stream starts with "220" +# This covers UTF-8 as well +#^220[\x09-\x0d -~\x80-\xfd]*ftp + +# This allows any characters and is about 4x faster than either of the above +# (which are about the same as each other) #^220.*ftp -# This will match more, but much slower +# This is much slower #^220[\x09-\x0d -~]*ftp|331[\x09-\x0d -~]*password # This pattern is more precise, but takes longer to match. (3 packets vs. 1) |