Active Directory 101 - LLMNR

article/2025/9/17 19:30:48

This is the first article of my Active Directory Series. I’ll be reading through materials and try to explain the key concepts in AD and AD penetration test.

Let’s cut directly to it.

The Concept

References:

  • RFC from IETF
  • LLMNR Wikipedia
  • How LLMNR Work
  • How to Disable LLMNR & Why You Want To

LLMNR (Link Local Multicast Name Resolution), previouly NBT-NS (NetBIOS Name Service), simply put, it’s a kind of DNS that suports both IPv4 and IPv6 inside the company network doing hostname resolving things.

If one host makes a request to another host by specifying its NetBIOS name, several things might happen, let’s assume A wants to make a request to B:

  • A asks the DNS (not LLMNR) server what B's IP address is
  • DNS server gets the request and
    • resolves the IP address of B and responds to A with B's IP, everything’s fine
    • cannot resolve the IP address of B
      • then A will send queries to all the nodes (multicast) in the local network, ask to resolve B's IP address
      • each host (with LLMNR service enabled) receives the query, compare the hostname with its own hostname, if matched, then it will respond to A with a message (unicast) containing its IP address. In this case, if B receives the multicasted query, will respond to A with its IP address

This is how LLMNR works.

And the bad thing is, multicasting provides hackers chances to spoofing information flow on the local network.

Refer to LLMNR RFC from IETF for more features.

LLMNR Related Attacks

LLMNR/NBT-NS Poisoning

References:

  • LLMNR/NBT-NS Poisoning and Relay

According to the above article, if the host that’s been requested needs identification/authentication, the username and NTLMv2 hash of the host who is making the request will be sent as well.

I’ll draw a diagram to explain the issue.

在这里插入图片描述

The whole process looks like this.

So, what if a hacker is in the middle of this query. He could somehow intercept the DNS request and say, ‘Hey, I’m B you are looking for, here is my IP address, and send me your username and hash’. Then, the hacker can get everyhing he needs.

在这里插入图片描述

Sounds easy, right?

Responder

The tool used to carry out the LLMNR Poisoning is called Responder.

I will not talk about how to use the tool, there’s no point in doing that.

Instead, let’s go the hard way.

How It Works - The Source Code

The source code is here @ github.

I’ll go by answering the three questions I asked previously.

Initialization

All configs are in Responder.conf, you can manually turn things on and off, or enter IPs to respond to or don’t respond to. When calling Responder.py, the conf file is the first thing to be parsed.

settings.py does config parsing, global variable initialization
在这里插入图片描述
and some DNS and routing checking.
DNS and Routing Checks

packet.py

packet.py contains all kinds of different protocols, the way to finger print them, and interact with them with correct responses.

在这里插入图片描述

Servers Folder

在这里插入图片描述
Here are the servers that will be run by responder to intercept corresponding protocols requests.

The main Function

The main function in Responder.py imports all three poisoners and that’s where all the fun begins.

LLMNR, NBT-NS, and MDNS server threads are defined here.

在这里插入图片描述
Then by default they are added to a threads queue waiting to be executed.

在这里插入图片描述

The LLMNR, NBTNS, MDNS are three classes imported from poisoners module, and passed to the server thread function as handlers.

Let’s go check out these three poisoners.

LLMNR.py

Poisoning code is here.
在这里插入图片描述

The LLMNR_Ans class in packets.py defined the fields we need to anwer a LLMNR request.

在这里插入图片描述
And similar situation in other two poisoners.

Key Process

  • Define your settings in responder.conf
  • Start Responder
  • Responder first reads responder.conf, populate all configs in settings.py
  • Start all three poisoners and servers in seperate threads, listenning to queries in the network
  • Intercept victim’s query data, construct corresponding answer, send the answer back to the victim
  • Receive victim’s username and hash
Check By Doing

I have an Active Directory lab set up. I’ll run responder.py, and I will do a LLMNR test with my lab, and tcpdump all requests to see what is happening under the hood.

I have a domain controller TATOOINE.LOCAL (with NetBIOS Name TATOOINE-DC), and a local domain administrator who is a member of this domain dvader.

I’m going to fire up Responder.py, and go to dvader (with NetBios Name THESITHLORD) and make some requests to IP addresses and see what will happen.

This is my DC (TATOOINE-DC)'s IP address

在这里插入图片描述

This is dvader THESITHLORD's IP (the victim)

在这里插入图片描述

This is the hacker’s IP

在这里插入图片描述
And I have a SMB share turned on on my DC.

在这里插入图片描述

Run the Responder

在这里插入图片描述

Run tcpdump to capture all traffic in my internal network, will analyze it later.

在这里插入图片描述

Let’s assume that dvader wants to access some file in the DC’s deathstar share folder, so he opens the file explorer, enters the file he wants to access.

Remember LLMNR tries to identify hosts in the network by its NetBIOS Name, in this case, deathstar, so if you enter some IPv4 address that does not exist, it won’t work.

在这里插入图片描述

Let’s see what happened in responder.

在这里插入图片描述

And at the end, the victim dvader send over his username and hash.

Analyze Network Traffic

