-
Notifications
You must be signed in to change notification settings - Fork 91
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
test: add test for dns.rcode #1563
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Test the `dns.rcode` sticky buffer. | ||
|
||
The PCAP here was a request created with Scapy to include answers in | ||
the request. However the response is from a real DNS server with the | ||
provided request. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Should alert in both directions as no flow is provided. | ||
alert dns any any -> any any (dns.rcode; content:"oisf"; sid:1; rev:1;) | ||
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. should it not be something like 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. and no content 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. Since it's an integer keyword ;) |
||
|
||
# Should only alert in the request direction. | ||
alert dns any any -> any any (dns.rcode; content:"oisf"; flow:to_server; sid:2; rev:1;) | ||
|
||
# Should only alert in the response direction. | ||
alert dns any any -> any any (dns.rcode; content:"oisf"; flow:to_client; sid:3; rev:1;) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
requires: | ||
min-version: 8 | ||
|
||
checks: | ||
- filter: | ||
count: 2 | ||
match: | ||
alert.signature_id: 1 | ||
app_proto: dns | ||
Comment on lines
+8
to
+9
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. it's important to add a check for the rcode field on the checks, too :) |
||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 1 | ||
direction: to_client | ||
app_proto: dns | ||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 1 | ||
direction: to_server | ||
app_proto: dns | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 2 | ||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 2 | ||
direction: to_server | ||
app_proto: dns | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 3 | ||
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. You can have only one filter per signature id, right ? |
||
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 3 | ||
direction: to_client | ||
app_proto: dns |
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.
Please add a reference to the redmine ticket :)
If you do re-use a pcap from a different test, you can indicate that here, too.