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

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

?? snort_httpinspect.c

?? 著名的入侵檢測系統snort的最新版本的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/**************************************************************************** * * Copyright (C) 2003-2007 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. * ****************************************************************************/ /****  @file       snort_httpinspect.c****  @author     Daniel Roelker <droelker@sourcefire.com>****  @brief      This file wraps the HttpInspect functionality for Snort**              and starts the HttpInspect flow.******  The file takes a Packet structure from the Snort IDS to start the**  HttpInspect flow.  This also uses the Stream Interface Module which**  is also Snort-centric.  Mainly, just a wrapper to HttpInspect               **  functionality, but a key part to starting the basic flow.****  The main bulk of this file is taken up with user configuration and**  parsing.  The reason this is so large is because HttpInspect takes**  very detailed configuration parameters for each specified server.**  Hopefully every web server that is out there can be emulated**  with these configuration options.**  **  The main functions of note are:**    - HttpInspectSnortConf::this is the configuration portion**    - SnortHttpInspect::this is the actual inspection flow**    - LogEvents:this is where we log the HttpInspect events****  NOTES:****  - 2.11.03:  Initial Development.  DJR**  - 2.4.05:   Added tab_uri_delimiter config option.  AJM.*/#include <stdlib.h>#include <string.h>#include <sys/types.h>#ifndef WIN32#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#endif#include "snort.h"#include "detect.h"#include "decode.h"#include "log.h"#include "event.h"#include "generators.h"#include "debug.h"#include "plugbase.h"#include "util.h"#include "event_queue.h"#include "stream_api.h"#include "sfsnprintfappend.h"#include "hi_return_codes.h"#include "hi_ui_config.h"#include "hi_ui_iis_unicode_map.h"#include "hi_si.h"#include "hi_mi.h"#include "hi_norm.h"#include "profiler.h"#ifdef PERF_PROFILINGextern PreprocStats hiDetectPerfStats;extern int hiDetectCalled;#endifextern PV pv;/* Stats tracking for HTTP Inspect */HIStats hi_stats;#define MAX_FILENAME    1000/****  The definition of the configuration separators in the snort.conf**  configure line.*/#define CONF_SEPARATORS " \t\n\r"/***  These are the definitions of the parser section delimiting **  keywords to configure HttpInspect.  When one of these keywords**  are seen, we begin a new section.*/#define GLOBAL        "global"#define GLOBAL_SERVER "global_server"#define SERVER        "server"/***  GLOBAL subkeywords.*//****  Takes an integer arugment*/#define MAX_PIPELINE  "max_pipeline"/****  Specifies whether to alert on anomalous**  HTTP servers or not.*/#define ANOMALOUS_SERVERS "detect_anomalous_servers"/****  Alert on general proxy use*/#define PROXY_ALERT "proxy_alert"/****  Takes an inspection type argument**  stateful or stateless*/#define INSPECT_TYPE  "inspection_type"#define DEFAULT       "default"/***  GLOBAL subkeyword values*/#define INSPECT_TYPE_STATELESS "stateless"#define INSPECT_TYPE_STATEFUL  "stateful"/***  SERVER subkeywords.*/#define PORTS             "ports"#define FLOW_DEPTH        "flow_depth"#define POST_DEPTH        "post_depth"#define IIS_UNICODE_MAP   "iis_unicode_map"#define CHUNK_LENGTH      "chunk_length"#define PIPELINE          "no_pipeline_req"#define ASCII             "ascii"#define DOUBLE_DECODE     "double_decode"#define U_ENCODE          "u_encode"#define BARE_BYTE         "bare_byte"#define BASE36            "base36"#define UTF_8             "utf_8"#define IIS_UNICODE       "iis_unicode"#define NON_RFC_CHAR      "non_rfc_char"#define MULTI_SLASH       "multi_slash"#define IIS_BACKSLASH     "iis_backslash"#define DIRECTORY         "directory"#define APACHE_WS         "apache_whitespace"#define IIS_DELIMITER     "iis_delimiter"#define PROFILE           "profile"#define NON_STRICT        "non_strict"#define ALLOW_PROXY       "allow_proxy_use"#define OVERSIZE_DIR      "oversize_dir_length"#define INSPECT_URI_ONLY  "inspect_uri_only"#define GLOBAL_ALERT      "no_alerts"#define WEBROOT           "webroot"#define TAB_URI_DELIMITER "tab_uri_delimiter"#define WHITESPACE        "whitespace_chars"/***  Alert subkeywords*/#define BOOL_YES     "yes"#define BOOL_NO      "no"/***  PROFILE subkeywords*/#define APACHE        "apache"#define IIS           "iis"#define IIS4_0        "iis4_0"#define IIS5_0        "iis5_0" /* 5.0 only. For 5.1 and beyond, use IIS */#define ALL           "all"/***  Port list delimiters*/#define START_PORT_LIST "{"#define END_PORT_LIST   "}"/***  Keyword for the default server configuration*/#define SERVER_DEFAULT "default"/***  NAME**    ProcessGlobalAlert::*//****  Process the global alert keyword.****  There is no arguments to this keyword, because you can only turn**  all the alerts off.  As of now, we aren't going to support turning**  all the alerts on.****  @param GlobalConf  pointer to the global configuration**  @param ErrorString error string buffer**  @param ErrStrLen   the lenght of the error string buffer****  @return an error code integer **          (0 = success, >0 = non-fatal error, <0 = fatal error)****  @retval  0 successs**  @retval -1 generic fatal error**  @retval  1 generic non-fatal error*//*static int ProcessGlobalAlert(HTTPINSPECT_GLOBAL_CONF *GlobalConf,                              char *ErrorString, int ErrStrLen){    GlobalConf->no_alerts = 1;    return 0;}*//* **  NAME**    ProcessMaxPipeline::*//****  Process the max pipeline configuration.****  This sets the maximum number of pipeline requests that we**  will buffer while waiting for responses, before inspection.**  There is a maximum limit on this, but we can track a user**  defined amount.****  @param GlobalConf  pointer to the global configuration**  @param ErrorString error string buffer**  @param ErrStrLen   the lenght of the error string buffer****  @return an error code integer **          (0 = success, >0 = non-fatal error, <0 = fatal error)****  @retval  0 successs**  @retval -1 generic fatal error**  @retval  1 generic non-fatal error*/static int ProcessMaxPipeline(HTTPINSPECT_GLOBAL_CONF *GlobalConf,                              char *ErrorString, int ErrStrLen){    char *pcToken;    char *pcEnd = NULL;    pcToken = strtok(NULL, CONF_SEPARATORS);    if(pcToken == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "No argument to token '%s'.", MAX_PIPELINE);        return -1;    }    GlobalConf->max_pipeline_requests = strtol(pcToken, &pcEnd, 10);    /*    **  Let's check to see if the entire string was valid.    **  If there is an address here, then there was an    **  invalid character in the string.    */    if(*pcEnd)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "Invalid argument to token '%s'.  Must be a positive "                      "number between 0 and %d.", MAX_PIPELINE,                      HI_UI_CONFIG_MAX_PIPE);        return -1;    }    if(GlobalConf->max_pipeline_requests < 0 ||        GlobalConf->max_pipeline_requests > HI_UI_CONFIG_MAX_PIPE)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "Invalid argument to token '%s'.  Must be a positive "                      "number between 0 and %d.", MAX_PIPELINE, HI_UI_CONFIG_MAX_PIPE);        return -1;    }    return 0;}/* **  NAME**    ProcessInspectType::*//****  Process the type of inspection.****  This sets the type of inspection for HttpInspect to do.****  @param GlobalConf  pointer to the global configuration**  @param ErrorString error string buffer****  @param ErrStrLen   the lenght of the error string buffer****  @return an error code integer **          (0 = success, >0 = non-fatal error, <0 = fatal error)****  @retval  0 successs**  @retval -1 generic fatal error**  @retval  1 generic non-fatal error*/static int ProcessInspectType(HTTPINSPECT_GLOBAL_CONF *GlobalConf,                              char *ErrorString, int ErrStrLen){    char *pcToken;    pcToken = strtok(NULL, CONF_SEPARATORS);    if(pcToken == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "No argument to token '%s'.", INSPECT_TYPE);        return -1;    }    if(!strcmp(INSPECT_TYPE_STATEFUL, pcToken))    {        GlobalConf->inspection_type = HI_UI_CONFIG_STATEFUL;        /*        **  We don't support this option yet, so we'll give an error and        **  bail.        */        SnortSnprintf(ErrorString, ErrStrLen,                      "Stateful HttpInspect processing is not yet available.  "                      "Please use stateless processing for now.");        return -1;    }    else if(!strcmp(INSPECT_TYPE_STATELESS, pcToken))    {        GlobalConf->inspection_type = HI_UI_CONFIG_STATELESS;    }    else    {        SnortSnprintf(ErrorString, ErrStrLen,                      "Invalid argument to token '%s'.  Must be either '%s' or '%s'.",                      INSPECT_TYPE, INSPECT_TYPE_STATEFUL, INSPECT_TYPE_STATELESS);        return -1;    }    return 0;}static int ProcessIISUnicodeMap(int **iis_unicode_map,                                 char **iis_unicode_map_filename,                                int *iis_unicode_map_codepage,                                char *ErrorString, int ErrStrLen){    char *pcToken;    int  iRet;    char filename[MAX_FILENAME];    char *pcEnd;    int  iCodeMap;    pcToken = strtok(NULL, CONF_SEPARATORS);    if(pcToken == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "No argument to token '%s'.", IIS_UNICODE_MAP);        return -1;    }    /*    **  If an absolute path is specified, then use that.    */#ifndef WIN32    if(pcToken[0] == '/')    {        iRet = SnortSnprintf(filename, sizeof(filename), "%s", pcToken);    }    else    {        /*        **  Set up the file name directory        */        if(pv.config_dir[strlen(pv.config_dir)-1] == '/')        {            iRet = SnortSnprintf(filename, sizeof(filename),                                  "%s%s", pv.config_dir, pcToken);        }        else        {            iRet = SnortSnprintf(filename, sizeof(filename),                                 "%s/%s", pv.config_dir, pcToken);        }    }#else    if(strlen(pcToken)>3 && pcToken[1]==':' && pcToken[2]=='\\')    {        iRet = SnortSnprintf(filename, sizeof(filename), "%s", pcToken);    }    else    {        /*        **  Set up the file name directory        */        if(pv.config_dir[strlen(pv.config_dir)-1] == '\\' ||           pv.config_dir[strlen(pv.config_dir)-1] == '/' )        {            iRet = SnortSnprintf(filename, sizeof(filename),                                  "%s%s", pv.config_dir, pcToken);        }        else        {            iRet = SnortSnprintf(filename, sizeof(filename),                                 "%s\\%s", pv.config_dir, pcToken);        }    }#endif    if(iRet != SNORT_SNPRINTF_SUCCESS)    {        SnortSnprintf(ErrorString, ErrStrLen,                 "Filename too long for token '%s'.", IIS_UNICODE_MAP);        return -1;    }    /*    **  Set the filename    */    *iis_unicode_map_filename = strdup(filename);    if(*iis_unicode_map_filename == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "Could not strdup() '%s' filename.",                      IIS_UNICODE_MAP);        return -1;    }    pcToken = strtok(NULL, CONF_SEPARATORS);    if(pcToken == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "No codemap to select from IIS Unicode Map file.");        return -1;    }    /*    **  Grab the unicode codemap to use    */    iCodeMap = strtol(pcToken, &pcEnd, 10);    if(*pcEnd || iCodeMap < 0)    {        SnortSnprintf(ErrorString, ErrStrLen,                      "Invalid IIS codemap argument.");        return -1;    }    /*    **  Set the codepage    */    *iis_unicode_map_codepage = iCodeMap;    /*    **  Assume that the pcToken we now have is the filename of the map    **  table.    */    iRet = hi_ui_parse_iis_unicode_map(iis_unicode_map, filename, iCodeMap);    if (iRet)    {        if(iRet == HI_INVALID_FILE)        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91.com视频| 日本欧美一区二区三区| 九九**精品视频免费播放| 欧美吞精做爰啪啪高潮| 国产日韩欧美电影| 青椒成人免费视频| 91精品欧美综合在线观看最新| 亚洲综合久久久| 91天堂素人约啪| 亚洲黄色av一区| 在线观看视频一区二区| 亚洲精品高清在线观看| 波多野结衣的一区二区三区| 国产精品视频第一区| 国产精品一线二线三线精华| 欧美成人a在线| 国产精品亚洲成人| 中文字幕精品一区| 91在线观看高清| 亚洲成人免费影院| 精品少妇一区二区三区在线播放| 久久精品久久综合| 亚洲欧美影音先锋| 这里只有精品视频在线观看| 国产麻豆精品久久一二三| 亚洲欧洲在线观看av| 欧美日韩国产精品成人| 国产激情91久久精品导航| 亚洲免费观看高清| 精品国产髙清在线看国产毛片| 顶级嫩模精品视频在线看| 亚洲一二三四久久| 国产欧美一区二区三区在线看蜜臀| 成人av午夜电影| 免费高清成人在线| 一区二区三区日韩在线观看| 欧美精品一区二区三区一线天视频 | 色婷婷久久一区二区三区麻豆| 福利一区福利二区| 亚洲午夜在线观看视频在线| 日韩三级免费观看| 欧美无人高清视频在线观看| 国产在线播放一区三区四| 亚洲a一区二区| 亚洲专区一二三| 国产精品国产三级国产aⅴ无密码| 欧美嫩在线观看| 91黄色免费版| heyzo一本久久综合| 国产成人免费网站| 国产综合色在线| 精品一区二区免费视频| 青青草原综合久久大伊人精品优势| 亚洲伦在线观看| 国产精品久久久久精k8| 一卡二卡欧美日韩| 国产精品视频在线看| 99精品视频一区| 国产精品77777| 成人小视频在线观看| 国产不卡高清在线观看视频| 蜜臀av一区二区在线观看| 日韩和欧美一区二区三区| 三级精品在线观看| 久久国产欧美日韩精品| 国产一区二区三区香蕉| 国产91对白在线观看九色| 99精品在线免费| 欧美性极品少妇| 精品少妇一区二区三区视频免付费 | 亚洲图片有声小说| 日韩av一级电影| aaa亚洲精品一二三区| 欧美性色黄大片| 在线不卡中文字幕| 久久精品日韩一区二区三区| 成人欧美一区二区三区黑人麻豆| 亚洲一区二区三区四区五区黄| 久久精品久久99精品久久| 91天堂素人约啪| 久久免费看少妇高潮| 亚洲综合免费观看高清完整版 | 一本一道综合狠狠老| 日韩午夜激情免费电影| 亚洲天堂久久久久久久| 久久精品国产第一区二区三区| jizzjizzjizz欧美| 精品国产凹凸成av人导航| 一区二区三区欧美激情| 成人免费毛片app| 久久久久亚洲综合| 日韩专区一卡二卡| 欧美色精品天天在线观看视频| 日韩精品一区二区三区三区免费| 亚洲一区二区欧美| 91老师片黄在线观看| 亚洲国产精品t66y| 狠狠v欧美v日韩v亚洲ⅴ| 3atv一区二区三区| 婷婷久久综合九色国产成人| 色8久久精品久久久久久蜜| 亚洲婷婷综合色高清在线| 成人短视频下载| 亚洲视频免费看| 色中色一区二区| 亚洲午夜羞羞片| 欧美视频在线不卡| 日本va欧美va精品| 日韩欧美国产1| 国产老肥熟一区二区三区| 精品国产91洋老外米糕| 国产精品综合网| 亚洲视频你懂的| 欧美精品九九99久久| 免费久久精品视频| 国产精品国产自产拍高清av王其| 99国产精品国产精品毛片| 尤物在线观看一区| 91精品国产综合久久精品图片| 国产一区999| 午夜精品福利一区二区三区蜜桃| 91精品国产福利在线观看| 国产成人精品三级麻豆| 一区二区三区中文字幕| 久久影音资源网| 欧美挠脚心视频网站| 国产999精品久久久久久绿帽| 亚洲一区国产视频| 欧美韩国日本不卡| 日韩欧美一区二区久久婷婷| 成人免费毛片片v| 毛片不卡一区二区| 亚洲卡通动漫在线| 国产精品嫩草久久久久| 欧美电影影音先锋| 在线观看国产91| 不卡av免费在线观看| 韩国av一区二区三区在线观看| 亚洲人123区| 国产精品电影一区二区| 欧美成人福利视频| 91精品麻豆日日躁夜夜躁| 日本韩国一区二区三区| 成人激情校园春色| 不卡高清视频专区| 国产.欧美.日韩| 国产精品18久久久久久久网站| 蜜桃91丨九色丨蝌蚪91桃色| 日精品一区二区三区| 石原莉奈在线亚洲三区| 日韩国产一二三区| 视频一区视频二区在线观看| 洋洋av久久久久久久一区| 亚洲欧美日韩一区二区| 亚洲免费毛片网站| 亚洲第一激情av| 麻豆精品视频在线观看视频| 日本三级韩国三级欧美三级| 免费久久99精品国产| 欧美久久久久久久久久| 日本特黄久久久高潮| 亚洲精品欧美专区| 视频在线在亚洲| 日日夜夜免费精品| 国产乱码精品一区二区三区av| 国产馆精品极品| 91黄色小视频| 日韩精品一区二区在线| 国产日韩欧美高清| 亚洲欧美偷拍卡通变态| 午夜欧美视频在线观看| 激情成人午夜视频| av在线免费不卡| 欧美日韩成人激情| 国产欧美日韩三区| 免费在线观看不卡| 91美女片黄在线观看91美女| 欧美一区二区在线免费观看| 国产欧美一区二区精品性| 亚洲午夜久久久久久久久电影院 | 亚洲在线一区二区三区| 国产资源精品在线观看| 欧美亚洲日本国产| 国产精品―色哟哟| 精品在线视频一区| 日韩午夜在线观看| 亚洲高清免费观看高清完整版在线观看 | 久久精品人人做人人爽97| 天堂精品中文字幕在线| 91在线看国产| 日本一区二区高清| 狠狠久久亚洲欧美| 26uuu精品一区二区三区四区在线| 亚洲夂夂婷婷色拍ww47 | 99久久综合国产精品| 久久精品视频免费| 国产成人无遮挡在线视频| 日韩免费高清av| 久久精品国产免费| 欧美成人激情免费网|