-
Notifications
You must be signed in to change notification settings - Fork 59
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
Latest version ndpi-netfilter detection is "Unknown",but ndpiReader can detection is Mining [4.3.0-3719-a05def54(flow_info-4)] #132
Comments
Thanks for the detailed report. I tried to fix this error in commit f29651a |
Thank you very much for your hard work to solve this problem in such a short time. |
Using the latest version of the program, I re-tested it. #in my test nat server #iptables command for test;drop mining in FORWARD chain Chain FORWARD (policy ACCEPT 7720 packets, 646K bytes) Chain OUTPUT (policy ACCEPT 78322 packets, 56M bytes) #in my client for use command visit mining ip [root@ecs-7e68 ~]# curl --interface 192.168.92.66 https://51.15.119.157 #nat server ;you can see flows !The mining protocol is correctly identified #client cap ;can see; [root@ecs-7e68 tmp]# tshark -r drop.pcap But here, I have a question, right? [root@ecs-gre-xw ~]# cat /proc/net/xt_ndpi/proto |grep mining #message in nat server |
Fixed in 1367ad9 |
Thank you , vel21ripn for your contribution. #the last version #Client before testing #after client test for visit mining's ip #The client effect is as follows: |
Hello Vel21RIPn, today I have a test and found a problem. //in nat server #Client before testing #iptables status before testing Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) // in client,i use iperf3 client to test something.but ndpi reset my session. //before the test;in nat server iptabels status Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) //after the test ; 1 packets match in forward ; Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) //but no counter in mining. //nat server dmesg;protocol is match Unknown However, I can see in the DMESG information on the NAT server side that I am right But at this time, I have simulated access to the Mining protocol in NAT Server Why do I FORWARD chain Unknown protocols It's my use of the rule. Any questions? |
I suspect that in the latest changes there is some kind of error in the logic of work. I'm currently trying to make debug output more configurable. |
Thanks for taking the time to answer my questions, Vel21RIPn:
#At the time of #At the time of |
Please check commit 447265b |
hi,vel21ripn This version seems to have changed a lot. Thank you for your quiet efforts //////////////the test A //nat server //see counter for mining //some one ip in Mining's IP pool. //my iptables rule.just want to drop mining proto. Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) //client ;test command is so sample //////////////Test A results. According to my understanding, the normal process should be that after Mining's IP is matched, [root@centos8 ~]# cat /proc/net/xt_ndpi/ip_proto |grep 3.11.147.67 Chain FORWARD (policy ACCEPT 1046 packets, 79883 bytes) Chain OUTPUT (policy ACCEPT 128K packets, 32M bytes) nat-server-dmesg-for-test-a.txt So, I wonder if there's something wrong with my rule. I tried another rule //////////////the test B //nat server Chain FORWARD (policy ACCEPT 1046 packets, 79883 bytes) Chain OUTPUT (policy ACCEPT 128K packets, 32M bytes) //client ;test command is so sample //////////////Test B results. [root@centos8 ~]# cat /proc/net/xt_ndpi/proto |grep mining Chain FORWARD (policy ACCEPT 1050 packets, 80123 bytes) Chain OUTPUT (policy ACCEPT 129K packets, 32M bytes) nat-server-dmesg-for-test-b.txt So I went on to do test C Chain FORWARD (policy ACCEPT 1085 packets, 83744 bytes) Chain OUTPUT (policy ACCEPT 129K packets, 32M bytes) //client //////////////Test C results. Chain FORWARD (policy ACCEPT 1129 packets, 87871 bytes) Chain OUTPUT (policy ACCEPT 130K packets, 32M bytes) nat-server-dmesg-for-test-c.txt Three tests, all without success. Finally, few small point. //Question 1 [root@centos8 ~]# iptables -m ndpi --help |grep https no https. |
"cat http://3.11.147.67/" may be "curl http://3.11.147.67/" ?
dmesg
About "Do not discard all the unknown traffic" About "cat /proc/net/xt_ndpi/proto |grep https": the https protocol has been renamed to tls. |
"cat http://3.11.147.67/" may be "curl http://3.11.147.67/" ? I'll test it again today. |
hi,vel21ripn I tried your rule and it was ok.It seems that the problem really is my system. Now I am also a little confused about whether it is with my NAT server ##test in nat server Chain FORWARD (policy ACCEPT 260 packets, 25364 bytes) Chain OUTPUT (policy ACCEPT 63918 packets, 19M bytes) Chain CL (3 references) Chain FORWARD (policy ACCEPT 260 packets, 25364 bytes) Chain OUTPUT (policy ACCEPT 63933 packets, 19M bytes) Chain CL (3 references) #test in client server;is ok too; so i do my rule test again; It turns out to be ok. After two tests, everything felt normal. |
hi,vel21ripn
It's a great project
Thank you for your hard work to bring us a good combination of applications
I have a question I'd like to ask you
my nat server
ens33---out to wan
ens36---out to lan
#Kernel version
[root@local-nat-server example]# uname -ar
Linux local-nat-server 5.10.4-1.el8.ndpi.x86_64 #1 SMP Fri Apr 15 08:58:54 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
#ndpi-netfilter version is 4.3.0-3719-a05def54(flow_info-4)
[root@local-nat-server tests]# cat /proc/net/xt_ndpi/proto |more
#id mark ~mask name # count #version 4.3.0-3719-a05def54
//load mod command
//modprobe xt_ndpi xt_debug=3 lib_trace=4 ndpi_enable_flow=1
#51.15.119.157 is about Mining server's ip
[root@local-nat-server tests]# cat /proc/net/xt_ndpi/ip_proto |grep 51.15.119.157
51.15.119.157 Mining
i have a test for identify mining protocol
client do some test command :
ping 51.15.119.157
curl http://51.15.119.157
curl https://51.15.119.157
but in nat server ,i see the flow , mining protocol is 0 ?
(use ndpi_flow_dump to see) and
[root@local-nat-server example]# cat /proc/net/xt_ndpi/proto |grep mining
2a 2a/000001ff mining # 0 debug=3
#in flow this protocol is "Unknown"
Every 1.0s: ./ndpi_flow_dump -s local-nat-server: Sat Apr 16 04:20:29 2022
TIME 1650097229
1650097228 1650097228 4 6 192.168.32.129 53596 51.15.119.157 80 60 0 1 0 I=3,0 SN=192.168.1.182,53596 P=Unkno
wn
bu when i use ndpiReader see that pcap file ,And it turns out you can recognize it,
#pcap file cap in client
[root@local-nat-server example]# ./ndpiReader
Welcome to nDPI 4.3.0-3719-a05def54
[root@local-nat-server example]# ./ndpiReader -i ens36.pcap |grep Mining
Mining packets: 6 bytes: 444 flows: 2
[root@local-nat-server example]# ./ndpiReader -i ens36.pcap -v 2|grep Mining
Mining packets: 6 bytes: 444 flows: 2
5 TCP 192.168.32.129:49164 -> 51.15.119.157:443 [proto: 91.42/TLS.Mining][Encrypted][Confidence: Match by IP][cat: Mining/99][3 pkts/222 bytes -> 0 pkts/0 bytes][Goodput ratio: 0/0][3.06 sec][Risk: ** Unsafe Protocol **][Risk Score: 10][Plen Bins: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
6 TCP 192.168.32.129:53568 -> 51.15.119.157:80 [proto: 7.42/HTTP.Mining][ClearText][Confidence: Match by IP][cat: Mining/99][3 pkts/222 bytes -> 0 pkts/0 bytes][Goodput ratio: 0/0][3.06 sec][Risk: ** Unsafe Protocol **][Risk Score: 10][Plen Bins: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
###debug info in messages
#curl http://51.15.119.157
Apr 16 03:57:54 local-nat-server kernel: START target ct_ndpi 000000007177773a ct 000000004ed06f47 proto 6 192.168.32.129:53594 -> 51.15.119.157:80 DIR
Apr 16 03:57:54 local-nat-server kernel: Reuse ct_ndpi 000000007177773a ct 000000004ed06f47 proto 6 192.168.32.129:53594 -> 51.15.119.157:80 DIR
Apr 16 03:57:54 local-nat-server kernel: START match skb 00000000d500d4ab ct 000000004ed06f47 proto 6 192.168.32.129:53594 -> 51.15.119.157:80 len 60 [0,0,Match by IP] DIR
Apr 16 03:57:54 local-nat-server kernel: cached dc:0 ex:0000000000000010000000000000000000000000000000000000020000080000
Apr 16 03:57:54 local-nat-server kernel: cache skb 00000000d500d4ab ct 000000004ed06f47 proto 6 192.168.32.129:53594 -> 51.15.119.157:80 len 60 [0,0,Match by IP]
Apr 16 03:57:54 local-nat-server kernel: inprogress dc:0 ex:0000000000000010000000000000000000000000000000000000020000080000
Apr 16 03:57:54 local-nat-server kernel: ndpi_tg:ns0 flow_yes flow_nat 2
###debug info in messages
#curl https://51.15.119.157
Apr 16 03:06:02 local-nat-server kernel: START match skb 0000000027e6501f ct 000000009f803943 proto 6 192.168.32.129:49148 -> 51.15.119.157:443 len 60 [0,0,Match by IP] DIR
Apr 16 03:06:02 local-nat-server kernel: ndpi: ct_ndpi pK-error counter pkt 1 bytes 60
Apr 16 03:06:02 local-nat-server kernel: process skb 0000000027e6501f ct 000000009f803943 proto 6 192.168.32.129:49148 -> 51.15.119.157:443 len 60 [0,0,Match by IP]
Apr 16 03:06:02 local-nat-server kernel: ndpi_process_packet guessed proto 91 host_proto 42, master 0, app 0, Match by IP
Apr 16 03:06:02 local-nat-server kernel: ndpi dc:0 ex:0000000000000010000000000000000000000000000000000000020000080000
Apr 16 03:06:02 local-nat-server kernel: inprogress dc:0 ex:0000000000000010000000000000000000000000000000000000020000080000
Apr 16 03:06:02 local-nat-server kernel: match_done skb 0000000027e6501f ct 000000009f803943 proto 6 192.168.32.129:49148 -> 51.15.119.157:443 len 60 [0,0,Match by IP] result 1
Apr 16 03:06:02 local-nat-server kernel: Reuse ct_ndpi 00000000324aba29 ct 000000009f803943 proto 6 192.168.32.129:49148 -> 51.15.119.157:443 DIR
##parameters
[root@local-nat-server log]# grep . /sys/module/xt_ndpi/parameters/*
/sys/module/xt_ndpi/parameters/bt6_hash_size:0
/sys/module/xt_ndpi/parameters/bt_gc_count:0
/sys/module/xt_ndpi/parameters/bt_hash_size:0
/sys/module/xt_ndpi/parameters/bt_hash_timeout:1200
/sys/module/xt_ndpi/parameters/bt_log_size:128
/sys/module/xt_ndpi/parameters/cached:124190
/sys/module/xt_ndpi/parameters/c_last_ct_not:0
/sys/module/xt_ndpi/parameters/c_magic_not:125201
/sys/module/xt_ndpi/parameters/ct_confirm:0
/sys/module/xt_ndpi/parameters/ct_ndpi:0
/sys/module/xt_ndpi/parameters/ct_nolabel:0
/sys/module/xt_ndpi/parameters/ct_null:92846
/sys/module/xt_ndpi/parameters/ct_untrack:0
/sys/module/xt_ndpi/parameters/err_add_ndpi:0
/sys/module/xt_ndpi/parameters/err_alloc_flow:0
/sys/module/xt_ndpi/parameters/err_alloc_id:0
/sys/module/xt_ndpi/parameters/err_bad_tcp_udp:0
/sys/module/xt_ndpi/parameters/err_ip_frag_len:0
/sys/module/xt_ndpi/parameters/err_noiphdr:0
/sys/module/xt_ndpi/parameters/err_oversize:0
/sys/module/xt_ndpi/parameters/err_prot_err:0
/sys/module/xt_ndpi/parameters/err_skb_linear:0
/sys/module/xt_ndpi/parameters/flow_created:3696
/sys/module/xt_ndpi/parameters/flow_deleted:3692
/sys/module/xt_ndpi/parameters/flow_read_debug:0
/sys/module/xt_ndpi/parameters/id_num:0
/sys/module/xt_ndpi/parameters/ipv4:342233
/sys/module/xt_ndpi/parameters/ipv6:0
/sys/module/xt_ndpi/parameters/l4mismatch:3
/sys/module/xt_ndpi/parameters/l4mis_size:312
/sys/module/xt_ndpi/parameters/lib_trace:4
/sys/module/xt_ndpi/parameters/max_parsed_lines:0
/sys/module/xt_ndpi/parameters/max_unk_other:20
/sys/module/xt_ndpi/parameters/max_unk_tcp:20
/sys/module/xt_ndpi/parameters/max_unk_udp:20
/sys/module/xt_ndpi/parameters/mtu:48000
/sys/module/xt_ndpi/parameters/ndpi_enable_flow:1
/sys/module/xt_ndpi/parameters/ndpi_flow_limit:10000000
/sys/module/xt_ndpi/parameters/ndpi_match:342238
/sys/module/xt_ndpi/parameters/ndpi_size_flow_struct:704
/sys/module/xt_ndpi/parameters/ndpi_size_hash_ip4p_node:44
/sys/module/xt_ndpi/parameters/ndpi_stun_cache:0
/sys/module/xt_ndpi/parameters/noncached:21196
/sys/module/xt_ndpi/parameters/nonip:0
/sys/module/xt_ndpi/parameters/non_tcpudp:104440
/sys/module/xt_ndpi/parameters/skb_lin:13798
/sys/module/xt_ndpi/parameters/skb_seg:7398
/sys/module/xt_ndpi/parameters/tls_buf_size:4
/sys/module/xt_ndpi/parameters/xt_debug:3
I am puzzled, but also hope to guide,Thank you very much
The text was updated successfully, but these errors were encountered: