-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: linktype_name test #2006
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Ensure Cisco HDLC packets are decoded and the linktype name is correct | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular #regular|syslog|unix_dgram|unix_stream|redis | ||
filename: eve.json | ||
types: | ||
- alert: | ||
packet: yes # enable dumping of packet (without stream segments) | ||
- http: | ||
extended: true | ||
- files: | ||
force-magic: no | ||
- flow | ||
- stats | ||
app-layer: | ||
protocols: | ||
http: | ||
enabled: yes | ||
libhtp: | ||
default-config: | ||
response-body-limit: 100kb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert http any any -> any any (http.method; content:"GET"; sid:666;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
requires: | ||
|
||
min-version: 8 | ||
|
||
pcap: ../decode-chdlc-01/hdlc-http_1tx.pcap | ||
|
||
checks: | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: http | ||
http.hostname: "view.atdmt.com" | ||
http.status: 200 | ||
http.length: 8079 | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: fileinfo | ||
fileinfo.state: CLOSED | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
alert.signature_id: 666 | ||
packet_info.linktype_name: C_HDLC | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: flow | ||
proto: TCP | ||
|
||
- stats: | ||
decoder.ipv4: 17 | ||
decoder.chdlc: 17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular #regular|syslog|unix_dgram|unix_stream|redis | ||
filename: eve.json | ||
types: | ||
- alert: | ||
packet: yes # enable dumping of packet (without stream segments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert tcp any any -> any any (dsize:1000; sid:1;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
requires: | ||
min-version: 8 | ||
|
||
pcap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FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQQ==" | ||
packet_info.linktype: 229 | ||
packet_info.linktype_name: IPV6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you have added a check in tests/defrag/bug-6887-defrag-ipv6-tcp-01 ? Rather than creating a new test ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Test the IP options and verify the linktype name value. | ||
|
||
There's already a test for the extended security option; the following IP options are tested: | ||
- Record Route "rr" | ||
- Loose source route "lsrr" | ||
- EOL "eol" | ||
- NOP "nop" | ||
- Timestamp "ts" | ||
- Security "sec" | ||
- Strict source route "ssrr" | ||
- Stream id "satid" | ||
|
||
The pcap was generated using detect-ipopts/ipopt.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular #regular|syslog|unix_dgram|unix_stream|redis | ||
filename: eve.json | ||
types: | ||
- alert: | ||
packet: yes # enable dumping of packet (without stream segments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
alert ip any any -> any any (msg:"RR option set"; ipopts:rr; sid: 1;) | ||
alert ip any any -> any any (msg:"LSRR option set"; ipopts:lsrr; sid: 2;) | ||
alert ip any any -> any any (msg:"EOL option set"; ipopts:eol; sid: 3;) | ||
alert ip any any -> any any (msg:"NOP option set"; ipopts:nop; sid: 4;) | ||
alert ip any any -> any any (msg:"TS option set"; ipopts:ts; sid: 5;) | ||
alert ip any any -> any any (msg:"SEC option set"; ipopts:sec; sid: 6;) | ||
alert ip any any -> any any (msg:"SSRR option set"; ipopts:ssrr; sid: 7;) | ||
alert ip any any -> any any (msg:"SID option set"; ipopts:satid; sid: 8;) | ||
# covered in ipopts-sec | ||
#alert ip any any <> any any (msg:"ESEC option set"; ipopts:esec; sid: 42;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
requires: | ||
min-version: 8 | ||
|
||
args: | ||
- --set stream.midstream=true -k none | ||
|
||
pcap: ../detect-ipopts/input.pcap | ||
|
||
checks: | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 1 | ||
alert.signature_id: 1 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 2 | ||
alert.signature_id: 2 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 6 | ||
match: | ||
event_type: alert | ||
alert.signature_id: 3 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 4 | ||
alert.signature_id: 4 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 5 | ||
alert.signature_id: 5 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 6 | ||
alert.signature_id: 6 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 7 | ||
alert.signature_id: 7 | ||
packet_info.linktype_name: IPV4 | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
pcap_cnt: 8 | ||
alert.signature_id: 8 | ||
packet_info.linktype_name: IPV4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Description | ||
|
||
Test dnp3_obj rule keyword and that the linktype name is valid. | ||
|
||
# PCAP | ||
|
||
The pcap comes from dnp3-dnp3_data-alert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular | ||
filename: eve.json | ||
types: | ||
- alert: | ||
payload: yes | ||
packet: yes | ||
dnp3: yes | ||
|
||
app-layer: | ||
protocols: | ||
dnp3: | ||
enabled: yes | ||
detection-ports: | ||
dp: 20000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alert dnp3 any any -> any any (msg:"SURICATA DNP3 Object Test"; dnp3_obj:22,01; sid:1; rev:1;) | ||
alert dnp3 any any -> any any (msg:"SURICATA DNP3 Object Test"; dnp3_obj:29,01; sid:2; rev:1;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pcap: ../dnp3-eve/input.pcap | ||
|
||
requires: | ||
min-version: 8 | ||
|
||
checks: | ||
- filter: | ||
count: 4 | ||
match: | ||
event_type: alert | ||
alert.signature_id: 1 | ||
packet_info.linktype_name: EN10MB | ||
- filter: | ||
count: 0 | ||
match: | ||
event_type: alert | ||
alert.signature_id: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular #regular|syslog|unix_dgram|unix_stream|redis | ||
filename: eve.json | ||
types: | ||
- alert: | ||
packet: yes # enable dumping of packet (without stream segments) | ||
- flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert tcp any any -> any any (content:"Hello!"; sid:1;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pcap: ../tcp-fastopen-05/tfo.pcap | ||
|
||
requires: | ||
min-version: 8 | ||
|
||
args: | ||
- -k none | ||
|
||
checks: | ||
- filter: | ||
count: 2 | ||
match: | ||
event_type: alert | ||
alert.signature_id: 1 | ||
packet_info.linktype_name: LINUX_SLL | ||
- filter: | ||
count: 2 | ||
match: | ||
event_type: flow | ||
proto: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Description | ||
|
||
Test basic VXLAN decoding | ||
|
||
# PCAP | ||
|
||
https://github.com/the-tcpdump-group/tcpdump/blob/master/tests/vxlan.pcap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular #regular|syslog|unix_dgram|unix_stream|redis | ||
filename: eve.json | ||
types: | ||
- alert: | ||
packet: yes # enable dumping of packet (without stream segments) | ||
- flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert icmp any any -> any any (itype:8; sid:1;) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not changed but for white spaces, is it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the only changes were whitespace related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep it as before then ?