Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Effective Threat Investigation for SOC Analysts

You're reading from  Effective Threat Investigation for SOC Analysts

Product type Book
Published in Aug 2023
Publisher Packt
ISBN-13 9781837634781
Pages 314 pages
Edition 1st Edition
Languages
Author (1):
Mostafa Yahia Mostafa Yahia
Profile icon Mostafa Yahia

Table of Contents (22) Chapters

Preface 1. Part 1: Email Investigation Techniques
2. Chapter 1: Investigating Email Threats 3. Chapter 2: Email Flow and Header Analysis 4. Part 2: Investigating Windows Threats by Using Event Logs
5. Chapter 3: Introduction to Windows Event Logs 6. Chapter 4: Tracking Accounts Login and Management 7. Chapter 5: Investigating Suspicious Process Execution Using Windows Event Logs 8. Chapter 6: Investigating PowerShell Event Logs 9. Chapter 7: Investigating Persistence and Lateral Movement Using Windows Event Logs 10. Part 3: Investigating Network Threats by Using Firewall and Proxy Logs
11. Chapter 8: Network Firewall Logs Analysis 12. Chapter 9: Investigating Cyber Threats by Using the Firewall Logs 13. Chapter 10: Web Proxy Logs Analysis 14. Chapter 11: Investigating Suspicious Outbound Communications (C&C Communications) by Using Proxy Logs 15. Part 4: Investigating Other Threats and Leveraging External Sources to Investigate Cyber Threats
16. Chapter 12: Investigating External Threats 17. Chapter 13: Investigating Network Flows and Security Solutions Alerts 18. Chapter 14: Threat Intelligence in a SOC Analyst’s Day 19. Chapter 15: Malware Sandboxing – Building a Malware Sandbox 20. Index 21. Other Books You May Enjoy

Investigating PowerShell Event Logs

Since 2017, security researchers have noted a high increase in the use of PowerShell during the different phases of the attack chain. Also, there are several ready-to-use PowerShell scripts and frameworks that help attackers to achieve their objectives such as stealing credentials, pivoting, internal discovery, and enumeration. As a SOC Analyst, you should have knowledge of PowerShell and its usages, along with how to investigate suspicious PowerShell activities and the event logs provided by Microsoft that help you to track and investigate suspicious PowerShell executions.

The objective of this chapter is to teach you what PowerShell is, why attackers prefer PowerShell, PowerShell’s usage in different attack phases, the events provided by Microsoft that allow you to track PowerShell execution activity, and examples of the techniques and command-line arguments of PowerShell attacks.

In this chapter, we’re going to cover the following...

Introducing PowerShell

PowerShell is a Microsoft command-line shell and scripting tool introduced by Microsoft in 2005 and installed on all new Windows versions by default for automation and configuration management. PowerShell is designed for system administrators as it is a very powerful tool that allows you to control and manage almost the entire system with secure remote capabilities.

PowerShell extended its functionality by depending on cmdlets (pronounced command-lets), which are collections of specific commands allowing PowerShell users to conduct specific tasks, such as remote to another system; display processes; and more. Cmdlets follow a verb-noun naming pattern and commonly consist of three different entities – a verb, a noun, and an option: verb-noun[-parameter]. See some examples here:

  • Get-Process -name svchost: The Get-Process cmdlet is used to obtain information about the processes running on a computer. By specifying the -name parameter followed by...

PowerShell execution tracking events

In addition to Event ID 4688, which logs the execution of a PowerShell process, along with its command-line argument, Microsoft records several event logs that allow you to track PowerShell activities. Some of those event logs are generated by all PowerShell versions and some of them are just generated when specific PowerShell versions are installed. In this section, we will discuss three event logs that are valuable for investigating and tracking suspicious PowerShell execution activities. These events exist in two PowerShell event files – Event ID 800 exists in the Windows PowerShell Event Log file and Event IDs 4103 and 4104 exist in the Microsoft-Windows-PowerShell/Operational event log file.

From PowerShell version 5 onward, Microsoft has provided a new logging feature to log entire executed PowerShell script blocks. By default, the script block logging feature is disabled, but it automatically logs any suspicious script execution...

Investigating PowerShell attacks

In the previous sections, you learned about the PowerShell and Windows event logs that help you investigate suspicious executions with PowerShell. During this section, we will introduce an example of PowerShell attacks and examples of suspicious PowerShell commands and cmdlets, along with their description and purpose, to help you investigate and observe suspicious PowerShell executions.

Fileless PowerShell malware

Fileless malware, also known as memory-based malware, refers to a type of malicious code that runs directly in memory without leaving traces of traditional executable files on the system disk.

An attacker may use a PowerShell cradle to download a malicious PowerShell script and execute it directly in memory to evade writing to the disk and evade being detected by defense mechanisms. The following is an example of a common PowerShell cradle that uses the DownloadString function to download a malicious script from a remote server to...

Summary

In this chapter, you learned what PowerShell is, why attackers prefer PowerShell, PowerShell’s usage in different attack phases, the events and logs provided by Microsoft that allow you to track PowerShell execution activity, and examples of techniques and command-line arguments typical of PowerShell attacks.

In the next chapter, you will learn a list of the persistence and lateral movement techniques and how to investigate and track them using the event logs provided by Microsoft.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Effective Threat Investigation for SOC Analysts
Published in: Aug 2023 Publisher: Packt ISBN-13: 9781837634781
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}