Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/arp/detect-arp-01/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert arp any any -> any any (sid:1;)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we test that alert ip does not alert on ARP packets ?

11 changes: 11 additions & 0 deletions tests/arp/detect-arp-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
requires:
min-version: 9

pcap: ../../decode-arp-1/input.pcap

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
1 change: 1 addition & 0 deletions tests/arp/detect-arp-02-ethhdr/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert ether any any -> any any (ether.hdr; content:"|08 06|"; offset:12; depth:2; sid:1;)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a ticket for the ether.type keyword ?

11 changes: 11 additions & 0 deletions tests/arp/detect-arp-02-ethhdr/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
requires:
min-version: 9

pcap: ../../decode-arp-1/input.pcap

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
Binary file added tests/arp/detect-arp-03-vlan/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/arp/detect-arp-03-vlan/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert arp any any -> any any (sid:1;)
9 changes: 9 additions & 0 deletions tests/arp/detect-arp-03-vlan/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
requires:
min-version: 9

checks:
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 1
22 changes: 22 additions & 0 deletions tests/arp/detect-arp-03-vlan/writepcap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
from scapy.all import *

pkts = []

# VLAN tagged packet
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
Dot1Q(vlan=6)/ \
ARP()

# Double-tagged VLAN (QinQ) packet
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
Dot1Q(vlan=1)/Dot1Q(vlan=10)/ \
ARP()

# Triple-tagged VLAN (QinQinQ) packet
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
Dot1Q(vlan=1)/Dot1Q(vlan=10)/Dot1Q(vlan=100)/ \
ARP()

wrpcap('input.pcap', pkts)

9 changes: 9 additions & 0 deletions tests/arp/detect-arp-04-vxlan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Description

Test VXLAN decoding and ARP/Ethernet matching

# PCAP

Extracted from:

https://github.com/the-tcpdump-group/tcpdump/blob/master/tests/vxlan.pcap
2 changes: 2 additions & 0 deletions tests/arp/detect-arp-04-vxlan/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert arp any any -> any any (sid:1;)
alert ether any any -> any any (ether.hdr; content:"|08 00|"; offset:12; depth:2; sid:2;)
16 changes: 16 additions & 0 deletions tests/arp/detect-arp-04-vxlan/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
requires:
min-version: 9

checks:
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 1
pkt_src: vxlan encapsulation
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 2
pkt_src: "wire/pcap"
Binary file added tests/arp/detect-arp-04-vxlan/vxlan-arp.pcap
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/ipv6-evasion/ipv6-atomic-fragments-toobig/test.rules
Original file line number Diff line number Diff line change
@@ -1 +1 @@
alert pkthdr any any -> any any (msg:"SURICATA IPv6 atomic fragment"; icmpv6.mtu:<1280; sid:1;)
alert ipv6 any any -> any any (msg:"SURICATA IPv6 atomic fragment"; icmpv6.mtu:<1280; sid:1;)
Loading