Last active
May 19, 2020 07:23
-
-
Save jhawkwind/78dae54e0108d3661ac9db721ec86fd5 to your computer and use it in GitHub Desktop.
This is used to loop through a directory of "Meaoware", rename them to be executable, and execute; while keeping score.
This file contains hidden or 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
| $FileNum = 0 | |
| $Meaoware = 0 | |
| $AVEDR = 0 | |
| $AllFiles = Get-ChildItem ".\" -File -Name -Exclude *.ps1,*.exe | |
| $TotalFiles = $AllFiles | Measure-Object | |
| $AllFiles | Foreach-Object { | |
| $FileNum++ | |
| try{ | |
| Write-Output "Now Renaming: $($_) to $($_).exe [$($FileNum) of $($TotalFiles.count)]" | |
| Rename-Item -Path ".\$($_)" -NewName "$($_).exe" | |
| Write-Output "Now Executing: $($_).exe [$($FileNum) of $($TotalFiles.count)]" | |
| Start-Process -FilePath ".\$($_)" | |
| Write-Output "Executed with $($_).exe, Meaoware wins." | |
| $Meaoware++ | |
| Add-Content "~\Desktop\Meaoware.win.log" "$($_) was executed and not blocked." | |
| } | |
| catch | |
| { | |
| Write-Output "Execution or rename failed $($_).exe, AV+EDR wins." | |
| $AVEDR++ | |
| } | |
| Write-Output "Done with $($_).exe [$($FileNum) of $($TotalFiles.count)]" | |
| Write-Output "SCORE IS NOW: AV+EDR $($AVEDR) v Meaoware $($Meaoware)" | |
| } | |
| Write-Ouput "Script Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment