nDPI icon indicating copy to clipboard operation
nDPI copied to clipboard

Google classify question

Open u8906250 opened this issue 10 years ago • 15 comments

hello, I tested the url

http://lifedom.top/user/u3tqlvmjhc9e5o1wf0p8s2ai6rkxdn7g/121677/page?url=https%3A%2F%2Fwww.google.com.tw%2Fwebhp%3Fsourceid%3Dchrome-instant%26ion%3D1%26espv%3D2%26ie%3DUTF-8&iframe=

And it was being classified to Google, why? I found there exists "google.com" in URI, because of this reason?

test.zip

u8906250 avatar Feb 03 '16 08:02 u8906250

@u8906250 I'll try and I'll let you know

kYroL01 avatar Feb 03 '16 11:02 kYroL01

@u8906250 i tried your captured file it doesn't classified as google.

rathnaTech avatar Feb 04 '16 06:02 rathnaTech

Yes, nDPI classify that pcap as Google. In this evening I'll give you an answer @u8906250 . Thank you to evidence that.

kYroL01 avatar Feb 04 '16 14:02 kYroL01

thanks. I look forward to hearing from you @kYroL01

u8906250 avatar Feb 05 '16 02:02 u8906250

@u8906250 Sorry for the late. I understand the problem and I'm going to fix it. But I really don't understand what is lifedom Is a google chrome plugin or service ?

kYroL01 avatar Feb 10 '16 22:02 kYroL01

Ha, I also don't understand.

But don't be care the host name, I try other host still same issue, like

xxxxxx.xxx/?url=www.google.com

And if you change to yahoo like

Xxxxxx.xxx/?url=www.yahoo.com

It will classify to YAHOO

u8906250 avatar Feb 11 '16 00:02 u8906250

@u8906250, it detects Google because your URL, which contains "google.com" (though not part of the hostname) matches this rule. You can try to produce another false positive by simply visiting http://www.example.com/www.google.com while http://www.example.com/google.com it is not detected as the first dot is missing and the rule matches ".google." as a substring.

FYI, "lifedom.top" is a service (hosted by CloudFlare at 104.31.72.22) which seems to belong to a malicious URL dataset.

backer-and avatar Feb 11 '16 02:02 backer-and

Yes, I understand. But that's unreasonable because it's really not google service.

u8906250 avatar Feb 11 '16 07:02 u8906250

@u8906250 Are you using lifedom in any way ? How do you have that url ? nDPI parse the url so when read google or yahoo associate the packets to the protocol it know (as @backer-and explain you). Lifedom is not present, so this is the reason of the false positive. Before commit the fix I have to understand if this is a good service or not for a good classification.

kYroL01 avatar Feb 11 '16 08:02 kYroL01

Oh, don't care lifedom, it's just a example I use to explain how a http connection been classified to google services but it's not.

You can just put it to unknown service, ha

u8906250 avatar Feb 11 '16 13:02 u8906250

Well, for HTTP packets, nDPI parse the url of the payload to find more information to give for a better classification. If we can't do that, a lot of applications based on well-known host name or server names or server IP, can't be properly detected. If the payload of the http match to nothing known, the traffic is detected as just http. Why this flow can't be detected as Google if in the url of the http payload there is www.google.com ?

I think i must care about lifedom, because I can detected this flow as lifedom.

Are you agree with me ?

kYroL01 avatar Feb 11 '16 15:02 kYroL01

@u8906250, it is a rough issue to be addressed as I tried to say in the previous comment. As mentioned above it is simple to produce a false positive by visiting http://www.example.com/www.google.com.

Now if you edit src/lib/ndpi_content_match.c.inc adding {".example.", "Example", NDPI_SERVICE_EXAMPLE, NDPI_PROTOCOL_ACCEPTABLE} as a matching rule and recompile, you will discover that Example is detected by visiting http://www.example.com/www.google.com while Google is not, despite www.google.com matches ".google." in this rule. This happens because once nDPI find a match with a host included in that list of rules, the other parts of the URL are ignored. This is the real problem to be fixed.

Considering that "lifedom.top" is absolutely not part of the issue, I think the problem to be tackled is more extended. Your example with that URL belongs to this case, given that the host does not match any rule and Google is detected.

backer-and avatar Feb 11 '16 18:02 backer-and

@kYroL01 I think the thing to parse url to get more information to classify could be an option to choice . Maybe someone think parse host is enough to classify.

As for lifedom, I can just add the host name to extend application file

u8906250 avatar Feb 12 '16 00:02 u8906250

You have to consider that ndpiReader is a test program for the library nDPI. For sure I'll consider this option you ask, even if I think people or program that using nDPI are happier if the library give the majority of the information about the application. But I'll open a discussion about this aspect for sure.

For now I'll push a commit for lifedom detection and close this. Later I could open a new one with this feature you ask.

kYroL01 avatar Feb 12 '16 10:02 kYroL01

Unfortunately some of the above statements were not correct. The problem reported was a bug as reported. The fix I have made fixed the problem.

lucaderi avatar Feb 12 '16 21:02 lucaderi