-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
smb: New keyword smb.cmd v8 #7404
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7404 +/- ##
==========================================
- Coverage 75.94% 75.80% -0.14%
==========================================
Files 656 657 +1
Lines 189916 189956 +40
==========================================
- Hits 144233 144004 -229
- Misses 45683 45952 +269
Flags with carried forward coverage won't be shown. Click here to find out more. |
================================ ======================== | ||
SMB2 Command Name Code | ||
================================ ======================== | ||
SMB2_COMMAND_NEGOTIATE_PROTOCOL 0x00 |
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 we have a extra column instead of the double rows per value? So something like
SMB2 command name code short name
==================================== ==== =========
SMB2_COMMAND_NEGOTIATE_PROTOCOL 0x00 negotiate
|
||
You can also specify several commands separated by comma:: | ||
|
||
alert smb any any -> any any (msg: "Smb command rule"; smb.cmd: 10,create,0x4; sid: 1;) |
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.
what is the logic here? A command can only be one thing, so it matches as if 10 or create or 0x4
?
One concern I have is around expectations of matching each record on the wire vs the "transaction" representation we have in Suricata, that are not necessarily a 1 on 1 mapping with records. So a rule writer will look at a pcap and then expect this keyword to match on each smb record, but it won't. Maybe this would make more sense to use the new (and in development) frames API. This is designed to work on the record/frame level, w/o the higher level TX abstraction overhead. Currently you could do a |
Closing due to inactivity. If you're interested in picking this back up, please open a new PR addressing the comments. Thanks! |
Make sure these boxes are signed before submitting your Pull Request -- thank you.
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/5069
Describe changes:
Example of rule
alert smb any any -> any any (msg: "Smb command rule"; smb.cmd: 10; sid: 1;)
. More examples in documentation.suricata-verify-pr: 733