]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer-ftp: detect FTP alproto when using AUTH TLS
authorMats Klepsland <mats.klepsland@gmail.com>
Wed, 1 Feb 2017 09:24:52 +0000 (10:24 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 May 2017 08:43:36 +0000 (10:43 +0200)
Try to detect FTP using the patterns '220 (' and 'FEAT', since 'USER '
and 'PASS ' are not sent in cleartext when using AUTH TLS.

src/app-layer-ftp.c

index 681f7ab9c27caa9f881b1fcc3ac88af38a87d1d1..f21c73f72220a1d08343151ffae45737e0ac9a61 100644 (file)
@@ -379,6 +379,16 @@ static int FTPGetAlstateProgress(void *tx, uint8_t direction)
 
 static int FTPRegisterPatternsForProtocolDetection(void)
 {
+    if (AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_FTP,
+                                              "220 (", 5, 0, STREAM_TOCLIENT) < 0)
+    {
+        return -1;
+    }
+    if (AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_FTP,
+                                               "FEAT", 4, 0, STREAM_TOSERVER) < 0)
+    {
+        return -1;
+    }
     if (AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_FTP,
                                                "USER ", 5, 0, STREAM_TOSERVER) < 0)
     {