Book Image

Cybersecurity Attacks – Red Team Strategies

By : Johann Rehberger
Book Image

Cybersecurity Attacks – Red Team Strategies

By: Johann Rehberger

Overview of this book

It's now more important than ever for organizations to be ready to detect and respond to security events and breaches. Preventive measures alone are not enough for dealing with adversaries. A well-rounded prevention, detection, and response program is required. This book will guide you through the stages of building a red team program, including strategies and homefield advantage opportunities to boost security. The book starts by guiding you through establishing, managing, and measuring a red team program, including effective ways for sharing results and findings to raise awareness. Gradually, you'll learn about progressive operations such as cryptocurrency mining, focused privacy testing, targeting telemetry, and even blue team tooling. Later, you'll discover knowledge graphs and how to build them, then become well-versed with basic to advanced techniques related to hunting for credentials, and learn to automate Microsoft Office and browsers to your advantage. Finally, you'll get to grips with protecting assets using decoys, auditing, and alerting with examples for major operating systems. By the end of this book, you'll have learned how to build, manage, and measure a red team program effectively and be well-versed with the fundamental operational techniques required to enhance your existing skills.
Table of Contents (17 chapters)
1
Section 1: Embracing the Red
6
Section 2: Tactics and Techniques

Notifications for file audit events on Windows

We covered this topic when we walked through monitoring for successful and failed logon events. Like the logon notification Sentinel that we built in the previous chapter, it's possible to build out a file audit Sentinel with notifications by subscribing to new Audit ACL events and notifying the user when an interesting one is generated.

The following steps show the code/commands in PowerShell to do so:

  1. First, we create an EventLogWatcher for the Security event log and enable it:
    $watcher = New-Object System.Diagnostics.Eventing.Reader.EventLogWatcher("Security")
    $watcher.Enabled = $true
  2. Then, we implement the method that should be called whenever a new event is created. We will call it OnEventWritten:
    $OnEventWritten =
    {
       $e = $event.sourceEventArgs.EventRecord
       if ($e.Id -eq 4656)
       {
         if ($e.FormatDescription() -like "*passwords...