From e13b11a9062b8e4222be5b19088c2edc4052c35e Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Sat, 22 Jun 2019 14:38:43 +0530 Subject: [PATCH] Add test for uricontent matching regression Closes redmine ticket #3055. --- tests/bug-78-uricontent/README | 4 ++ tests/bug-78-uricontent/input.pcap | Bin 0 -> 6292 bytes tests/bug-78-uricontent/test.rules | 1 + tests/bug-78-uricontent/test.yaml | 68 +++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 tests/bug-78-uricontent/README create mode 100644 tests/bug-78-uricontent/input.pcap create mode 100644 tests/bug-78-uricontent/test.rules create mode 100644 tests/bug-78-uricontent/test.yaml diff --git a/tests/bug-78-uricontent/README b/tests/bug-78-uricontent/README new file mode 100644 index 000000000..11f678866 --- /dev/null +++ b/tests/bug-78-uricontent/README @@ -0,0 +1,4 @@ +This test is for regression matching with uricontent. In order to make suricata-verify more robust, +it is good to add tests for issues that existed before suricata-verify did. +There was a bug introduced in the early stages https://redmine.openinfosecfoundation.org/issues/78, +the pcap and signature mentioned in the bug report has been used to create this test. diff --git a/tests/bug-78-uricontent/input.pcap b/tests/bug-78-uricontent/input.pcap new file mode 100644 index 0000000000000000000000000000000000000000..6af7504c7019a865318e30824d891cbdf569459e GIT binary patch literal 6292 zc-pO4UuYx88Q1yl(xBE5N-23NQ#p6sCDN`|mSuURRnBpIJ}0@0gPr8^5X|iENSgER z&fe}wvLi%88$ux^git7b>ZMR<0_j5=Xz5GR2Kv@C&?bbYh5UJFxzdOBsT7*)H#58P zO1AG35`)&ev)}yYo8R|$_D^sA{H2-PiCp@3<3=ub4E}%ce*Wb_n_u<=ftGQhB+Uw_X=WhGxt~Y)HmH&gs;tf{q55G zx!lZ&ldqkaxjldEUr$D2{Mhm1UlPdS%Nb;esqhu@%M0gn_1ixDnLrijxs4ZIT%q6n z2+-fU_SG9VzK0YtpdAAT4Y7hi{sAE02cY*IrgQb$8&cs9|W;+5EEOkPrs%*6*IpUtlrZ4h93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YkDj<34 zunKDoVjrzZA#{QH1P&|I@1QtxtU?m8y2m1y@OQUMQm^MJy~p;p0|O92~17#N~K z*yBhX-Yj)UQFM1bv0M)n18$C#632~HP9E)#7NujsiF05^S`=+1dliY|WmOGvj`m2< zfxSXisHX^HV{JgZ$*!z+~gi3VYO+uCO;)4!%&O`7XcrW^I27!3ZE;|ln2wo z9?W5b?E#Jgn5MFW;$zHDHQi;kg|@l`g+k#H0@bH-lME->N0gAuNDLe2BJ+Rp&KFTX zPQE*nTRonWzv=pMeDM`m)Q`VDGg&`=_`a+kccN#%m7lC1i0smsYY0hN?C1-jc(d05 zPGy}jn?0}9^k{3POPn3Vfwwq>$uJSIwtNQAh{Q44V?CJ#Tp_;Rmd`i>c}_hKb#Y(J zfi?it^5Y^3q4dP$R%I{lh2mI{7Iy51jman#BjavDJP>Lf-kr*~&~IE;DAWS8ZnuTA zZpY&d%Xbc!pVpw#m3pxnaiM7uH+|w-<(1|2N5al3TV5`-qOX(56pv8P@h7^gGu-GKwemQQyg)HR~)&D{0i&rY2x!^ x0TQQtI$9?iY?;U|i~FSbEBcbOA)6QJ*eQp)I5vngg!nY7J~@Bo-On4E{|9&|Q;Glp literal 0 Hc-jL100001 diff --git a/tests/bug-78-uricontent/test.rules b/tests/bug-78-uricontent/test.rules new file mode 100644 index 000000000..3e3897184 --- /dev/null +++ b/tests/bug-78-uricontent/test.rules @@ -0,0 +1 @@ +alert tcp any any -> any any (msg:"msg escape tests"; uricontent:"blah"; sid: 100;) diff --git a/tests/bug-78-uricontent/test.yaml b/tests/bug-78-uricontent/test.yaml new file mode 100644 index 000000000..765abc885 --- /dev/null +++ b/tests/bug-78-uricontent/test.yaml @@ -0,0 +1,68 @@ +requires: + features: + - HAVE_LIBJANSSON + +args: + - -k none + +checks: +- filter: + count: 1 + match: + alert.action: allowed + alert.signature: msg escape tests + alert.signature_id: 100 + app_proto: http + dest_ip: 208.69.36.231 + dest_port: 80 + event_type: alert + flow: + bytes_toclient: 1588 + bytes_toserver: 379 + pkts_toclient: 2 + pkts_toserver: 4 + start: 2009-10-16T16:44:16.083524+0000 + http: + hostname: www.google.com + http_content_type: text/html + http_method: GET + http_user_agent: Wget/1.11.4 + length: 1194 + protocol: HTTP/1.0 + status: 404 + url: /blah/ + pcap_cnt: 6 + proto: TCP + src_ip: 192.168.2.3 + src_port: 37010 + tx_id: 0 +- filter: + count: 1 + match: + app_proto: http + dest_ip: 208.69.36.231 + dest_port: 80 + event_type: flow + flow: + age: 0 + alerted: true + bytes_toclient: 5453 + bytes_toserver: 607 + end: 2009-10-16T16:44:16.185868+0000 + pkts_toclient: 5 + pkts_toserver: 8 + reason: shutdown + start: 2009-10-16T16:44:16.083524+0000 + state: closed + proto: TCP + src_ip: 192.168.2.3 + src_port: 37010 + tcp: + ack: true + psh: true + rst: true + state: closed + syn: true + tcp_flags: 1e + tcp_flags_tc: 1a + tcp_flags_ts: 1e -- 2.47.2