Skip to content

WiredPulse/Invoke-GhostLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Invoke-GhostLog

Removal of certain event logs within a Windows OS

Alt text

Usage

  1. Open a PowerShell window, launch Event Viewer, and build an XML query to use. You may want to do this on another system instead of the target.
PS C:> eventvwr
  1. Create a filter on the log you want to alter. Note: In the below example, we are querying for all events, except event ID 4625, that have triggered in the last 7 days. Alt text

  2. Click the XML tab and copy the text circled in red. Alt text

  3. Paste the text from the above step in Notepad and make the below change. Note: If not doing the example, use the link at the bottom of the screen to alter the comparison operator accordingly.

# Current
[System[TimeCreated[timediff(@SystemTime) <= 604800000

# What it needs to change to
[System[TimeCreated[timediff(@SystemTime) <= 604800000
  1. Get a System level Powershell window

  2. Copy the changed data from step 4

  3. Dot source and run Invoke-GhostLog, using the changed data from step 4 as the filter

PS C:> . .\Invoke-GhostLog
PS C:> Invoke-GhostLog -log Security -filter "[System[TimeCreated[timediff(@SystemTime) <= 604800000"
  1. Check out the event logs and notice the specified logs are gone.

Building XML queries

https://blogs.technet.microsoft.com/heyscriptingguy/2014/06/06/understanding-xml-and-xpath/

About

Removal of certain event logs within a Windows OS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published