-
Notifications
You must be signed in to change notification settings - Fork 105
Mqtt frames v6 #1177
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
Closed
Closed
Mqtt frames v6 #1177
Changes from all commits
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 hidden or 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 @@ | ||
| Description | ||
| =========== | ||
| Test MQTT frames[Pdu, Header, Data] for truncated messages where msg_len > max_msg_size. | ||
|
|
||
| PCAP | ||
| ==== | ||
| PCAP was shared by Sascha Steinbiss and was generated by setting up a Mosquitto server and recording communication between `mosquitto_sub` client and `local_broker` via a script. | ||
|
|
||
| Redmine ticket | ||
| ============== | ||
| https://redmine.openinfosecfoundation.org/issues/5731 |
Binary file not shown.
This file contains hidden or 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,18 @@ | ||
| %YAML 1.1 | ||
| --- | ||
|
|
||
| outputs: | ||
| - eve-log: | ||
| enabled: yes | ||
| filetype: regular | ||
| filename: eve.json | ||
| types: | ||
| - mqtt | ||
| - alert | ||
| - frame | ||
|
|
||
| app-layer: | ||
| protocols: | ||
| mqtt: | ||
| enabled: yes | ||
| max-msg-length: 60 |
This file contains hidden or 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 @@ | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 1"; frame:pdu; content:"|10 1c|"; startswith; sid:1;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 2"; frame:pdu; content:"|14|"; endswith; sid:2;) | ||
|
|
||
| alert mqtt any any -> any any (msg:"mqtt Frame 3"; frame:header; content:"|10|"; sid:3;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 4"; frame:header; content:"|10 1c|"; sid:4;) | ||
|
|
||
| alert mqtt any any -> any any (msg:"mqtt Frame 5"; frame:pdu; content:"|17 0C E2|"; sid:5;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 6"; frame:pdu; content:"|00 00 54 46|"; sid:6;) | ||
|
|
||
| # pre-boundary test for truncated data | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 7"; frame:data; content:"|0a|"; sid:7;) | ||
|
|
||
| # At boundary test for truncated data | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 8"; frame:data; content:"|51|"; sid:8;) | ||
|
|
||
| # post-boundary test for truncated data | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 9"; frame:data; content:"|c1 90 34|"; sid:9;) | ||
This file contains hidden or 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,51 @@ | ||
| requires: | ||
| min-version: 7 | ||
|
|
||
| args: | ||
| - -k none | ||
|
|
||
| checks: | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 1 | ||
| frame.type: "pdu" | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 2 | ||
| frame.type: "pdu" | ||
| frame.complete: true | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 3 | ||
| frame.type: "header" | ||
| frame.complete: true | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 4 | ||
| frame.type: "header" | ||
| frame.length: 2 | ||
| frame.complete: true | ||
| - filter: | ||
| count: 0 | ||
| match: | ||
| alert.signature_id: 5 | ||
| - filter: | ||
| count: 0 | ||
| match: | ||
| alert.signature_id: 6 | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 7 | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 8 | ||
| - filter: | ||
| count: 0 | ||
| match: | ||
| alert.signature_id: 9 |
This file contains hidden or 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 @@ | ||
| Description | ||
| =========== | ||
| Test MQTT frames[Pdu, Header, Data]. | ||
|
|
||
| PCAP | ||
| ==== | ||
| PCAP comes from the suricata verify test[mqtt5-pub-userpass] | ||
|
|
||
| Redmine ticket | ||
| ============== | ||
| https://redmine.openinfosecfoundation.org/issues/5731 |
This file contains hidden or 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 @@ | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 1"; frame:pdu; content:"|10 2f 00|"; startswith; sid:1;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 2"; frame:pdu; content:"|61 73 73|"; endswith; sid:2;) | ||
|
|
||
| alert mqtt any any -> any any (msg:"mqtt Frame 3"; flow:to_server; frame:header; content:"|10|"; sid:3;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 4"; frame:header; content:"|20|"; sid:4;) | ||
|
|
||
| alert mqtt any any -> any any (msg:"mqtt Frame 5"; frame:pdu; content:"|17 0C E2|"; sid:5;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 6"; frame:pdu; content:"|00 00 54 46|"; sid:6;) | ||
|
|
||
| alert mqtt any any -> any any (msg:"mqtt Frame 7"; frame:data; content:"|00 00 03 22|"; startswith; sid:7;) | ||
| alert mqtt any any -> any any (msg:"mqtt Frame 8"; frame:data; content:"|00 06|"; sid:8;) |
This file contains hidden or 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,54 @@ | ||
| pcap: ../mqtt5-pub-userpass/input.pcap | ||
|
|
||
| requires: | ||
| min-version: 7 | ||
|
|
||
| args: | ||
| - -k none | ||
|
|
||
| checks: | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 1 | ||
| frame.type: "pdu" | ||
| frame.length: 49 | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 2 | ||
| frame.type: "pdu" | ||
| frame.complete: true | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 3 | ||
| frame.type: "header" | ||
| frame.complete: true | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 4 | ||
| frame.type: "header" | ||
| frame.length: 2 | ||
| frame.complete: true | ||
| - filter: | ||
| count: 0 | ||
| match: | ||
| alert.signature_id: 5 | ||
| - filter: | ||
| count: 0 | ||
| match: | ||
| alert.signature_id: 6 | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 7 | ||
| frame.type: "data" | ||
| frame.complete: true | ||
| - filter: | ||
| count: 1 | ||
| match: | ||
| alert.signature_id: 8 | ||
| frame.type: "data" | ||
| frame.complete: true |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Following the conversation from the last PR. ref #1172 (comment)
I meant that one byte is generally not a unique indicator of the data.
|51|only occur once in the entire pcap?|51|byte? A unique sequence is usually a much better indicator. So, you could have say three or two bytes before this|51|to make sure it is the exact sequence that you intended to match with.