|
|
|
@ -88,11 +88,21 @@ int DetectEngineRunHttpCookieMpm(DetectEngineThreadCtx *det_ctx, Flow *f,
|
|
|
|
if (tx == NULL)
|
|
|
|
if (tx == NULL)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
htp_header_t *h = (htp_header_t *)table_getc(tx->request_headers,
|
|
|
|
htp_header_t *h = NULL;
|
|
|
|
"Cookie");
|
|
|
|
if (flags & STREAM_TOSERVER) {
|
|
|
|
if (h == NULL) {
|
|
|
|
h = (htp_header_t *)table_getc(tx->request_headers,
|
|
|
|
SCLogDebug("HTTP cookie header not present in this request");
|
|
|
|
"Cookie");
|
|
|
|
continue;
|
|
|
|
if (h == NULL) {
|
|
|
|
|
|
|
|
SCLogDebug("HTTP cookie header not present in this request");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
h = (htp_header_t *)table_getc(tx->response_headers,
|
|
|
|
|
|
|
|
"Set-Cookie");
|
|
|
|
|
|
|
|
if (h == NULL) {
|
|
|
|
|
|
|
|
SCLogDebug("HTTP Set-Cookie header not present in this request");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cnt += HttpCookiePatternSearch(det_ctx,
|
|
|
|
cnt += HttpCookiePatternSearch(det_ctx,
|
|
|
|
@ -153,11 +163,21 @@ int DetectEngineInspectHttpCookie(DetectEngineCtx *de_ctx,
|
|
|
|
if (tx == NULL)
|
|
|
|
if (tx == NULL)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
htp_header_t *h = (htp_header_t *)table_getc(tx->request_headers,
|
|
|
|
htp_header_t *h = NULL;
|
|
|
|
"Cookie");
|
|
|
|
if (flags & STREAM_TOSERVER) {
|
|
|
|
if (h == NULL) {
|
|
|
|
h = (htp_header_t *)table_getc(tx->request_headers,
|
|
|
|
SCLogDebug("HTTP cookie header not present in this request");
|
|
|
|
"Cookie");
|
|
|
|
continue;
|
|
|
|
if (h == NULL) {
|
|
|
|
|
|
|
|
SCLogDebug("HTTP cookie header not present in this request");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
h = (htp_header_t *)table_getc(tx->response_headers,
|
|
|
|
|
|
|
|
"Set-Cookie");
|
|
|
|
|
|
|
|
if (h == NULL) {
|
|
|
|
|
|
|
|
SCLogDebug("HTTP Set-Cookie header not present in this request");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
det_ctx->buffer_offset = 0;
|
|
|
|
det_ctx->buffer_offset = 0;
|
|
|
|
|