The Ultimate Blue Team/DFIR Powershell

This is the single file that every DFIR, SOC analyst, and incident commander keeps open during a full-blown PowerShell-driven malware incident investigation.

Analyst Machine – One-Time Full Module Loadout

Note: You do this ONCE on your personal jump box/IR laptop. Never again.

These are the exact modules used by Mandiant, CrowdStrike IR, Microsoft DART, and elite SOCs.

# All install to CurrentUser – you do NOT need local admin on your own laptop.
Install-Module -Name `
    PSHunt, PowerHunt, DeepBlueCLI, SigmaRule, PSSigma, PowerForensics, `
    Velociraptor, ImportExcel, PSWriteHTML, BurntToast, Terminal-Icons, `
    Microsoft.PowerShell.ConsoleGuiTools, Kansa, Get-Evtx, PoshRSJob `
    -Scope CurrentUser -Force -AllowClobber -ErrorAction SilentlyContinue
    # ↑ -Force = overwrite older versions
    # ↑ -AllowClobber = overwrite conflicting commands (yes, we want that)
    # ↑ -ErrorAction SilentlyContinue = don't stop if one module is already installed

# Now import everything you will touch in the next 72 hours of hell
Import-Module PSHunt, PowerHunt, DeepBlueCLI, SigmaRule, PowerForensics, Velociraptor, `
              ImportExcel, PSWriteHTML, BurntToast, Terminal-Icons, Kansa, Get-Evtx
    # You will thank yourself later when you’re typing at 120 WPM under pressure

# Make the console not look like 1998
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/ys.omp.json" | Invoke-Expression
    # ys.omp.json = clean, blue-team-style theme used by most elite teams
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView
    # Gives you inline + list prediction – saves hundreds of keystrokes per incident

Verify Every Single Defence Is Actually On.

Note: (Run on EVERY compromised endpoint you touch)

Daily Proactive Threat Hunting

(Run every single shift, every single day)

Full Malware/Credential Theft Incident Triage

Note: β†’ This is the EXACT function you run at 3:17 a.m. when the ransom note hits

Immediate Containment - Kill Everything

Note: (Run when encryption is confirmed)

Full Evidence Collection – Do This Before Anyone Reboots

Post-Incident Hardening – Never Get Hit The Same Way Twice

Last updated