Skip to content
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

Rework S7Comm dissector; add S7Comm Plus support #2165

Merged
merged 5 commits into from
Nov 27, 2023
Merged

Rework S7Comm dissector; add S7Comm Plus support #2165

merged 5 commits into from
Nov 27, 2023

Conversation

0xA50C1A1
Copy link
Contributor

Please sign (check) the below before submitting the Pull Request:

Describe changes:

Reworked the old S7Comm protocol dissector so it shouldn't give false positives now. Added support for the S7Comm Plus protocol under a new protocol id as it is completely different from classic S7Comm, the only similarity is that both use TPKT/COTP as transport.

"s7comm", NDPI_PROTOCOL_CATEGORY_NETWORK,
ndpi_build_default_ports(ports_a, 102, 0, 0, 0, 0) /* TCP */,
"S7Comm", NDPI_PROTOCOL_CATEGORY_IOT_SCADA,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TCP port 102 is assigned to the TSAP, so I set it to 0 to avoid false positives when guessing. Yea, S7Comm uses this port, but I left the check inside the dissector.

@0xA50C1A1
Copy link
Contributor Author

@IvanNardi could you please do a review? Btw, I can share the rest of my industrial/SCADA stuff as well if that would be useful.

@utoni
Copy link
Collaborator

utoni commented Nov 26, 2023

@IvanNardi could you please do a review? Btw, I can share the rest of my industrial/SCADA stuff as well if that would be useful.

That would be great. I was trying to implement more industrial/IoT protocols. But I do not have lot's of related PCAPs.

@0xA50C1A1
Copy link
Contributor Author

0xA50C1A1 commented Nov 26, 2023

@IvanNardi could you please do a review? Btw, I can share the rest of my industrial/SCADA stuff as well if that would be useful.

That would be great. I was trying to implement more industrial/IoT protocols. But I do not have lot's of related PCAPs.

Cool, then I'll go clean up my stuff and create pull requests

@IvanNardi
Copy link
Collaborator

@0xA50C1A1, could you rebase, please?

@IvanNardi
Copy link
Collaborator

@IvanNardi could you please do a review? Btw, I can share the rest of my industrial/SCADA stuff as well if that would be useful.

That would be great. I was trying to implement more industrial/IoT protocols. But I do not have lot's of related PCAPs.

+1

@0xA50C1A1
Copy link
Contributor Author

@0xA50C1A1, could you rebase, please?

Sure, but not all RRs at once 😃

Copy link

sonarcloud bot commented Nov 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@IvanNardi
Copy link
Collaborator

@0xA50C1A1, what do you think of my change?
The diff is cleaner; it is not the perfect solution but it should be good enough

@0xA50C1A1
Copy link
Contributor Author

@0xA50C1A1, what do you think of my change? The diff is cleaner; it is not the perfect solution but it should be good enough

Not bad. The number of dissector calls is reduced by 3 on average.

@IvanNardi IvanNardi merged commit 3763c70 into ntop:dev Nov 27, 2023
33 checks passed
@0xA50C1A1 0xA50C1A1 deleted the rework/s7comm branch November 27, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants