Attacking Active Directory from Linux
Attacking from linux
Attacking from Windows
Password spraying attack
Steps:
- Build a user list (with previous techniques)
- Consider your password list.
From previous section we used kerbrute to build a userlist:
kerbrute
rpcclient
An important consideration is that a valid login is not immediately apparent with rpcclient, with the response Authority Name indicating a successful login. We can filter out invalid login attempts by grepping for Authority in the response.
crackmapexec
LLMNR/NBT-NS Poisoning
Link-Local Multicast Name Resolution (LLMNR) and NetBIOS Name Service (NBT-NS) are Microsoft Windows components that serve as alternate methods of host identification that can be used when DNS fails.
If a machine attempts to resolve a host but DNS resolution fails, typically, the machine will try to ask all other machines on the local network for the correct host address via LLMNR. LLMNR is based upon the Domain Name System (DNS) format and allows hosts on the same local link to perform name resolution for other hosts.
It uses port 5355
over UDP natively. If LLMNR fails, the NBT-NS will be used. NBT-NS identifies systems on a local network by their NetBIOS name. NBT-NS utilizes port 137
over UDP.
The kicker here is that when LLMNR/NBT-NS are used for name resolution, ANY host on the network can reply. This is where we come in with Responder
to poison these requests.
How does a typical attack work
- A host attempts to connect to the print server at \print01.inlanefreight.local, but accidentally types in \printer01.inlanefreight.local.
- The DNS server responds, stating that this host is unknown.
- The host then broadcasts out to the entire local network asking if anyone knows the location of \printer01.inlanefreight.local.
- The attacker (us with
Responder
running) responds to the host stating that it is the \printer01.inlanefreight.local that the host is looking for. - The host believes this reply and sends an authentication request to the attacker with a username and NTLMv2 password hash.
- This hash can then be cracked offline or used in an SMB Relay attack if the right conditions exist.
Tools
Several tools can be used to attempt LLMNR & NBT-NS poisoning:
Tool | Description |
---|---|
Responder | Responder is a purpose-built tool to poison LLMNR, NBT-NS, and MDNS, with many different functions. |
Inveigh | Inveigh is a cross-platform MITM platform that can be used for spoofing and poisoning attacks. |
Metasploit | Metasploit has several built-in scanners and spoofing modules made to deal with poisoning attacks. |
Responder
Listening with responder
With this configuration shown above, Responder will listen and answer any requests it sees on the wire.
All saved Hashes are located in Responder's logs directory (/usr/share/responder/logs/
).
NetNTLMv2 hashes are very useful once cracked, but cannot be used for techniques such as pass-the-hash, meaning we have to attempt to crack them offline with hashcat or johntheripper. For example, in the case of a NetNTLMv2 hash, we can copy the hash to a file and attempt to crack it using the hashcat module 5600.
See hashcat for other modules beside 5600.
Last update: 2024-12-28 Created: December 27, 2024 22:00:41Hashes are also stored in a SQLite database that can be configured in the
Responder.conf
config file, typically located in/usr/share/responder
unless we clone the Responder repo directly from GitHub.