Update SMB parser to support IPv6 addresses#1584
Open
LaurenceJJones wants to merge 3 commits intocrowdsecurity:masterfrom
Open
Update SMB parser to support IPv6 addresses#1584LaurenceJJones wants to merge 3 commits intocrowdsecurity:masterfrom
LaurenceJJones wants to merge 3 commits intocrowdsecurity:masterfrom
Conversation
- Changed pattern from ipv4 to ipv\d to support both IPv4 and IPv6 - Added missing SMB_AUTH_FAIL pattern for NT_STATUS_NO_SUCH_USER status - Made port number mandatory in pattern to help with IPv6 boundary detection - Added IPv6 test cases with private IPv6 addresses (fd00::/8) - Updated parser.assert with test results
LaurenceJJones
commented
Nov 24, 2025
- Changed pattern to use DATA instead of IP pattern to capture IP:port - Use Go-style slicing with lastIndexOf() to extract IP address - This approach handles both IPv4 and IPv6 addresses correctly - Updated parser.assert with test results
- Removed SMB_IP_PORT custom pattern - Use standard DATA pattern for ip_source_with_port extraction - Extract IP using lastIndexOf expression to handle IPv6 addresses with ports - Pattern now works correctly for both IPv4 and IPv6 addresses
c6335e7 to
0cd4943
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
link to #1567
Description
Checklist