域渗透笔记-工具使用-Adfind

发布于 2023-02-20  1880 次阅读


简介:

Adfind是一款在域环境下非常强大的信息搜集工具,允许用户在域环境下轻松搜集各种信息。它提供了大量的选项,可以优化搜索并返回相关详细信息,是内网域渗透中的一款利器。

下载链接:

https://www.softpedia.com/get/Programming/Other-Programming-Files/AdFind.shtml

Adfind的使用:

Adfind的使用结构如下:

AdFind [switches] [-b basedn] [-f filter] [attr list]

1.switches(连接参数):
该选项是连接参数。如果Adfind在域内机器上运行,则不需要添加该选项;
如果在域外机器上执行,则需要指定域控并提供一个有效的域用户和密码。
参数:
-h:指定主机和端口(ip:port)
-p:可单独使用-p来指定端口
-u: 指定用户
-up: 指定密码

例子:
连接域控192.168.161.177的389端口,使用用户名test\zhangsan,密码是qwer1234!,查询的数据是域控列表

Adfind.exe -h 192.168.161.177:389 -u test\zhangsan -up qwer1234! -sc dclist

2.-b basedn
该选项指定查询的根节点

例子:

查询DN为dc=test,dc=com下的所有机器

Adfind.exe -b dc=test,dc=com -f "objectcategory=computer" dn

3.-f filter
该选项指定查询的过滤条件。

例子:

查询域内所有机器

Adfind.exe -f "objectcategory=computer" dn

查询域内所有用户

Adfind.exe -f "(&(objectcategory=person)(objectclass=user))" dn

4.attr list
该选项指定查询出来的结果显示哪个属性。当不使用该参数时,会显示查询对象的所有属性。

例子:

查询域内所有机器,显示所有机器的所有属性

Adfind.exe -f "objectcategory=computer"

查询域内所有机器,显示所有机器的DN属性

Adfind.exe -f "objectcategory=computer" dn

查询域内所有机器,显示所有机器的DN属性,查询结果不换行。只有DN属性前面可以加“-”符号

Adfind.exe -f "objectcategory=computer" -dn

查询域内所有机器,显示所有机器的DN属性

Adfind.exe -f "objectcategory=computer" name

实战常用语法:

列出域控制器名称:

AdFind.exe -sc dclist

查看域控版本:

AdFind.exe -schema -s base objectversion

不同域控版本对应的数宇如下:

Windows 2000 Server operating system: 13;
Windows Server 2003 operating system: 30;
Windows Server 2003 R2 operating system: 31;
Windows Server 2008 operating system (AD DS): 44;
Windows Server 2008 R2 operating system (AD DS): 47;
Windows Server 2012 operating system (AD DS): 56;
Windows Server 2012 R2 operating system (AD DS): 69;
Windows Server 2016 operating system (AD DS): 87;
Windows Server v1709 operating system (AD DS): 87;
Windows Server v1803 operating system (AD DS): 88;
Windows Server v1809 operating system (AD DS): 88;
Windows Server 2019 operating system (AD DS): 88;
Active Directory Application Mode (ADAM): 30;
Windows Server 2008 (AD LDS): 30;
Windows Server 2008 R2 (AD LDS): 31;
Windows Server 2012 (AD LDS): 31;
Windows Server 2012 R2 (AD LDS): 31;
Windows Server 2016 (AD LDS): 31;
Windo ws Server 2019 (AD LDS): 31o
Windows Server v1809 (AD LDS):31;
Windows Server v1803 (AD LDS): 31;
Windows Server v1709 (AD LDS): 31;

由上图可看出,域控的版本信息字段为69,对应的操作系统版本为Windows Server 2012 R2

查询当前域中在线的计算机(所有属性):

AdFind.exe -sc computers_active

查询当前域中在线的计算机(只显示名称和操作系统):

AdFind.exe -sc computers_active name operatingSystem

查询当前域中所有计算机(所有属性):

AdFind.exe -f "objectcategory=computer"

查询当前域中所有计算机(只显示名称和操作系统):

AdFind.exe -f "objectcategory=computer" name operatingSystem

查询当前域内所有用户:

AdFind.exe -users name

查看域管账户:

AdFind.exe -default -f "(&(|(&(objectCategory=person)(objectClass=user))(objectCategory=group))(adminCount=1))" -dn

查看指定域(test.com)内非约束委派主机:

AdFind.exe -b "DC=test,DC=com" -f "(&(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))" cn

查询指定域(test.com)内的非约束委派用户:

AdFind.exe -b "DC=test,DC=com" -f "(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))" cn distinguishedName

届ける言葉を今は育ててる
最后更新于 2023-02-20