Created
July 30, 2018 00:41
-
-
Save joenorton8014/0fb927c117f8499ad991ff7c96e2392d to your computer and use it in GitHub Desktop.
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
$users = Get-ChildItem "c:\users" | Select-Object name | |
$users | ForEach-Object { | |
$user = $($_.Name) | |
$iocfile = "C:\Users\$($_.Name)\AppData\Roaming\somemalwarefile.tmp" | |
if (Test-Path $iocfile){ | |
$filehash = get-filehash $iocfile | Select-Object -ExpandProperty hash | |
$searchresults = "File found!" | |
} | |
else { | |
$filehash = "No file to hash" | |
$searchresults = "IOC not found" | |
} | |
$thiscomputer = [system.environment]::MachineName | |
"$user,$thiscomputer,$searchresults,$filehash" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment