Skip to content

Add new dissector for iris protocol#3179

Merged
IvanNardi merged 7 commits into
ntop:devfrom
BryanProg:add_iris_protocol
May 11, 2026
Merged

Add new dissector for iris protocol#3179
IvanNardi merged 7 commits into
ntop:devfrom
BryanProg:add_iris_protocol

Conversation

@BryanProg

Copy link
Copy Markdown
Contributor

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

Link to the related issue:

Describe changes:

@IvanNardi IvanNardi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@BryanProg, thanks for your contribution
Some small adjustments are required; see below.
Can you provide a pcap as example of this new protocol?

Comment thread src/lib/protocols/iris.c
Comment thread src/lib/protocols/iris.c Outdated
Comment thread src/lib/protocols/iris.c Outdated
Comment thread src/lib/protocols/iris.c Outdated
Comment thread src/lib/protocols/iris.c Outdated
@BryanProg BryanProg force-pushed the add_iris_protocol branch from e891c40 to f91a6c9 Compare May 7, 2026 14:23
@IvanNardi

Copy link
Copy Markdown
Collaborator

@BryanProg , I rework the detection logic (the protocol is found if the message type is valid AND the length is valid too) to avoid the false positives with SSH traffic, and I simplified the pcaps, keeping only the two iris flows.
Do you agree with that?

@BryanProg

BryanProg commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@IvanNardi I agree with you, but the message_type only exists in request packets. When it comes to a response message, the message type is not included. That's why I used the TCP payload length and the Iris header length to check the response messages, hence port 1972. I believe only Iris uses that port by default.

If we continue like this, only request messages will be recognized.

@IvanNardi

IvanNardi commented May 8, 2026

Copy link
Copy Markdown
Collaborator

@BryanProg, looking closely at the pcap, it seems that:

  • length check can be performed on req and respo boths
  • the message type is present only in the requests, but in the responses these two bytes are always zero

With this logic we should be able to detect both directions, without false positives (hopefully)
What do you think?

[I fixed the detection on big endian archs]

@BryanProg

BryanProg commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@IvanNardi These two bytes in the response that you saw are the request's error code. When it is 0 it is because there was success, but I do not know all the other values ​​of the error code and that is why I did not check with this information.

So I compared the size of the iris payload (tpc payload size minus 14bytes which is the iris header) with the information that the iris header brings (the first 4 bytes of the iris header are the size of the iris payload information) and I only took advantage of this protocol (In main use, this protocol only uses port 1972) using this port 1972 with the TCP method. Don't you think that's all it takes? Do you think there could be false positives?

Even if I define that in these cases the nDPI trust is NDPI_CONFIDENCE_MATCH_BY_PORT or NDPI_CONFIDENCE_DPI_PARTIAL??

Thanks for to fix the detection on big endian archs

@IvanNardi

Copy link
Copy Markdown
Collaborator

@BryanProg, let me check if I understood it right.
You are proposing to:

  • check only TCP flows on port 1972
  • use only the packet length logic
  • remove the checks on message types

Is that correct? [BTW, I think that should work...]

@BryanProg

BryanProg commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@IvanNardi

I propose the following:

  • Check only TCP flows on port 1972 -> YES

  • Use only packet length logic -> More/less. Here we can to use packet length logic AND message type check for REQ messages, but for RESP messages use ONLY packet length logic, as message type check is not available for RESP.

  • Remove message type checks -> Yes, But only RESP message. To ignore message type for RESP messages and rely on packet length logic and TCP port == 1972 this cases.

That's it. What do you think?

NOTE: For REQ message to use the message_type lends more confidence to this packet. Because we are certain that it uses the Iris protocol.

@IvanNardi

Copy link
Copy Markdown
Collaborator

@BryanProg, what do you think of the latest version?

@nicmorais

Copy link
Copy Markdown

@BryanProg, what do you think of the latest version?

Greetings Ivan!

I'm a coworker of Bryan. He's on vacation.

One thing: I'd rename the check_msg_type_or_error_code() function to something like iris_check_msg_type_or_error_code(), just to make it clear it is not a common function, but something related only to the Iris protocol. Up to you.

Otherwise, looks good to me.

Also, I think it is worth mentioning the Iris database can be tested for free with the intersystems/iris-community Docker image (in case someone wants to assist in reverse engineering the protocol).

@IvanNardi

Copy link
Copy Markdown
Collaborator

One thing: I'd rename the check_msg_type_or_error_code() function to something like iris_check_msg_type_or_error_code(), just to make it clear it is not a common function, but something related only to the Iris protocol. Up to you.

Done

Also, I think it is worth mentioning the Iris database can be tested for free with the intersystems/iris-community Docker image (in case someone wants to assist in reverse engineering the protocol).

Added to the documentation

Thanks!

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@IvanNardi IvanNardi merged commit 04f6b2f into ntop:dev May 11, 2026
25 of 26 checks passed
@IvanNardi

Copy link
Copy Markdown
Collaborator

Thanks, everyone!

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