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

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

?? snort_httpinspect.c

?? 著名的入侵檢測系統snort的最新版本的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
#else        Ip = inet_addr(pcToken);        if(Ip == INADDR_NONE)#endif        {            SnortSnprintf(ErrorString, ErrStrLen,                          "Invalid IP to '%s' token.", SERVER);            return -1;        }        /*        **  allocate the memory for the server configuration        */        ServerConf = (HTTPINSPECT_CONF *)calloc(1, sizeof(HTTPINSPECT_CONF));        if(!ServerConf)        {            SnortSnprintf(ErrorString, ErrStrLen,                          "Could not allocate memory for server configuration.");            return -1;        }        iRet = ProcessServerConf(GlobalConf, ServerConf, ErrorString, ErrStrLen);        if (iRet)        {            return iRet;        }        iRet = hi_ui_config_add_server(GlobalConf, Ip, ServerConf);        if (iRet)        {            /*            **  Check for already added servers            */            if(iRet == HI_NONFATAL_ERR)            {                SnortSnprintf(ErrorString, ErrStrLen,                              "Duplicate server configuration.");                return -1;            }            else            {                SnortSnprintf(ErrorString, ErrStrLen,                              "Error when adding server configuration.");                return -1;            }        }        /*        **  Print out the configuration header        */#ifdef SUP_IP6        LogMessage("    SERVER: %s\n", sfip_ntoa(Ip));#else        ip_addr.s_addr = Ip;        LogMessage("    SERVER: %s\n", inet_ntoa(ip_addr));#endif    }    /*    **  Finish printing out the server configuration    */    PrintServerConf(ServerConf);    return 0;}static int PrintGlobalConf(HTTPINSPECT_GLOBAL_CONF *GlobalConf){    LogMessage("HttpInspect Config:\n");    LogMessage("    GLOBAL CONFIG\n");    LogMessage("      Max Pipeline Requests:    %d\n",                GlobalConf->max_pipeline_requests);    LogMessage("      Inspection Type:          %s\n",               GlobalConf->inspection_type ? "STATEFUL" : "STATELESS");    LogMessage("      Detect Proxy Usage:       %s\n",               GlobalConf->proxy_alert ? "YES" : "NO");    LogMessage("      IIS Unicode Map Filename: %s\n",               GlobalConf->iis_unicode_map_filename);    LogMessage("      IIS Unicode Map Codepage: %d\n",               GlobalConf->iis_unicode_codepage);    return 0;}/***  NAME**    HttpInspectSnortConf::*//****  This function takes the HttpInspect configuration line from the **  snort.conf and creats an HttpInspect configuration.****  This routine takes care of the snort specific configuration processing**  and calls the generic routines to add specific server configurations.**  It sets the configuration structure elements in this routine.****  The ErrorString is passed in as a pointer, and the ErrStrLen tells**  us the length of the pointer.****  @param GlobalConf  a pointer to the global configuration.**  @param args        a pointer to argument string.**  @param iGlobal     whether this is the global configuration or a server**  @param ErrorString a pointer for an error string.**  @param ErrStrLen   the length of the error string.****  @return an error code integer **          (0 = success, >0 = non-fatal error, <0 = fatal error)****  @retval  0 success**  @retval  1 generic non-fatal error**  @retval -1 generic fatal error**  @retval -2 ErrorString is undefined*/static int  s_iGlobal = 0;int HttpInspectSnortConf(HTTPINSPECT_GLOBAL_CONF *GlobalConf, char *args, int iGlobal,                         char *ErrorString, int ErrStrLen){    char        *pcToken;    int         iRet;    /*    **  Check input variables    */    if(ErrorString == NULL)    {        return -2;    }        if(GlobalConf == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                       "Global configuration variable undefined.");        return -1;    }    if(args == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                       "No arguments to HttpInspect configuration.");        return -1;    }    /*    **  Find out what is getting configured    */    pcToken = strtok(args, CONF_SEPARATORS);    if(pcToken == NULL)    {        SnortSnprintf(ErrorString, ErrStrLen,                       "No arguments to HttpInspect configuration.");        return -1;    }    /*    **  Global Configuration Processing    **  We only process the global configuration once, but always check for    **  user mistakes, like configuring more than once.  That's why we    **  still check for the global token even if it's been checked.    */    if((s_iGlobal || iGlobal) && !strcmp(pcToken, GLOBAL))     {        /*        **  Don't allow user to configure twice        */        if(s_iGlobal)        {            SnortSnprintf(ErrorString, ErrStrLen,                          "Cannot configure '%s' settings more than once.",                          GLOBAL);            return -1;        }        iRet = ProcessGlobalConf(GlobalConf, ErrorString, ErrStrLen);        if (iRet)        {            return iRet;        }        s_iGlobal = 1;        /*        **  Let's print out the global config        */        PrintGlobalConf(GlobalConf);    }    /*    **  Server Configuration    */    else if(!iGlobal && !strcmp(pcToken, SERVER))    {        iRet = ProcessUniqueServerConf(GlobalConf, ErrorString, ErrStrLen);        if (iRet)        {            return iRet;        }    }    /*    **  Invalid configuration keyword    */    else    {        if(iGlobal)        {            SnortSnprintf(ErrorString, ErrStrLen,                          "Invalid configuration token '%s'.  "                           "The first configuration must start with a '%s' "                          "configuration type.", pcToken, GLOBAL);        }        else        {            SnortSnprintf(ErrorString, ErrStrLen,                          "Invalid configuration token '%s'.  Must be a '%s' "                          "configuration.", pcToken, SERVER);        }        return -1;    }    return 0;}/***  NAME**    HttpInspectCheckConfig::*//****  This function verifies the HttpInspect configuration is complete****  @return none*/void HttpInspectCheckConfig(void){    if (s_iGlobal && !s_iDefaultServer)        FatalError("HttpInspectConfigCheck() default server configuration "            "not specified\n");    /* So we don't have to check it every time we use it */    if (s_iGlobal)    {        if ((!stream_api) || (stream_api->version < STREAM_API_VERSION4))            FatalError("HttpInspectConfigCheck() Streaming & reassembly "                       "must be enabled\n");    }}/***  NAME**    LogEvents::*//****  This is the routine that logs HttpInspect alerts through Snort.**  **  Every Session gets looked at for any logged events, and if there are**  events to be logged then we select the one with the highest priority.**  **  We use a generic event structure that we set for each different event**  structure.  This way we can use the same code for event logging regardless**  of what type of event strucure we are dealing with.**  **  The important things to know about this function is how to work with**  the event queue.  The number of unique events is contained in the**  stack_count variable.  So we loop through all the unique events and**  find which one has the highest priority.  During this loop, we also**  re-initialize the individual event counts for the next iteration, saving**  us time in a separate initialization phase.**  **  After we've iterated through all the events and found the one with the**  highest priority, we then log that event through snort.**  **  We've mapped the HttpInspect and the Snort alert IDs together, so we**  can access them directly instead of having a more complex mapping**  function.  It's the only good way to do this.**  **  @param Session          pointer to Session construct**  @param p                pointer to the Snort packet construct**  @param iInspectMode     inspection mode to take event queue from**  **  @return integer**  **  @retval 0 this function only return success*/static inline int LogEvents(HI_SESSION *hi_ssn, Packet *p, int iInspectMode){    HI_GEN_EVENTS GenEvents;    HI_EVENT      *OrigEvent;    HI_EVENT      *HiEvent = NULL;    u_int32_t     uiMask = 0;    int           iGenerator;    int           iStackCnt;    int           iEvent;    int           iCtr;    u_int32_t     httpflags = 0;    /*    **  Set the session ptr, if applicable    */    if(iInspectMode == HI_SI_CLIENT_MODE)    {        GenEvents.stack =       hi_ssn->client.event_list.stack;        GenEvents.stack_count = &(hi_ssn->client.event_list.stack_count);        GenEvents.events =      hi_ssn->client.event_list.events;        iGenerator = GENERATOR_SPP_HTTP_INSPECT_CLIENT;    }    else if(iInspectMode == HI_SI_SERVER_MODE)    {        /*        **  We have no server events right now, so we just return.        */        return 0;    }    else    {        GenEvents.stack =       hi_ssn->anom_server.event_list.stack;        GenEvents.stack_count = &(hi_ssn->anom_server.event_list.stack_count);        GenEvents.events =      hi_ssn->anom_server.event_list.events;        iGenerator = GENERATOR_SPP_HTTP_INSPECT_ANOM_SERVER;    }    /*    **  Now starts the generic event processing    */    iStackCnt = *(GenEvents.stack_count);    /*    **  IMPORTANT::    **  We have to check the stack count of the event queue before we process    **  an log.    */    if(iStackCnt == 0)    {        return 0;    }    /*    **  Cycle through the events and select the event with the highest    **  priority.    */    for(iCtr = 0; iCtr < iStackCnt; iCtr++)    {        iEvent = GenEvents.stack[iCtr];        OrigEvent = &(GenEvents.events[iEvent]);        /*        **  Set the event to start off the comparison        */        if(!HiEvent)        {            HiEvent = OrigEvent;        }        /*        **  This is our "comparison function".  Log the event with the highest        **  priority.        */        if(OrigEvent->event_info->priority < HiEvent->event_info->priority)        {            HiEvent = OrigEvent;        }        /*        **  IMPORTANT:        **    This is how we reset the events in the event queue.        **    If you miss this step, you can be really screwed.        */        OrigEvent->count = 0;    }    /*    **  We use the iEvent+1 because the event IDs between snort and    **  HttpInspect are mapped off-by-one.  Don't ask why, drink Bud    **  Dry . . . They're mapped off-by one because in the internal    **  HttpInspect queue, events are mapped starting at 0.  For some    **  reason, it appears that the first event can't be zero, so we    **  use the internal value and add one for snort.    */    iEvent = HiEvent->event_info->alert_id + 1;    uiMask = (u_int32_t)(1 << (iEvent & 31));    /*    **  If we've already logged this event for this stream, then    **  don't log it again.    */    if(p->ssnptr)    {        httpflags = (u_int32_t)(uintptr_t)stream_api->get_application_data(p->ssnptr,                                                     PP_HTTPINSPECT);    }    if (httpflags & uiMask)    {        return 0;    }    SnortEventqAdd(iGenerator, iEvent, 1, 0, 3, HiEvent->event_info->alert_str,0);    /*    **  Set the http_flag (preproc_specific data) bit so we don't log the event on a reassembled    **  stream.    */    if(p->ssnptr)    {        httpflags |= uiMask;        stream_api->set_application_data(p->ssnptr, PP_HTTPINSPECT,                        (void *)(uintptr_t)httpflags, NULL);    }    /*    **  Reset the event queue stack counter, in the case of pipelined    **  requests.    */    *(GenEvents.stack_count) = 0;    return 0;}static inline int SetSiInput(HI_SI_INPUT *SiInput, Packet *p){    IP_COPY_VALUE(SiInput->sip, GET_SRC_IP(p));    IP_COPY_VALUE(SiInput->dip, GET_DST_IP(p));    SiInput->sport = p->sp;    SiInput->dport = p->dp;    /*    **  We now set the packet direction    */    if(p->ssnptr &&        stream_api->get_session_flags(p->ssnptr) & SSNFLAG_MIDSTREAM)    {        SiInput->pdir = HI_SI_NO_MODE;    }    else if(p->packet_flags & PKT_FROM_SERVER)    {        SiInput->pdir = HI_SI_SERVER_MODE;    }    else if(p->packet_flags & PKT_FROM_CLIENT)    {        SiInput->pdir = HI_SI_CLIENT_MODE;    }    else    {        SiInput->pdir = HI_SI_NO_MODE;    }    return HI_SUCCESS;}/***  NAME**    SnortHttpInspect::*//****  This function calls the HttpInspect function that processes an HTTP **  session.****  We need to instantiate a pointer for the HI_SESSION that HttpInspect **  fills in.  Right now stateless processing fills in this session, which **  we then normalize, and eventually detect.  We'll have to handle **  separately the normalization events, etc.**  **  This function is where we can see from the highest level what the**  HttpInspect flow looks like.****  @param GlobalConf pointer to the global configuration**  @param p          pointer to the Packet structure****  @return integer****  @retval  0 function successfu

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产高清| 91精品欧美一区二区三区综合在| 欧美在线综合视频| 日本成人中文字幕| 国产精品成人在线观看| 欧美一区二区三区四区五区| jiyouzz国产精品久久| 另类小说欧美激情| 亚洲精品成人悠悠色影视| 精品少妇一区二区三区在线视频 | 亚洲一区二区三区在线看| 26uuu亚洲| 欧美电影一区二区| 色综合久久天天| 成人91在线观看| 国产一区在线看| 奇米精品一区二区三区四区| 一区二区成人在线视频| 国产精品色婷婷久久58| 久久一夜天堂av一区二区三区| 欧美日韩小视频| 色欧美日韩亚洲| 不卡电影一区二区三区| 国产福利一区二区三区视频在线| 日韩国产在线一| 亚洲一区二区欧美| 亚洲男人电影天堂| 国产精品欧美一区二区三区| 国产偷国产偷亚洲高清人白洁| 91精品免费在线| 4hu四虎永久在线影院成人| 91官网在线免费观看| 色综合天天综合网天天狠天天| 国产999精品久久久久久绿帽| 九九国产精品视频| 日本欧美在线看| 蜜乳av一区二区| 久久国产精品免费| 激情六月婷婷综合| 国模套图日韩精品一区二区| 国产米奇在线777精品观看| 国精产品一区一区三区mba视频 | 国产成人午夜精品5599| 国产自产视频一区二区三区| 国产在线乱码一区二区三区| 韩国女主播成人在线观看| 国产真实乱子伦精品视频| 国产精品99久久久久久似苏梦涵| 国产高清久久久久| 成人午夜在线播放| 99精品偷自拍| 欧美在线观看一区二区| 欧美午夜电影在线播放| 欧美一区二区视频在线观看2022 | 在线一区二区三区四区| 色香蕉成人二区免费| 欧美日韩午夜影院| 日韩一区二区三区四区| 久久久久久日产精品| 中文字幕欧美激情| 亚洲在线中文字幕| 青青草一区二区三区| 狠狠色丁香婷婷综合久久片| 国产成人精品综合在线观看 | 图片区小说区区亚洲影院| 免费成人性网站| 国产伦精品一区二区三区免费迷| 粉嫩绯色av一区二区在线观看| 91丨九色丨国产丨porny| 欧美日韩在线播放| 精品卡一卡二卡三卡四在线| 国产精品高潮久久久久无| 一区二区三区国产精华| 美女一区二区三区在线观看| 国产成人av资源| 91成人免费在线| 久久综合99re88久久爱| 亚洲图片你懂的| 青青草91视频| 成人动漫一区二区三区| 欧美性受xxxx| 国产午夜精品在线观看| 亚洲影视在线播放| 国产在线观看一区二区| 在线精品视频一区二区三四| 精品国产免费视频| 亚洲男人的天堂在线aⅴ视频| 免费成人小视频| 色偷偷88欧美精品久久久| 日韩精品一区二区三区视频| 亚洲日本一区二区| 国产在线精品视频| 欧美日韩视频不卡| 中文字幕一区二区三区精华液| 日韩电影一二三区| 91麻豆.com| 久久久久99精品一区| 午夜欧美2019年伦理| 成人avav影音| 337p粉嫩大胆色噜噜噜噜亚洲| 一区二区久久久久| 成人小视频在线观看| 精品电影一区二区| 亚洲第一狼人社区| 99re视频精品| 久久九九久久九九| 美国十次综合导航| 欧美色老头old∨ideo| 国产精品电影一区二区| 精品一区免费av| 欧美电影在线免费观看| 亚洲制服欧美中文字幕中文字幕| 成人免费av网站| 久久久三级国产网站| 琪琪久久久久日韩精品| 欧美色网一区二区| 一区二区三区在线播放| av中文字幕在线不卡| 中文在线一区二区| 国产99久久久精品| 久久网站热最新地址| 久久99国产精品麻豆| 91精品国产综合久久久蜜臀粉嫩| 亚洲超碰精品一区二区| 欧美三日本三级三级在线播放| 亚洲免费资源在线播放| 不卡欧美aaaaa| 国产精品电影一区二区| 99久久综合99久久综合网站| 国产精品网站在线| 成人一区二区三区视频在线观看| 久久一夜天堂av一区二区三区| 国内成+人亚洲+欧美+综合在线| 欧美岛国在线观看| 韩国欧美国产一区| 久久久一区二区| 国产精品一线二线三线| 欧美—级在线免费片| 成人美女视频在线观看| 国产精品水嫩水嫩| 99v久久综合狠狠综合久久| 综合久久久久久| 91麻豆成人久久精品二区三区| 一区二区在线观看视频| 欧美视频一区二区三区在线观看| 亚洲综合另类小说| 欧美午夜免费电影| 日本欧美在线看| 久久亚洲一级片| 白白色 亚洲乱淫| 1000部国产精品成人观看| 色婷婷av一区二区三区软件| 午夜电影网一区| 精品美女一区二区| 成人少妇影院yyyy| 亚洲色图清纯唯美| 欧美性生活大片视频| 免费成人美女在线观看| 国产校园另类小说区| 91蜜桃在线免费视频| 丝袜诱惑亚洲看片| 久久综合久久鬼色| 成人精品电影在线观看| 亚洲一区二区免费视频| 精品裸体舞一区二区三区| 丁香另类激情小说| 亚洲精品国产无天堂网2021| 91精品国产综合久久蜜臀| 国产白丝精品91爽爽久久| 亚洲码国产岛国毛片在线| 69久久夜色精品国产69蝌蚪网| 国产在线观看一区二区| 亚洲精品成人天堂一二三| 日韩一区二区三区在线观看| 成人小视频在线| 日韩国产在线观看| 中文字幕欧美激情| 91麻豆精品国产综合久久久久久| 国产乱色国产精品免费视频| 亚洲日本韩国一区| 日韩一区二区三区四区五区六区| av色综合久久天堂av综合| 日本午夜一区二区| 国产精品久久久久影院亚瑟| 在线综合+亚洲+欧美中文字幕| 成人一道本在线| 日韩av网站免费在线| 国产精品乱码一区二区三区软件| 欧美天堂一区二区三区| 国产成人高清视频| 日韩综合小视频| 亚洲欧美区自拍先锋| 久久蜜桃香蕉精品一区二区三区| 欧洲一区二区三区在线| 成人福利视频网站| 久久99国产精品久久99| 亚洲高清视频的网址| 国产农村妇女精品| 欧美一二三区在线| 一本久久a久久精品亚洲|