mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-04-29 07:57:49 +02:00
update
This commit is contained in:
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
# Step 1: Run the auditpol command using cmd.exe and capture its output
|
# Step 1: Run the auditpol command using cmd.exe and redirect its output to a file
|
||||||
$auditpolOutput = Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r" -NoNewWindow -RedirectStandardOutput $true -PassThru | ForEach-Object { $_.StandardOutput.ReadToEnd() }
|
$outputFilePath = "auditpol_output.txt"
|
||||||
|
Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r > $outputFilePath" -NoNewWindow -Wait
|
||||||
|
$auditpolOutput = Get-Content -Path $outputFilePath -Raw
|
||||||
$filteredOutput = $auditpolOutput | Select-String -Pattern '^(?!.*No Auditing).*{.*}$' -AllMatches | ForEach-Object { $_.Matches.Value }
|
$filteredOutput = $auditpolOutput | Select-String -Pattern '^(?!.*No Auditing).*{.*}$' -AllMatches | ForEach-Object { $_.Matches.Value }
|
||||||
$extractedStrings = [System.Collections.Generic.HashSet[string]]::new()
|
$extractedStrings = [System.Collections.Generic.HashSet[string]]::new()
|
||||||
$filteredOutput | ForEach-Object {
|
$filteredOutput | ForEach-Object {
|
||||||
|
|||||||
Reference in New Issue
Block a user