Open zoomequipd opened 5 months ago
you might consider truncating www. off the domain and using dotprefix transformations and endswith modifier. In many cases, domains controlled by phishing actors will setup several subdomains. For example in the referenced signature, this domain was observed with subdomain in the past (it was a LONG time ago, but proves the point nonetheless) https://urlscan.io/search/#page.domain%3Aenduluxe.com
It looks like you do this with the TLS rules on thetls.sni
buffer, so probably worth doing here as well. Same concept.
Gg, i'll apply its changes. About subdomains, I can't think of a solution that automatically removes the subdomain without affecting trusted sites like github.io, for example. I'll follow Suricata style guide!
About subdomains, I can't think of a solution that automatically removes the subdomain without affecting trusted sites like github.io, for example.
you might check out the Public Suffix List, which is design to solve this problem. There are many python libraries that make use of it.
Do you think these changes address the points raised in your feedback? @zoomequipd
Have you considered using urllib.parse to do your domain/path/etc extraction instead of manually parsing it?
Yes, I think it would be good for the future, if we were to add more complexity to the code it would be even better
you might check out the Public Suffix List, which is design to solve this problem. There are many python libraries that make use of it.
Thanks, I understand, but I need a whitelist to avoid false positives.
I can make it searching: if more than 3 subdomain of tld then make a rule
a couple of things regarding the dns rules
1) you might consider truncating
www.
off the domain and usingdotprefix
transformations andendswith
modifier.In many cases, domains controlled by phishing actors will setup several subdomains. For example in the referenced signature, this domain was observed with subdomain in the past (it was a LONG time ago, but proves the point nontheless) https://urlscan.io/search/#page.domain%3Aenduluxe.com
2) if the intention is to match "exact" domains, this is fine, but consider using the
bsize
modifier to actually make it exact.3) defang domains by using a space instead of the
[.]
as per the [Suricata Community Style Guide (https://github.com/sidallocation/suricata-style-guide/blob/main/style-guide.md)4) remove the trailing
/
from the domain in the MSGwww[.]enduluxe[.]com/
-->www[.]enduluxe[.]com
Proposed format of exact match
Proposed format of non-exact match