@ -2290,8 +2290,10 @@ static int SigTest41aTestNegatedContent(void)
*thenegatedcontentwithinthespecifieddepth
*/
staticintSigTest42TestNegatedContent(void)
{// 01 5 10 15 20 24
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:!\"twentythree\"; depth:22; offset:35; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
{
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:!\"eeeeeeeeeee\"; depth:22; offset:35; sid:1;)",
@ -2303,7 +2305,9 @@ static int SigTest42TestNegatedContent(void)
*/
staticintSigTest43TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:!\"twentythree\"; depth:34; offset:23; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:!\"eeeeeeeeeee\"; depth:34; offset:23; sid:1;)",
@ -2313,7 +2317,9 @@ static int SigTest43TestNegatedContent(void)
*/
staticintSigTest44TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:!\"twentythree\"; offset:40; depth:35; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:!\"eeeeeeeeeee\"; offset:40; depth:35; sid:1;)",
@ -2322,7 +2328,9 @@ static int SigTest44TestNegatedContent(void)
*/
staticintSigTest45TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; depth:5; content:!\"twentythree\"; depth:23; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:5; "
@ -2331,7 +2339,9 @@ static int SigTest45TestNegatedContent(void)
*/
staticintSigTest46TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"onee\"; content:!\"twentythree\"; depth:23; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaaE\"; "
@ -2341,7 +2351,9 @@ static int SigTest46TestNegatedContent(void)
*/
staticintSigTest47TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; offset:5; content:!\"twentythree\"; depth:23; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; offset:5; "
@ -2350,7 +2362,10 @@ static int SigTest47TestNegatedContent(void)
*/
staticintSigTest48TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"GET\"; content:!\"GES\"; within:26; sid:1;)",(uint8_t*)"GET /one/ HTTP/1.1\r\n Host: one.example.org\r\n\r\n\r\nGET /two/ HTTP/1.1\r\nHost: two.example.org\r\n\r\n\r\n");
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:\"GET\"; content:!\"GES\"; within:26; sid:1;)",
@ -2359,7 +2374,10 @@ static int SigTest48TestNegatedContent(void)
*/
staticintSigTest49TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"GET\"; content:!\"Host\"; within:26; sid:1;)",(uint8_t*)"GET /one/ HTTP/1.1\r\n Host: one.example.org\r\n\r\n\r\nGET /two/ HTTP/1.1\r\nHost: two.example.org\r\n\r\n\r\n");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:\"GET\"; content:!\"Host\"; within:26; sid:1;)",
@ -2368,7 +2386,10 @@ static int SigTest49TestNegatedContent(void)
*/
staticintSigTest50TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"GET\"; content:!\"GES\"; distance:25; sid:1;)",(uint8_t*)"GET /one/ HTTP/1.1\r\n Host: one.example.org\r\n\r\n\r\nGET /two/ HTTP/1.1\r\nHost: two.example.org\r\n\r\n\r\n");
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:\"GET\"; content:!\"GES\"; distance:25; sid:1;)",
@ -2389,7 +2410,10 @@ static int SigTest51TestNegatedContent(void)
*/
staticintSigTest52TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"GES\"; content:!\"BOO\"; sid:1;)",(uint8_t*)"GET /one/ HTTP/1.1\r\n Host: one.example.org\r\n\r\n\r\nGET /two/ HTTP/1.1\r\nHost: two.example.org\r\n\r\n\r\n");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:\"GES\"; content:!\"BOO\"; sid:1;)",
@ -2398,7 +2422,9 @@ static int SigTest52TestNegatedContent(void)
*/
staticintSigTest53TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:!\"fourty\"; within:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:\"aaa\"; content:!\"Ggggg\"; within:56; sid:1;)",
@ -2407,7 +2433,9 @@ static int SigTest53TestNegatedContent(void)
*/
staticintSigTest54TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:!\"fourty\"; within:20; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; "
@ -2416,7 +2444,9 @@ static int SigTest54TestNegatedContent(void)
*/
staticintSigTest55TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:!\"one\"; depth:5; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:!\"aaa\"; depth:5; sid:1;)",
@ -2425,7 +2455,9 @@ static int SigTest55TestNegatedContent(void)
*/
staticintSigTest56TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:\"fourty\"; within:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:\"aaa\"; content:\"Ggggg\"; within:56; sid:1;)",
@ -2434,7 +2466,9 @@ static int SigTest56TestNegatedContent(void)
*/
staticintSigTest57TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:!\"fourty\"; within:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:\"aaa\"; content:!\"Ggggg\"; within:56; sid:1;)",
@ -2443,7 +2477,9 @@ static int SigTest57TestNegatedContent(void)
*/
staticintSigTest58TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:!\"fourty\"; distance:57; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; "
@ -2452,92 +2488,124 @@ static int SigTest58TestNegatedContent(void)
*/
staticintSigTest59TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; content:!\"fourty\"; distance:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:!\"one\"; content:\"fourty\"; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:!\"aaa\"; content:\"Ggggg\"; sid:1;)",
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
/** \test Test negation in combination with within and depth
*
*Matchof"one"atoffset:0,depth:3
*Matchof"fourty"atoffset:46,depth:52
*Matchof"aaa"atoffset:0,depth:3
*Matchof"Gggggg"atoffset:46,depth:52
*
*Thissignatureshouldnotmatchforthetesttopass.
*/
staticintSigTest62TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:49; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; depth:10; content:!\"fourty\"; within:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
/** \test Test negation in combination with within and depth
*
*Matchof"one"atoffset:0,depth:3
*Matchof"fourty"atoffset:46,depth:52
*Matchof"aaa"atoffset:0,depth:3
*Matchof"gggggg"atoffset:46,depth:52
*
*Thissignatureshouldnotmatchforthetesttopass.
*/
staticintSigTest65TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; distance:0; within:49; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"four\"; within:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:10; "
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:\"nine\"; offset:8; content:!\"fourty\"; within:28; content:\"fiftysix\"; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent(
"alert tcp any any -> any any (content:\"aaa\"; depth:10; content:\"cccc\"; offset:8; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:\"nine\"; offset:8; content:!\"fourty\"; within:48; content:\"fiftysix\"; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent(
"alert tcp any any -> any any (content:\"aaa\"; depth:10; content:\"cccc\"; offset:8; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; content:!\"fourty\"; within:52; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; content:!\"fourty\"; within:40; distance:43; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; content:!\"fourty\"; within:49; distance:43; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; "
returnSigTestNegativeTestContent("alert tcp any any -> any any (msg:\"HTTP URI cap\"; content:\"one\"; depth:5; content:!\"twentythree\"; depth:35; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"aaa\"; depth:5; "