在这里插入图片描述
Open in wireshark
在这里插入图片描述
Let’s fist focus on packet 5 - 8. Packet 5 is where it all starts.
在这里插入图片描述
In packet 5, the victim 192.168.200.129 sends a DNS request to DC 192.168.200.128, asking to solve the domain deathstart.TATOOINE.LOCAL.

In packet 6, DC 192.168.200.128 sends a response to victim 192.168.200.129, with a message No such name A deathstar.TATOOINE.LOCAL..., with means my DC cannot resolve the domain deathstar.TATOOINE.LOCAL.

Next, let’s focus on packet 22 - 33.

在这里插入图片描述
In packet 22, victim 192.168.200.128 sends a multicast UDP MDNS request to 224.0.0.251, asking to resolve deathstar.local

在这里插入图片描述

Reference:

  • MDNS Wikipedia

In packet 27, victim 192.168.200.128 again, sends a multicast UDP LLMNR query to 225.0.0.252, asking to resolve the domain deathstar
在这里插入图片描述

The IP 224.0.0.252 is specified in LLMNR’s RFC.
在这里插入图片描述
Next, in packet 30 and 31, the hacker’s machine 192.168.200.130 tells both MDNS and the victim that he is deathstar, and the IP is 192.168.200.130

在这里插入图片描述
在这里插入图片描述
Next, victim 192.168.200.129 believes that the hacker is deathstar, and starts to make TCP connection.

在这里插入图片描述
In packet 46, the victim 192.168.200.129 sends over his username and hash.

The attack is done.

Reference:

  • Difference Between DNS Records
What If I Turn Off the MDNS Poisoner ?

As we can see above, what is the purpose of this MDNS poisoner?

在这里插入图片描述
In packet 31, the hacker’s machine 192.168.200.130 can respond to the victim that I am deathstar.

So, I want to turn off this MDNS poisoner and see what will happen.

在这里插入图片描述
I commented out the MDNS part in Responder.py.

在这里插入图片描述
And as I expected, I can still get the credentials.

What is the purpose of MDNS ???

If anyone knows, please leave a comment.

Conclusion

The attack can be done if only the host makes a request to another host whose NetBIOS name cannot be resolved by the DNS server.

Responder plays with all the protocols, intercepts the query from the victim, constructs a malicious response to the victim to trick him into believing that the hacker is the one he wants to connect to.

In a lot of situations, LLMNR should be turned off to prevent this kind of attack.


http://chatgpt.dhexx.cn/article/cZc4bijv.shtml

相关文章

内网渗透技术之超越LLMNR/NBNS欺骗的ADIDNS欺骗攻击

利用名称解析协议中的缺陷进行内网渗透是执行中间人(MITM)攻击的常用技术。有两个特别容易受到攻击的名称解析协议分别是链路本地多播名称解析(LLMNR)和NetBIOS名称服务(NBNS)。攻击者可以利用这两种协议来…

利用 LLMNR 名称解析缺陷劫持内网指定主机会话

导读本文将会对 LLMNR 协议进行分析并用 python 实现质询和应答。后半部分则会重点阐述利用 LLMNR 在名称解析过程中的缺陷进行实战攻击的部分思路。 0x00 LLMNR 简介 从 Windows Vista 起,Windows 操作系统开始支持一种新的名称解析协议 —— LLMNR,主要…

LLMNR协议

LLMNR协议 http://en.wikipedia.org/wiki/Link-local_Multicast_Name_Resolution The Link Local Multicast Name Resolution (LLMNR) is a protocol based on the Domain Name System (DNS) packet format that allows both IPv4 and IPv6 hosts to perform name resolutio…

组播风暴引起的路由系统重启(LLMNR协议)

网络拓扑 一台路由设备连接可以上网的上级,连接方式DHCP,一台中继器,2.4G和5G同时中继到路由设备(双频中继之后,优先走5G),一台chromecast播放视频,一台ipad连接,一台网络摄像头连接…

内网渗透研究:LLMNR和NetBIOS欺骗攻击分析

目录 基础知识 LLMNR是什么? LLMNR 的工作过程 NetBIOS是什么? Windows系统名称解析顺序 LLMNR和NetBIOS欺骗攻击 攻击原理 Responder工具利用过程 针对LLMNR和NetBIOS欺骗攻击的防御 基础知识 LLMNR是什么? 链路本地多播名称解析&…

LLMNR和NetBIOS欺骗攻击分析及防范

本文首发于先知社区:https://xz.aliyun.com/t/9714 链路本地多播名称解析(LLMNR)是一个基于域名系统(DNS)数据包格式的协议,IPv4和IPv6的主机可以通过此协议对同一本地链路上的主机执行名称解析。 在DNS …

llmnr协议 名称解析缺陷劫持内网指定主机会话

目录 0x00 LLMNR 简介 0x01 LLMNR 协议分析 0x02 LLMNR 名称解析过程 0x03 编程实现 LLMNR 的质询和应答 0x04 LLMNR Poison 攻击原理 0x05 利用伪造源 IP LLMNR Poisone 劫持内网指定主机会话 0x06 LLMNR Poison 实战攻击思路 0x07 总结 0x00 LLMNR 简介 从 Windows …

