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.
🗣 Description
These changes create a new log file 's7comm_known_devices.log' which contains s7comm device identification information obtained from the s7comm protocol.
💭 Motivation and context
In relation to OT Network Detection and Response, device and asset enumeration obtained by passive network inspection can be a good tool to monitor network devices. Baselining on identification strings allow alerting on unintentional changes in e.g. firmware.
This code adds additional binpac structures to more obtain the information in question.
🧪 Testing
A test trace has been added to the repository and I have done field testing in a few OT environments.
An existing testcase fails after my change but I believe the new parsing is more accurate than the original one. According to my analysis, the original parser incorrectly parsed a packet leading to an extra log line.
Feel free to contact me to discuss.