Abstract
MITRE ATT&CK™ [https://attack.mitre.org/] “is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations” which recommends the Conveigh honeypot [https://github.com/Kevin-Robertson/Conveigh] for detection of the LLMNR/NBT-NS Poisoning and Relay (T1171) [https://attack.mitre.org/techniques/T1171/] attack. This type of attack is currently one of the most popular attack on Windows networks. However most honeypots used for detecting it can be easily bypassed by detecting the honeypot itself.
Outsmarting the smart a.k.a. honeypot detection
When you deploy a honeypot one of the most important things is to not reveal to everyone in the neighborhood that this is actually a honeypot.
Honeypot Conveigh approach is simple, it sends random LLMNR and NBNS requests at random intervals. If someone in the network responds to these random requests, then it is most likely an attacker who wants to spoof such request, what leads to MITM attack.
In case of Windows system a NBNS (NBT-NS, NetBIOS Name Service) query is sent using broadcast address based on your network settings, including mask, so for 192.168.1.0/24 it is 192.168.1.255.
However this honeypot is sending each NBNS query always to 255.255.255.255 [https://github.com/Kevin-Robertson/Conveigh/blob/master/Conveigh.ps1#L295]
> New-Object System.Net.IPEndpoint([IPAddress]::broadcast,137)
AddressFamily Address Port
------------- ------- ----
InterNetwork 255.255.255.255 137
Windows is never sending NBNS queries on that special broadcast address (it means “this network”). You can detect Conveigh honeypot by simply using the following Wireshark display filter nbns && ip.dst == 255.255.255.255.
Another problem is that Conveigh is sending other queries, once with LLMNR, the other time with NBNS, when in reality Windows is querying both protocols using the same name and at the same time. If one of these protocols will be disabled then Windows will always send a query using only the enabled one – it means that actually there can never be such situation like for example Windows is querying some name with LLMNR only, and then after 5 minutes is querying another name with NBNS only etc, but this is how Conveigh actually works.
NBNS is using broadcast on port 137/udp, LLMNR is using multicast IP address 224.0.0.252 on port 5355/udp. Please note that there is also a 3rd protocol – mDNS, which is using multicast IP address 224.0.0.251 port 5353/udp, but we will not focus on it as this blog post is about a specific honeypot related to LLMNR and NBNS.
Additional problem arises because of Conveigh’ creation of random looking hostnames in LLMNR/NBNS queries, which are actually random strings between 5 and 10 characters [https://github.com/Kevin-Robertson/Conveigh/blob/master/Conveigh.ps1#L264]. It can work, but only as a script kiddie detector. Well prepared attackers can't be fooled using this simple technique, such detection method can work on people who just blindly run poisoning attacks without any initial recon.
During a red teaming engagement it is a good idea to run Responder [https://github.com/lgandx/Responder] initially for some time with the -A option (“Analyze mode. This option allows you to see NBT-NS, BROWSER, LLMNR requests without responding [poisoning]”). Then just ignore such honeypot IP address during the actual poisoning attack. At least that way we can fool such primitive and reckless tools.
> New-Object System.Net.IPEndpoint([IPAddress]::broadcast,137)
AddressFamily Address Port
------------- ------- ----
InterNetwork 255.255.255.255 137
1 comment:
From what I've seen most attackers don't understand how llmnr works.
Threat actors for the most part work as teams. There will usually be a less experienced one that will trip an alarm or two. From there it's just a matter of unraveling the ball of yarn.
Post a Comment