Skip to content

Instantly share code, notes, and snippets.

View Ghost-Developmentx's full-sized avatar
πŸ’­
Talk Less, Do More

Ghost Ghost-Developmentx

πŸ’­
Talk Less, Do More
View GitHub Profile
# Disable WDigest
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" -Name "UseLogonCredential" -Value 0 -PropertyType DWORD -Force
# Enable LSASS PPL
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL" -Value 1 -PropertyType DWORD -Force
# Enable ASR rule for LSASS protection
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Enabled
# Check WDigest
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" -Name "UseLogonCredential"
# Check Credential Guard
Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard
# Check LSASS PPL
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL"
# Real-time LSASS access monitoring
Get-WinEvent -FilterHashtable @{LogName='Security';ID=4656,4663} -MaxEvents 100 | Where-Object {$_.Message -match "lsass"}
# Check for dump files
Get-ChildItem C:\ -Recurse -Filter *.dmp -ErrorAction SilentlyContinue | Where-Object {$_.Name -match "lsass"}
# Force password resets
Set-ADUser -Identity USERNAME -ChangePasswordAtLogon $true
# Revoke Kerberos tickets
Invoke-Command -ComputerName HOSTNAME -ScriptBlock {klist purge}
# Reset computer account
Reset-ComputerMachinePassword -Server DC01
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Modern Defense Strategy β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ Short Term: Harden existing systems β”‚
β”‚ β”œβ”€ Credential Guard everywhere possible β”‚
β”‚ β”œβ”€ RunAsPPL on all systems β”‚
β”‚ β”œβ”€ WDigest disabled globally β”‚
β”‚ └─ Comprehensive monitoring β”‚
β”‚ β”‚
# Windows Hello for Business deployment
# Replaces passwords with cryptographic keys
# Benefits:
# - Credentials never in memory as plaintext
# - Biometric or PIN authentication
# - TPM-protected private keys
# - Phishing-resistant
# Check Windows Hello status
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Future Protection Mechanisms β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β€’ Hardware-based isolation (Pluton, TPM 3.0) β”‚
β”‚ β€’ Machine learning anomaly detection β”‚
β”‚ β€’ Passwordless authentication (FIDO2, Windows Hello) β”‚
β”‚ β€’ Zero Trust architecture (continuous verification) β”‚
β”‚ β€’ Ephemeral credentials (short-lived tokens) β”‚
β”‚ β€’ Confidential computing (encrypted memory) β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Detection Pipeline
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚
β”‚ 1. Endpoint Detection (EDR)
β”‚ β”œβ”€ Process monitoring (API hooks)
β”‚ β”œβ”€ Memory access detection
β”‚ └─ Behavioral analysis
β”‚ ↓
β”‚ 2. Event Collection (Sysmon/Windows Event Log)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Defense Layers (Zero Trust)
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚
β”‚ Layer 7: Security Monitoring & IR
β”‚ β”œβ”€ SIEM/SOAR integration
β”‚ β”œβ”€ 24/7 SOC monitoring
β”‚ └─ Automated response playbooks
β”‚
β”‚ Layer 6: Identity Protection
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Attack Chain Timeline
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 1. Initial Access (T1078β€Š-β€ŠValid Accounts)
β”‚ β†’ Phishing email with malicious attachment
β”‚ β†’ User opens document, macro executes
β”‚Β 
β”‚ 2. Execution (T1059β€Š-β€ŠCommand and Scripting)
β”‚ β†’ PowerShell beacon established
β”‚ β†’ C2 communication initiated