-
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
test/ftp: FTP command tests #2242
Open
jlucovsky
wants to merge
1
commit into
OISF:master
Choose a base branch
from
jlucovsky:7052/1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+96
−0
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
alert ftp any any -> any any (msg: "Match on FTP command PASS"; flow:to_server; ftp.command; content:"PASS"; sid:1;) | ||
alert ftp any any -> any any (msg: "Match on FTP command USER"; flow:to_server; ftp.command; content:"USER"; sid:2;) | ||
alert ftp any any -> any any (msg: "Match on FTP command NLST"; flow:to_server; ftp.command; content:"NLST"; sid:3;) | ||
alert ftp any any -> any any (msg: "Match on FTP command PORT"; flow:to_server; ftp.command; content:"PORT"; sid:4;) | ||
alert ftp any any -> any any (msg: "Match on FTP command RETR"; flow:to_server; ftp.command; content:"RETR"; sid:5;) | ||
alert ftp any any -> any any (msg: "Match on FTP command QUIT"; flow:to_server; ftp.command; content:"QUIT"; sid:6;) | ||
|
||
# Wrong direction -- won't match | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"PASS"; sid:10;) | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"USER"; sid:20;) | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"NLST"; sid:30;) | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"PORT"; sid:40;) | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"RETR"; sid:50;) | ||
#alert ftp any any -> any any (flow:to_client; ftp.command; content:"QUIT"; sid:60;) |
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,49 @@ | ||
pcap: ../../bug-3519/input.pcap | ||
|
||
requires: | ||
version: 8 | ||
|
||
|
||
checks: | ||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
ftp.command: USER | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
ftp.command: PASS | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
ftp.command: NLST | ||
|
||
- filter: | ||
count: 2 | ||
match: | ||
event_type: alert | ||
ftp.command: PORT | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
ftp.command: RETR | ||
|
||
- filter: | ||
count: 1 | ||
match: | ||
event_type: alert | ||
ftp.command: QUIT | ||
|
||
- filter: | ||
count: 0 | ||
match: | ||
event_type: alert | ||
signature_id: 10 | ||
|
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 @@ | ||
# Wrong direction -- won't load | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"PASS"; sid:10;) | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"USER"; sid:20;) | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"NLST"; sid:30;) | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"PORT"; sid:40;) | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"RETR"; sid:50;) | ||
alert ftp any any -> any any (flow:to_client; ftp.command; content:"QUIT"; sid:60;) |
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,26 @@ | ||
pcap: ../../bug-3519/input.pcap | ||
|
||
requires: | ||
version: 8 | ||
|
||
exit-code: 1 | ||
|
||
checks: | ||
- shell: | ||
args: grep "rule 10 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 | ||
- shell: | ||
args: grep "rule 20 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 | ||
- shell: | ||
args: grep "rule 30 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 | ||
- shell: | ||
args: grep "rule 40 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 | ||
- shell: | ||
args: grep "rule 50 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 | ||
- shell: | ||
args: grep "rule 60 mixes keywords with conflicting directions" suricata.log | wc -l | xargs | ||
expect: 1 |
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.
can you add the
alert.signature_id
checks here as well? Want to make sure the correct sig matches in each case