Skip to content

Commit

Permalink
tests/transform: from_base64 test
Browse files Browse the repository at this point in the history
Issue: 6487
  • Loading branch information
jlucovsky committed Feb 27, 2024
1 parent c0f84a0 commit 651c607
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/from_base64-01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from_base64 transform tests
5 changes: 5 additions & 0 deletions tests/from_base64-01/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# input pcap contains a query to http://home.regit.org/?arg=dGhpc2lzYXRlc3QK
# "dGhpc2lzYXRlc3QK" is "thisisatest"
alert http any any -> any any (msg:"from_base64: offset #1"; http.uri; content:"/?arg=dGhpc2lzYXRlc3QK"; from_base64: offset 6 ; content:"thisisatest"; sid:1; rev:1;)
alert http any any -> any any (msg:"from_base64: offset #2"; http.uri; content:"/?arg=dGhpc2lzYXRlc3QK"; from_base64: offset 10 ; content:"sisatest"; sid:2; rev:1;)
alert http any any -> any any (msg:"from_base64: bytes, offset #1"; http.uri; content:"/?arg=dGhpc2lzYXRlc3QK"; from_base64: bytes 6, offset 6 ; content:"this"; sid:3; rev:1;)
24 changes: 24 additions & 0 deletions tests/from_base64-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
requires:
min-version: 8

pcap: ../base64/input.pcap

args:
- -k none

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 3

0 comments on commit 651c607

Please sign in to comment.