NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Credential Attacks
Amateurs think credential attacks are just about guessing "Password123" or running a generic brute-force script until th
ViewNetwork Automation & Scripting
This comprehensive learning path dives deep into the principles and practices of automating network infrastructure. You
ViewDigital Forensics Fundamentals
This module introduces the foundational concepts of digital forensics. You will learn the systematic forensic investigat
ViewCloud and Email Forensics
This learning path provides a comprehensive foundation in Cloud and Email Forensics, a critical discipline in modern Dig
ViewPreview · 30 min
Master PowerShell logging to catch fileless attacks. Learn how Script Block Logging (Event ID 4104) deobfuscates malicious payloads in memory, and how PowerShell Transcription records entire interactive sessions to track attacker activity.
PowerShell is the main Windows admin tool. It is also a favourite "living off the land" tool for attackers: it is built in, signed by Microsoft, and can run code in memory without writing a file.
Process creation (4688) only shows the command line. If the code is passed with -EncodedCommand, you see a Base64 string, not what it does. To see the code itself, enable Script Block Logging and Transcription.
With Script Block Logging on, PowerShell logs each block of code it is about to run as Event ID 4104 in Applications and Services Logs → Microsoft → Windows → PowerShell → Operational (Microsoft-Windows-PowerShell/Operational). The text is in the field ScriptBlockText.
The key feature: PowerShell must decode the code before it can run it, so 4104 records the code after decoding. Base64, string joining and similar tricks are removed. (Code that builds new code at run time creates more 4104 events, one per block.)
Even when it is not enabled, PowerShell 5 logs blocks that contain known suspicious words as Warning 4104 events.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in