Created
May 30, 2017 14:47
-
-
Save staaldraad/a7de22afa69ec10f1ec7d995d2bd913c to your computer and use it in GitHub Desktop.
Detect Possible Ruler usage On Exchange and Domain Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-EventLog -InstanceId 4776 -LogName "Security" | ForEach-Object { | |
$sp = $_.message -split "`n" | |
$tmp = $sp | Select-String -Pattern 'RULER' | |
if($tmp.count -ge 1){ | |
Write-Host "Possible Ruler usage at: " $_.TimeGenerated | |
$sp | Select-String -Pattern 'Logon Account:' | write-host | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-EventLog -InstanceId 4624 -LogName "Security" | ForEach-Object { | |
$sp = $_.message -split "`n" | |
$tmp = $sp | Select-String -Pattern 'RULER' | |
if($tmp.count -ge 1){ | |
Write-Host "Possible Ruler usage at: " $_.TimeGenerated | |
$sp | Select-String -Pattern 'New Logon:' -Context 0,3 | write-host | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's this Sir ?