Skip to content

Commit 1e61ec9

Browse files
glongovictorjulien
authored andcommitted
arp: add tests
1 parent 303c2da commit 1e61ec9

File tree

8 files changed

+92
-0
lines changed

8 files changed

+92
-0
lines changed

tests/decode-arp-2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PCAP from https://www.cloudshark.org/captures/e4d6ea732135/export

tests/decode-arp-2/arp.pcap

520 Bytes
Binary file not shown.

tests/decode-arp-2/suricata.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
%YAML 1.1
2+
---
3+
4+
outputs:
5+
- eve-log:
6+
enabled: yes
7+
filetype: regular
8+
filename: eve.json
9+
types:
10+
- arp:
11+
enabled: yes
12+

tests/decode-arp-2/test.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
requires:
2+
min-version: 8
3+
4+
pcap: arp.pcap
5+
6+
checks:
7+
- filter:
8+
count: 4
9+
match:
10+
event_type: arp
11+
- filter:
12+
count: 1
13+
match:
14+
event_type: arp
15+
pcap_cnt: 5
16+
arp.hw_type: ethernet
17+
arp.proto_type: ipv4
18+
arp.opcode: request
19+
arp.src_mac: 00:1d:09:f0:92:ab
20+
arp.src_ip: 10.10.10.1
21+
arp.dest_mac: 00:00:00:00:00:00
22+
arp.dest_ip: 10.10.10.2
23+
- filter:
24+
count: 1
25+
match:
26+
event_type: arp
27+
pcap_cnt: 6
28+
arp.hw_type: ethernet
29+
arp.proto_type: ipv4
30+
arp.opcode: reply
31+
arp.src_mac: 00:1a:6b:6c:0c:cc
32+
arp.src_ip: 10.10.10.2
33+
arp.dest_mac: 00:1d:09:f0:92:ab
34+
arp.dest_ip: 10.10.10.1
35+

tests/decode-arp-3/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Decode ARP packet over GRE.
2+
3+
PCAP made with the following scapy script:
4+
5+
```
6+
#!/usr/bin/env python
7+
from scapy.all import *
8+
9+
pkts = []
10+
11+
pkts += Ether(dst='05:04:03:02:01:00', src='00:01:02:03:04:05')/Dot1Q(vlan=6)/IP(src='1.1.1.1', dst='2.2.2.2')/GRE()/ARP()
12+
13+
wrpcap('arp-encap.pcap', pkts)
14+
```

tests/decode-arp-3/arp-encap.pcap

110 Bytes
Binary file not shown.

tests/decode-arp-3/suricata.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
%YAML 1.1
2+
---
3+
4+
outputs:
5+
- eve-log:
6+
enabled: yes
7+
filetype: regular
8+
filename: eve.json
9+
types:
10+
- arp:
11+
enabled: yes
12+

tests/decode-arp-3/test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pcap: arp-encap.pcap
2+
3+
requires:
4+
min-version: 8
5+
6+
checks:
7+
- filter:
8+
count: 1
9+
match:
10+
event_type: arp
11+
arp.hw_type: ethernet
12+
arp.proto_type: ipv4
13+
arp.opcode: request
14+
arp.src_mac: bc:03:58:5a:d5:ca
15+
arp.src_ip: 192.168.1.28
16+
arp.dest_mac: 00:00:00:00:00:00
17+
arp.dest_ip: 0.0.0.0
18+

0 commit comments

Comments
 (0)