NBT-NS Poisoning from Linux

NBT-NS Poisoning from Linux

NBT-NS (NetBIOS Name Service) poisoning is a technique used to intercept NetBIOS name resolution requests and respond with malicious information. This attack targets the Windows name resolution process, which can be exploited to capture authentication credentials or perform man-in-the-middle attacks. This guide focuses on performing NBT-NS poisoning from Linux systems.

Understanding NetBIOS Name Resolution

Windows systems use several protocols for name resolution, attempting them in the following order:

  1. DNS (Domain Name System)

  2. LLMNR (Link-Local Multicast Name Resolution)

  3. NBT-NS (NetBIOS Name Service)

When a Windows system attempts to connect to a resource that doesn't have a DNS record, it falls back to LLMNR and then to NBT-NS. This fallback mechanism creates an opportunity for attackers to respond to these broadcast requests with malicious information.

Attack Scenario

The typical attack scenario works as follows:

  1. A Windows system attempts to connect to a resource (e.g., \\fileserver)

  2. DNS resolution fails (no record exists)

  3. The system broadcasts an LLMNR/NBT-NS request asking "Who is fileserver?"

  4. The attacker responds with "I am fileserver"

  5. The Windows system connects to the attacker's machine

  6. Authentication is attempted, sending hashed credentials to the attacker

Required Tools

To perform NBT-NS poisoning from Linux, you'll need:

  • Responder: The primary tool for poisoning responses

  • ntlmrelayx: For relaying captured credentials (part of Impacket)

  • hashcat or john: For cracking captured hashes

Most of these tools come pre-installed in Kali Linux and other penetration testing distributions.

Basic Responder Setup

Responder is the primary tool for NBT-NS poisoning. It listens for name resolution broadcasts and responds with the attacker's IP address.

Installation (if not already installed)

Configuration

Edit the Responder configuration file to enable/disable specific protocols:

Important settings in the configuration:

Basic Usage

Starting Responder

Viewing Captured Hashes

Responder stores captured hashes in the logs directory:

Example captured hash:

Advanced NBT-NS Poisoning Techniques

NTLM Relay Attacks

Instead of just capturing hashes, you can relay them to other services using ntlmrelayx:

Where targets.txt contains a list of IP addresses to relay authentication to.

Targeting Specific Services

You can configure Responder to target specific services:

Using MultiRelay for Interactive Sessions

For obtaining interactive shells:

Extracting and Cracking Captured Hashes

NTLMv2 Hash Cracking with Hashcat

Using John the Ripper

Advanced Analysis and Targeting

Network Traffic Analysis

Monitor Responder's activity using Wireshark:

Targeting Specific Users or Systems

For more focused attacks, you can use additional tools like RunFinger.py to identify potential targets:

Defense Evasion Techniques

Modern networks often have countermeasures against NBT-NS poisoning. Here are some evasion techniques:

Modifying Signatures

Edit Responder to change default signatures that may be detected:

Using Selective Targeting

Target specific systems rather than responding to all requests:

Timing Adjustments

Implement delays between responses to avoid detection:

Countermeasures and Detection

Understanding countermeasures helps test their effectiveness:

  1. Disable NBT-NS: Configure systems to disable NetBIOS over TCP/IP

  2. Use SMB Signing: Enforce SMB signing to prevent relay attacks

  3. Network Monitoring: Deploy solutions that detect poisoning attempts

  4. DNS Infrastructure: Ensure proper DNS resolution to reduce fallback to NBT-NS

Practical Scenarios

Domain Environments

In domain environments, target workstations that might fall back to NBT-NS:

Segmented Networks

In segmented networks, position on the same subnet as the target:

  • Only perform NBT-NS poisoning on networks you own or have explicit permission to test

  • Document all activities thoroughly

  • Handle captured credentials according to proper security procedures

  • Respect privacy and compliance requirements

NBT-NS poisoning remains an effective technique for capturing Windows authentication credentials, especially in environments where proper name resolution isn't fully implemented or where legacy applications rely on NetBIOS name resolution.

Last updated