Skip to content

Commit

Permalink
snmp: adds test for community keyword
Browse files Browse the repository at this point in the history
as was done by unit test DetectSNMPCommunityTest
  • Loading branch information
catenacyber authored and victorjulien committed May 2, 2024
1 parent 71a9046 commit d878715
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/snmp-community/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test Purpose

Match on SNMP community keyword

## PCAP

This PCAP from snmp-v2c-get is reused, as was done in DetectSNMPCommunityTest for first packet
2 changes: 2 additions & 0 deletions tests/snmp-community/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert snmp any any -> any any (msg:"SNMP Test Rule"; snmp.community; content:"[R0_C@cti!]"; sid:1; rev:1;)
alert snmp any any -> any any (msg:"SNMP Test Rule"; snmp.community; content:"private"; sid:2; rev:1;)
14 changes: 14 additions & 0 deletions tests/snmp-community/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pcap: ../snmp-v2c-get/SNMPv2c_get_requests.pcap

checks:
- filter:
count: 8
match:
event_type: alert
alert.signature_id: 1

- filter:
count: 0
match:
event_type: alert
alert.signature_id: 2

0 comments on commit d878715

Please sign in to comment.