trace flow to the end
hi all , i want to trace a tcp flow that labeled with specific signature to the end .how can i do that ? thanks in advance
I think this question is too generic and maybe is different from the behaviour of nDPI. How you use nDPI ? How you sign a flow ? the end of a single flow or the flows or single protocol ?
End of TCP flow is marked by the fin or rst flags in the tcp header.
when i am searching , i see that whatsapp server on port 443 send a static packet to client directly afler client send a chat to server (like an ACK say that server received what client send ) , so i want to count those packet just in this flow , so i added an array in ndpi_flow_struct and a flag ,and in ssl.c i set the flag to 1 when flow accepted as whatsapp flow .
i tried to change the max extra packet ,but while debugging the flow does not return to ssl.c file after few packets .
where should i set that flow need to check all of its packets ?how can i do that ?
thanks for your time.
@taranehk I know that the end of the flow is a packet like that in general, but I want to understand in this scenario... @NatashaR4in later I'm watching better andtry to help u, thanks.
@NatashaR4in do u have your modified code so I can take a look and try ? I think the problem is that when a flow is marked for a proto (i.e. Whatsapp), the following pkts in that flow are considered WA. I think there is a function do this work, to avoid to enter in the dissector every time the lib process another pkt of the same flow. Can u tell me that is that packet or if u have a pcap represent this scenario ?
ok, first of all , i found that whatsapp has a new signature , start with first packet of 1 byte contains 'E' ,and the second packet in flow will contain a WA at payload [8]and [9] , later in flow a packet with size payload_packet_len==67 and start with 0x00 0x00 0x40 appears after sending a chat message , i added those to function ndpi_search_ssl_tcp .
w_chat1.zip.
Thanks!
I think that this is a great idea to track a specific flow to the end or to the specific number of packets , packet by packet so we can labeling multi sub-services in the same flow if exists like whatsapp and messenger like[Whatsapp.chat.send_photo] or by using a custom array like @NatashaR4in doing this is very helpful @kYroL01 for deep network monitor
@kYroL01 I thought the matter is tracing a flow. I add some codes to ndpi_process_packet function of in ndpi-netfilter to trace the flow to the end. I can share it if u want.
@taranehk , yes please share it ,i may try to adapt the same modification to my nDPI , and if there is an updated version of netfilter and you could share ,that 's will be great. thanks.
@NatashaR4in I'll send a pull request for betolj/ndpi-netfilter as soon as possible. https://github.com/betolj/ndpi-netfilter
@NatashaR4in @taranehk If you want to contribute for this task, please, send a pull request and we can integrate inside (after checking it's correctness).
@taranehk ,we are waiting for your pull, and by the way is there a netfilter project run with the latest nDpi ? https://github.com/betolj/ndpi-netfilter seem outdated
I am trying to solve a bug and then I send the pull request. I am trying to solve this bug asap.
@kYroL01 I made my changes on ndpi-netfilter and it doesn't let me to send a pull request. what should I do now?
Of course, because you have to do that changes to a fork of nDPI, not ndpi-netfilter. Fork nDPI, make your changes and send a pull request.
I'm sorry about my delay. I send the pull request on ndpi-netfilter. this is my commit. my fork name is taranehk. https://github.com/betolj/ndpi-netfilter/pull/60/commits/436f68ec1dffd3873919b6dfc11151082c0f9492
@taranehk The link is dead. But if you want to contribute, why don't you send a pull request to this repository ? We have many differences from ndpi-netfilter repo, and it's easier if you send a pull request here. Please, respect this policy. Thank you
ok. I'm trying...:) here is the commit: (open a new tab and paste the address bellow!!) https://github.com/ntop/nDPI/pull/475/commits/d02a6daece4562eea01ae22f4e80165f24542e39
what i need to setup ndpi-netfilter in inline-mode for control my network traffic? i setup ndpi-netfilter on ubuntu 16.04.1 with two network interface, so how i can pass my network traffic to ndpi-netfilter machine ? what iptabes need to setup for that ?