亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pp_ftp.c

?? 著名的入侵檢測系統snort的最新版本的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* $Id$ *//* ** Copyright (C) 2004-2006 Sourcefire, Inc ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License Version 2 as ** published by the Free Software Foundation.  You may not use, modify or ** distribute this program under any other version of the GNU General ** Public License. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* pp_ftp.c  *  * Purpose:  FTP sessions contain commands and responses.  Certain *           commands are vectors of attack.  This module checks *           those FTP client commands and their parameter values, as *           well as the server responses per the configuration. * * Arguments:  None *    * Effect:  Alerts may be raised * * Comments: * *//* your preprocessor header file goes here */#ifdef HAVE_CONFIG_H#include "config.h"#endif#ifdef HAVE_STRINGS_H#include <strings.h>#endif#include <string.h>#include <stdlib.h>#include <stdio.h>#include <sys/types.h>#ifndef WIN32#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <ctype.h>#else#include <windows.h>#endif#include "ftpp_eo_log.h"#include "pp_ftp.h"#include "pp_telnet.h"#include "ftpp_return_codes.h"#include "ftp_cmd_lookup.h"#include "ftp_bounce_lookup.h"//#include "decode.h"#include "debug.h"#include "stream_api.h"//#include "plugbase.h"#ifndef MAXHOSTNAMELEN /* Why doesn't Windows define this? */#define MAXHOSTNAMELEN 256#endif//extern u_int8_t DecodeBuffer[DECODE_BLEN]; /* decode.c *//* * Used to keep track of pipelined commands and the last one * that resulted in a  */static int ftp_cmd_pipe_index = 0;/* * Function: getIP(char **ip_start, *                 char *last_char, *                 char term_char, *                 u_int32_t *ipRet, *                 u_int16_t *portRet) * * Purpose: Returns a 32bit IP address and port from an FTP-style *          string -- ie, a,b,c,d,p1,p2.  Stops checking when term_char *          is seen.  Used to get address and port information from FTP *          PORT command and server response to PASV command. * * Arguments ip_start        => Pointer to pointer to the start of string. *                              Updated to end of IP address if successful. *           last_char       => End of string *           term_char       => Character delimiting the end of the address. *           ipRet           => Return pointer to 32bit address on success *           portRet         => Return pointer to 16bit port on success * * Returns: int => return code indicating error or success * */int getIP(const char **ip_start, const char *last_char, char term_char,          ip_t *ipRet, u_int16_t *portRet){    u_int32_t ip=0;    u_int16_t port=0;    int octet=0;    const char *this_param = *ip_start;    do    {        int value = 0;        do        {            if (!isdigit((int)(*this_param)))            {                return FTPP_NON_DIGIT;            }            value = value * 10 + (*this_param - '0');            this_param++;        } while ((this_param < last_char) &&                 (*this_param != ',') &&                 (*this_param != term_char));        if (value > 0xFF)        {            return FTPP_INVALID_ARG;        }        if (octet  < 4)        {            ip = (ip << 8) + value;        }        else        {            port = (port << 8) + value;        }        if (*this_param != term_char)            this_param++;        octet++;    } while ((this_param < last_char) && (*this_param != term_char) );    if (octet != 6)    {        return FTPP_MALFORMED_IP_PORT;    }#ifdef SUP_IP6// XXX-IPv6 NOT YET IMPLEMENTED - IPv4 only at the moment    sfip_set_raw(ipRet, &ip, AF_INET);#else    *ipRet = ip;#endif    *portRet = port;    *ip_start = this_param;    return FTPP_SUCCESS;}/* * Function: validate_date_format( *                            FTP_DATE_FMT *ThisFmt, *                            char **this_param) * * Purpose: Recursively determines whether a date matches the *          a valid format. * * Arguments: ThisFmt        => Pointer to the current format *            this_param     => Pointer to start of the portion to validate. *                              Updated to end of valid section if valid. * * Returns: int => return code indicating error or success * */int validate_date_format(FTP_DATE_FMT *ThisFmt, const char **this_param){    int valid_string = 0;    int checked_something_else = 0;    int checked_next = 0;    int iRet = FTPP_ALERT;    const char *curr_ch;    if (!ThisFmt)        return FTPP_INVALID_ARG;    if (!this_param || !(*this_param))        return FTPP_INVALID_ARG;    curr_ch = *this_param;    if (!ThisFmt->empty)    {        char *format_char = ThisFmt->format_string;        do        {            switch (*format_char)            {            case 'n':                if (!isdigit((int)(*curr_ch)))                {                    /* Return for non-digit */                    return FTPP_INVALID_DATE;                }                curr_ch++;                format_char++;                break;            case 'C':                if (!isalpha((int)(*curr_ch)))                {                    /* Return for non-char */                    return FTPP_INVALID_DATE;                }                curr_ch++;                format_char++;                break;            default:                if (*curr_ch != *format_char)                {                    /* Return for non-matching char */                    return FTPP_INVALID_DATE;                }                curr_ch++;                format_char++;                break;            }            valid_string = 1;        }        while ((*format_char != '\0') && !isspace((int)(*curr_ch)));        if ((*format_char != '\0') && isspace((int)(*curr_ch)))        {            /* Didn't have enough chars to complete this format */            return FTPP_INVALID_DATE;        }    }    if ((ThisFmt->optional) && !isspace((int)(*curr_ch)))    {        const char *tmp_ch = curr_ch;        iRet = validate_date_format(ThisFmt->optional, &tmp_ch);        if (iRet == FTPP_SUCCESS)            curr_ch = tmp_ch;    }    if ((ThisFmt->next_a) && !isspace((int)(*curr_ch)))    {        const char *tmp_ch = curr_ch;        checked_something_else = 1;        iRet = validate_date_format(ThisFmt->next_a, &tmp_ch);        if (iRet == FTPP_SUCCESS)        {            curr_ch = tmp_ch;        }        else if (ThisFmt->next_b)        {            iRet = validate_date_format(ThisFmt->next_b, &tmp_ch);            if (iRet == FTPP_SUCCESS)                curr_ch = tmp_ch;        }        if (ThisFmt->next)        {            iRet = validate_date_format(ThisFmt->next, &tmp_ch);            if (iRet == FTPP_SUCCESS)            {                curr_ch = tmp_ch;                checked_next = 1;            }        }        if (iRet == FTPP_SUCCESS)        {            *this_param = curr_ch;            return iRet;        }    }    if ((!checked_next) && (ThisFmt->next))    {        const char *tmp_ch = curr_ch;        checked_something_else = 1;        iRet = validate_date_format(ThisFmt->next, &tmp_ch);        if (iRet == FTPP_SUCCESS)        {            curr_ch = tmp_ch;            checked_next = 1;        }    }    if ((isspace((int)(*curr_ch))) && ((!ThisFmt->next) || checked_next))    {        *this_param = curr_ch;        return FTPP_SUCCESS;    }    if (valid_string)    {        int all_okay = 0;        if (checked_something_else)        {            if (iRet == FTPP_SUCCESS)                all_okay = 1;        }        else        {            all_okay = 1;        }        if (all_okay)        {            *this_param = curr_ch;            return FTPP_SUCCESS;        }    }    return FTPP_INVALID_DATE;}/* * Function: validate_param( *                            Packet *p *                            char *param *                            char *end *                            FTP_PARAM_FMT *param_format, *                            FTP_SESSION *Session) * * Purpose: Validates the current parameter against the format *          specified. * * Arguments: p              => Pointer to the current packet *            params_begin   => Pointer to beginning of parameters *            params_end     => End of params buffer *            param_format   => Parameter format specifier for this command *            Session        => Pointer to the session info * * Returns: int => return code indicating error or success * */int validate_param(SFSnortPacket *p,                const char *param,                const char *end,                FTP_PARAM_FMT *ThisFmt,                FTP_SESSION *Session){    int iRet;    const char *this_param = param;    if (param > end)        return FTPP_ALERT;    switch (ThisFmt->type)    {    case e_head:        /* shouldn't get here, but just in case */        break;    case e_unrestricted:        /* strings/filenames only occur as the last param,         * so move to the end of the param buffer. */        {            do            {                this_param++;            }            while (this_param < end);        }        break;    case e_strformat:        /* Check for 2 % signs within the parameter for an FTP command         * 2 % signs is the magic number per existing rules (24 Sep 2004)         */#define MAX_PERCENT_SIGNS 2        {            int numPercents = 0;            do            {                if (*this_param == '%')                {                    numPercents++;                    if (numPercents >= MAX_PERCENT_SIGNS)                    {                        break;                    }                }                this_param++;            }            while ((this_param < end) &&                   (*this_param != ' '));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一卡二卡三卡国产欧美| 亚洲成av人片在线观看无码| 亚洲乱码中文字幕综合| 日韩av一二三| 欧美少妇一区二区| 亚洲色图第一区| 成人一区在线观看| 精品国产一区二区三区av性色| 一区二区三区中文在线| 国产91在线看| 精品久久久久香蕉网| 亚洲成人一区在线| 91福利视频网站| 亚洲视频一区在线观看| 成人午夜视频网站| 久久久91精品国产一区二区精品| 日本特黄久久久高潮| 欧美色欧美亚洲另类二区| 亚洲欧美激情插| 91亚洲大成网污www| 久久久精品综合| 国产乱对白刺激视频不卡| 日韩免费视频一区| 麻豆一区二区三| 精品伦理精品一区| 久久99精品网久久| 精品久久久久久久久久久久久久久| 天堂影院一区二区| 欧美一级久久久| 免费高清在线一区| 日韩一本二本av| 美女mm1313爽爽久久久蜜臀| 日韩丝袜美女视频| 麻豆成人91精品二区三区| 日韩欧美www| 国产一区福利在线| 久久久久久久网| 不卡一区二区三区四区| 亚洲视频一区在线观看| 色天天综合久久久久综合片| 亚洲精品videosex极品| 欧美在线视频全部完| 亚洲成av人片在线| 日韩美女在线视频| 韩国女主播一区二区三区| 久久先锋影音av| 成人午夜伦理影院| 亚洲激情图片qvod| 日韩一区二区中文字幕| 久久电影网电视剧免费观看| 久久久精品欧美丰满| bt7086福利一区国产| 伊人夜夜躁av伊人久久| 7777精品伊人久久久大香线蕉的 | 欧美一级一级性生活免费录像| 三级久久三级久久| 国产亚洲一区二区三区四区| av午夜一区麻豆| 亚洲va中文字幕| 久久久影视传媒| 91麻豆自制传媒国产之光| 日韩高清一级片| 久久久激情视频| 欧美日韩国产三级| 国产成人av电影| 日韩制服丝袜先锋影音| 国产欧美日韩麻豆91| 欧美色综合影院| 成人一级视频在线观看| 亚洲成人黄色小说| 国产欧美日韩精品一区| 欧美男同性恋视频网站| 国产成人免费在线观看不卡| 午夜电影网一区| 国产精品看片你懂得| 欧美一区二区三区播放老司机| 成人国产精品免费网站| 蜜桃av一区二区| 亚洲伊人色欲综合网| 国产丝袜在线精品| 日韩一区二区免费高清| 一本一道久久a久久精品| 久久精品999| 亚洲高清免费观看| 国产精品女同互慰在线看| 欧美一区二区高清| 日本韩国欧美一区| 粉嫩aⅴ一区二区三区四区五区 | 在线不卡免费av| 成人免费精品视频| 国产精品一区二区黑丝| 无吗不卡中文字幕| 一区二区不卡在线视频 午夜欧美不卡在| 精品国产91洋老外米糕| 欧美人xxxx| 在线精品视频小说1| 成人福利在线看| 福利视频网站一区二区三区| 麻豆精品久久久| 免费看欧美女人艹b| 亚洲成人1区2区| 亚洲自拍偷拍九九九| 亚洲人精品一区| 亚洲美女屁股眼交| 亚洲欧洲美洲综合色网| 中文子幕无线码一区tr | 欧美高清精品3d| 91豆麻精品91久久久久久| 亚洲国产精品综合小说图片区| 亚洲免费观看高清完整版在线 | 日韩一二三四区| 91精品国产色综合久久久蜜香臀| 欧美日韩三级在线| 欧美日韩亚洲综合在线| 欧美日韩另类一区| 欧美日韩亚洲综合在线| 在线播放中文字幕一区| 91精品在线一区二区| 日韩亚洲欧美在线| 精品精品国产高清a毛片牛牛| 欧美成人欧美edvon| 久久综合av免费| 国产精品入口麻豆九色| 亚洲欧洲另类国产综合| 一区av在线播放| 五月天视频一区| 另类调教123区| 国产98色在线|日韩| 91老师国产黑色丝袜在线| 日本乱人伦一区| 欧美一区二区美女| 国产欧美一区二区在线| 最新国产成人在线观看| 亚洲一区二区免费视频| 久久99久久99精品免视看婷婷 | 麻豆久久久久久久| 国产一区高清在线| 91热门视频在线观看| 69久久99精品久久久久婷婷| 2020国产精品久久精品美国| 国产精品国产三级国产三级人妇| 亚洲一区二区三区自拍| 国内成人自拍视频| 日本福利一区二区| 日韩欧美在线综合网| 国产精品二区一区二区aⅴ污介绍| 亚洲精品日韩综合观看成人91| 日韩二区三区四区| 大尺度一区二区| 欧美放荡的少妇| 国产精品久久久久久一区二区三区| 亚洲国产aⅴ成人精品无吗| 黄色日韩网站视频| 欧美亚州韩日在线看免费版国语版| 欧美一区二区三区视频在线 | 一本色道久久综合精品竹菊| 91精品国产综合久久小美女| 亚洲国产精品成人综合| 五月激情六月综合| 91小视频在线| 欧美精品一区二区三区四区| 亚洲一区免费观看| 不卡视频一二三| 精品人在线二区三区| 亚洲成人免费视| 成人开心网精品视频| 欧美一级精品在线| 亚洲成人午夜影院| 91麻豆6部合集magnet| 国产视频视频一区| 精品一区二区三区在线播放| 欧美日韩一区二区三区免费看| 中文字幕久久午夜不卡| 激情综合色综合久久综合| 欧美日韩视频专区在线播放| 亚洲人成网站色在线观看| 岛国精品在线播放| 久久精品亚洲精品国产欧美| 秋霞影院一区二区| 91麻豆精品久久久久蜜臀| 亚洲国产精品尤物yw在线观看| 91在线看国产| 国产精品日韩成人| 成人免费视频视频在线观看免费| 欧美大片拔萝卜| 欧美aaa在线| 欧美一区二区性放荡片| 亚洲成av人片在线观看无码| 欧美性大战久久久| 亚洲一区二区三区在线看 | 国产成人免费av在线| 精品国产sm最大网站| 黑人巨大精品欧美黑白配亚洲| 91精品国产品国语在线不卡| 五月天网站亚洲| 日韩丝袜情趣美女图片| 精品一区二区三区不卡| 精品免费视频.| 国产福利一区在线观看| 久久婷婷国产综合精品青草|