域渗透工具推荐:powerview.py(python 版本)

委派查询

查询域内非约束性委派配置
# 展示所有用户的 msDS-AllowedToDelegateTo 属性。
Get-DomainObject -LDAPFilter '(objectclass=user)' -Properties objectsid,sAMAccountName,msDS-AllowedToDelegateTo -TableView 
​
# 展示所有用户的 msDS-AllowedToDelegateTo 属性。
Get-DomainObject -LDAPFilter '(objectclass=user)' -Properties sAMAccountName,msDS-AllowedToDelegateTo -TableView 
查询域内基于资源约束性委派
Get-RBCD -Select delegatedsid,delegatedname,sourcesid,sourcename,ServicePrincipalName -TableView
​
Get-RBCD -Select delegatedname,sourcename,ServicePrincipalName -TableView
​
# sourcename 是下游账户,delegatedname 是上游账户

权限查询

查看用户作为安全主体时的权限信息
# 查询 deandean 用户作为安全主体,域内安全对象的 acl 信息。
Get-ObjectAcl -Select ObjectDN,SecurityIdentifier,AccessMask,ObjectAceType  -TableView -Where "SecurityIdentifier contains deandean" 
查看用户作为安全对象时的权限信息
# 查询 deandean 用户作为安全对象的 acl 信息。
Get-ObjectAcl deandean -Select securityidentifier,objectdn,accessmask,ObjectAceType -TableView  

用户组相关查询

查询所有组及其成员
# 查询所有组,并显示它的 member
Get-DomainGroup -Properties cn,objectsid,member -TableView
 
Get-DomainObject -LDAPFilter '(objectclass=group)' -Properties cn,objectsid,member -TableView 
查询所有用户及其所属组
# 列出所有用户的 memberof 属性。
Get-DomainObject -Properties sAMAccountName,objectsid,memberof -TableView -LDAPFilter '(objectclass=user)'
分类查询
# 查询所有全局组
Get-DomainGroup -Properties cn,objectsid,member -TableView -LDAPFilter '(grouptype=-2147483646)'
​
# 查询所有通用组
Get-DomainGroup -Properties cn,objectsid,member -TableView -LDAPFilter '(grouptype=-2147483640)'
​
# 查询所有本地域组
Get-DomainGroup -Properties cn,objectsid,member -TableView -LDAPFilter '(|(grouptype=-2147483644)(grouptype=-2147483643))'

用户相关查询

查询受保护的用户
# 列出所有 admincount=1 的用户。
Get-DomainObject -Properties objectsid,sAMAccountName,memberof -LDAPFilter '(admincount=1)' -TableView

其他查询

查询组织单位
Get-DomainObject -LDAPFilter '(objectclass=organizationalUnit)' -Properties distinguishedName
查看域的 acl
Get-DomainObjectAcl dc=hack,dc=com -Select objectdn,SecurityIdentifier,AccessMask -TableView 

acl 相关修改

此工具提供的 acl 权限类型如下:

  • immutable

  • fullcontrol

  • resetpassword

  • writemembers

  • dcsync

给某个安全对象添加 acl
# 为用户 deandean 添加修改 administrator 密码的权限。
Add-DomainObjectAcl -TargetIdentity administrator -PrincipalIdentity deandean -Rights resetpassword
​
# 查询 administrator 的 acl。
Clear-Cache
Get-DomainObjectAcl administrator -Select objectdn,SecurityIdentifier,Accessmask,ObjectAceType -TableView
给某个安全对象移除 acl
# 移除 deandean 用户修改 administrator 密码的权限。
Remove-DomainObjectAcl  -TargetIdentity administrator -PrincipalIdentity deandean -Rights resetpassword
​
# 查询 administrator 的 acl。
Clear-Cache
Get-DomainObjectAcl administrator -Select objectdn,SecurityIdentifier,Accessmask,ObjectAceType -TableView

用户和组相关修改

给某个组添加用户
Get-DomainObjectAcl 'Domain Admins' -Select objectdn,SecurityIdentifier,Accessmask,ObjectAceType -TableView
​
# 给 domain admins 组添加用户 deandean。
Add-GroupMember -Identity 'domain admins' -Members deandean
删除某个组的用户
# 删除 domain admins 组中的 deandean。
Remove-GroupMember -Identity 'domain admins' -Members deandean

属性相关修改

设置某个属性
# 设置 deandean 用户属性 telephoneNumber 为 19912345678。
Set-DomainObject deandean -Set telephoneNumber='19912345678' 
清除某个属性
# 清除用户 deandean 的 telephoneNumber 属性。
Set-DomainObject deandean -Clear telephoneNumber

委派相关修改

配置基于资源的约束性委派
# 设置上游服务为 COMP1$,下游服务为 WIN10-01$ 的委派。
# 上游服务使用 -DelegateFrom 参数指定,下游服务使用 -Identity 参数指定。
# rbcd 配置在下游服务 WIN10-01$ 上。
​
Set-RBCD -DelegateFrom comp1$ -Identity win10-01$
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值