-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create framework add ntlm logon sigma rule test
Fixes #28
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Get-WinEvent -LogName Security | where {(($_.ID -eq "4776" -and $_.message -match "Status.*.*0xC000006A") -and -not ($_.message -match "TargetUserName.*.*$")) } | select Workstation, TargetUserName | group Workstation | foreach { [PSCustomObject]@{'Workstation'=$_.name;'Count'=($_.group.TargetUserName | sort -u).count} } | sort count -desc | where { $_.count -gt 10 } | ||
|
||
function Add-Rule { | ||
param ( | ||
[hashtable] $stack, | ||
[bool] $isLiveAnalysis | ||
) | ||
if ($isLiveAnalysis) { | ||
# LiveAnalysysが必要か確認する | ||
} | ||
else { | ||
$detectRule = { | ||
$ruleName = "win_susp_failed_logons_single_source_ntlm"; | ||
function Search-DetectableEvents { | ||
param ( | ||
$event | ||
) | ||
$result = $event | where { (($_.ID -eq "4776" -and $_.message -match "Status.*.*0xC000006A") -and -not ($_.message -match "TargetUserName.*.*$")) } | select Workstation, TargetUserName | group Workstation | foreach { [PSCustomObject]@{'Workstation' = $_.name; 'Count' = ($_.group.TargetUserName | sort -u).count } } | sort count -desc | where { $_.count -gt 10 }; | ||
Write-Host $result; | ||
# if $result.Count -ne 0 { | ||
# # detect時のcount処理が必要であればここで処理? | ||
# } | ||
Write-Host | ||
Write-Host "Detected! RuleName:$ruleName" | ||
Write-Host | ||
} | ||
Search-DetectableEvents $args[0] | ||
} | ||
} | ||
$stack.Insert('win_susp_failed_logons_single_source_ntlm', $detectRule); | ||
} | ||
|
||
Add-Rule |