Defending against PowerShell attacks - in theory, and in practice
summary
Phishing docs with VBA macros and base64 stagers repeatedly deliver initial code execution, then attackers pivot to PowerShell one-liners that download and run payloads; blocking powershell.exe fails because hosts and libraries still expose the engine. The talk demonstrates script block logging, module and pipeline logging and protected event logging, shows AMSI hooking into Windows Defender (and adoption by Kaspersky and Cylance), and presents Revoke-Obfuscation: an AST‑based classifier that improves detection (character‑frequency gave 89% precision 37% recall; AST/logistic models detect ~94% of obfuscated scripts).
AI-written summary · about
chapters (59)
- 0:00Introduction
- 1:54What does one look like
- 2:17Phishing attacks
- 3:03Enabling macros
- 5:35APT example
- 6:26Palo Alto
- 7:27Security Research
- 8:41Quality of Life
- 9:20Lets block PowerShell
- 9:34The problem with PowerShell
- 10:22The intelligence behind PowerShell
- 11:16The MITRE attack framework
- 12:03The Lua interpreter
- 12:57Security controls
- 15:25PowerShell apologist
- 17:08No one talking about Python
- 19:06Configuration
- 19:32Module Pipeline Logging
- 20:16System Transcripts
- 22:12Script Block Logging
- 23:18Obfuscated PowerShell
- 24:15Antimalware scan interface
- 26:34Protected event logging
- 28:01Useful PowerShell events
- 32:46Security transparency
- 34:27Daniel Bohannon
- 35:55Collect logs
- 36:46The canonical detection challenge
- 39:21The PowerShell download cradle
- 40:07What are your options
- 40:26Start to use your SEM
- 40:54Use string concatenation
- 41:31Use escape characters
- 41:47New object
- 42:22wildcards
- 43:01get command
- 43:19forget alias
- 43:30VOC expression
- 44:13PowerShell obfuscate
- 44:25Reverse strings
- 45:54Example from 2010
- 47:30Character frequency analysis
- 48:19Cosine similarity
- 49:05Script similarity
- 49:30Script similarity analysis
- 50:07Underhanded PowerShell contest
- 51:05GitHub
- 52:40Thanks
- 53:24Scary stuff out there
- 53:35The depths of depravity
- 54:05Statistics
- 55:01Precision and Recall
- 56:23We can do better
- 56:33Tokenizer
- 57:10AST
- 57:41Pattern analysis
- 58:38Celebrating 5000 features
- 58:51Linear regression
- 59:32Linear regression in Excel
related talks
43mMalicious Payloads vs Deep Visibility: A PowerShell Story
25mInvestigating PowerShell Attacks
47mAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
49mPowerShell obfuskation Techniques & How To Detect Them
52mStart covering your bases & Stop chasing APT headlines
45mPowershell Kung-Fu
57mSecuring PowerShell: Hands-On Lab
42mStart Covering Your Bases And Stop Chasing APT Headlines
