Reader small image

You're reading from  Cybersecurity Attacks ‚Äì Red Team Strategies

Product typeBook
Published inMar 2020
PublisherPackt
ISBN-139781838828868
Edition1st Edition
Tools
Right arrow
Author (1)
Johann Rehberger
Johann Rehberger
author image
Johann Rehberger

Johann Rehberger has over fifteen years of experience in threat analysis, threat modeling, risk management, penetration testing, and red teaming. As part of his many years at Microsoft, Johann established a penetration test team in Azure Data and led the program as Principal Security Engineering Manager. Recently, he built out a red team at Uber and currently works as an independent security and software engineer. Johann is well versed in analysis, design, implementation, and testing of software systems. Additionally, he enjoys providing training and was an instructor for ethical hacking at the University of Washington. Johann contributed to the MITRE ATT&CK framework and holds a master's in computer security from the University of Liverpool.
Read more about Johann Rehberger

Right arrow

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...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Cybersecurity Attacks – Red Team Strategies
Published in: Mar 2020Publisher: PacktISBN-13: 9781838828868

Author (1)

author image
Johann Rehberger

Johann Rehberger has over fifteen years of experience in threat analysis, threat modeling, risk management, penetration testing, and red teaming. As part of his many years at Microsoft, Johann established a penetration test team in Azure Data and led the program as Principal Security Engineering Manager. Recently, he built out a red team at Uber and currently works as an independent security and software engineer. Johann is well versed in analysis, design, implementation, and testing of software systems. Additionally, he enjoys providing training and was an instructor for ethical hacking at the University of Washington. Johann contributed to the MITRE ATT&CK framework and holds a master's in computer security from the University of Liverpool.
Read more about Johann Rehberger