NetBIOS名称欺骗和LLMNR欺骗

本文原创作者: 贺兰山缺口 原创投稿详情:重金悬赏 | 合天原创投稿等你来! NetBIOS和LLMNR简介 NetBIOS和Link-LocalMulticast NameResolution(LLMNR)是Microsoft针对工作组和域设计的名称解析协议,主要用于…

【内网学习笔记】18、LLMNR 和 NetBIOS 欺骗攻击

0、前言 如果已经进入目标网络,但是没有获得凭证,可以使用 LLMNR 和 NetBIOS 欺骗攻击对目标进行无凭证条件下的权限获取。 1、基本概念 LLMNR 本地链路多播名称解析(LLMNR)是一种域名系统数据包格式,当局域网中的…

LLMNR Poison技术详解

一、LLMNR 协议 简介 从 Windows Vista 起,Windows 操作系统开始支持一种新的名称解析协议 —— LLMNR,主要用于局域网中的名称解析。LLMNR 能够很好的支持 IPv4 和 IPv6,因此在 Windows 名称解析顺序中是一个仅次于 DNS 的名称解析方式&am…

最简单的动态数据源配置

动态数据源配置 操作步骤:一、数据源配置配置方式:二、动态数据源相关类1. 枚举类定义如下:2. 重写查找当前数据源的方法:3. 用ThreadLocal变量存储查询数据源的字符串:4. 用动态数据源替换掉普通的数据源 二、测试结果。1. Mapper类2.TestMapper 二、重点来了!! 操作步骤: 提…

几种数据源的配置方式

目录 1.c3p0配置方式 2.dbcp配置方式 3.DriverManagerDataSource配置方式 4.HikariDataSource配置方式 5.多数据源整合&#xff08;编程式事务&#xff09; 1.c3p0配置方式 lib: applicationContext.xml <?xml version"1.0" encoding"UTF-8"?&g…

多数据源配置-springBoot

前言 这里展示的是springBoot项目双数据源的配置&#xff0c;为了增加一定的代表性&#xff0c;这里采用两个不同的数据库Orcale和Mysql作为数据源。 依赖 <!-- orcale驱动包 --> <dependency><groupId>com.oracle.database.jdbc</groupId><arti…

若依多数据源配置

1.修改application-druid.yml文件&#xff0c;这里使用mysql数据源&#xff0c;分别有ry-vue、ry-test1、ry-test2三个数据库。 2.修改DataSourceType类&#xff08;MASTER主库&#xff0c;SLAVE、LOGIN两个从库&#xff09;。 3.修改DruidConfig类。 以上配置完成后&#xff0…

如何配置数据源

(一&#xff09;官网 Spring Initializrhttps://start.spring.io/ &#xff08;二&#xff09;各依赖 &#xff08;三&#xff09;打印一下数据源 &#xff08;四&#xff09;查看有哪些bean &#xff08;五&#xff09;不用spring boot自己配置bean 1、数据源相关 • DataSou…

SpringBoot 之数据源配置

文章目录 市面上的几种数据源比对SpringBoot自动装配DataSource原理HiKariCP 数据源配置Druid 数据源配置SpringBoot集成Druid连接池Druid 多数据源配置&#xff08;不同Mapper操作不同数据源&#xff09;HikariCP 多数据源动态配置 springboot2.0整合druid&#xff0c;以及spr…

P值 卡方值

P值&#xff1a; P值即概率&#xff0c;反映某一事件发生的可能性大小。 不同的P数值所表达的含义也是不一样的。 统计学根据显著性检验方法所得到的P 值&#xff0c;一般以P < 0.05 为有统计学差异&#xff0c; P<0.01 为有显著统计学差异&#xff0c;P<0.001为有…

Python数据挖掘学习6卡方检验

1.定义&#xff1a;一种用途很广的计数资料的假设检验方法。它属于非参数检验的范畴&#xff0c;主要是比较两个及两个以上样本率( 构成比&#xff09;以及两个分类变量的关联性分析。 2.基本思想&#xff1a;统计样本的实际观测值与理论推断值之间的偏离程度&#xff0c;实际…

python scipy 密度函数 分位数 累计函数计算p值 卡方检验 t检验 F检验 假设检验 AB实验 显著性检验

AB实验&#xff1a; 1. 人均类->t检验 # 计算t值 def get_t(x):# 遍历看x需要几次的显著性检验。可能有多个实验组&#xff0c;需要一对一检验x1 x[x.分组.astype(str)1].iloc[0] # 对照组&#xff0c;组号固定为1&#xff0c;转为Series格式for i in x[x.分组.astype(st…

卡方检验c语言算法,R语言 | 卡方检验(Chi-squaretest)

卡方检验在计数资料中的应用,包括推断两个总体率或构成比之间有无差别、多个总体率或构成比之间有无差别、多个样本率间的多重比较、两个分类变量之间有无关联性、多维列联表的分析和频数分布拟合优度的卡方检验。选自:周支瑞老师 下面分别介绍计数资料怎么进行卡方检验。 目…