Fix for profile cleanup

When removing the persistence, the profile is not cleaned up. This is a temporary fix for that which should leave any legitemate profile content in tact. This psm may need a rework though.

Related to:
https://github.com/PowerShellMafia/PowerSploit/issues/165
This commit is contained in:
b33f
2017-07-22 16:51:30 +01:00
committed by GitHub
parent 7a3e16ace5
commit d5c0abc9fa
+2
View File
@@ -740,8 +740,10 @@ else
$PersistenceRemoval = @"
# Execute the following to remove the elevated persistent payload
$ElevatedTriggerRemoval
(gc `$PROFILE.AllUsersAllHosts) -replace '[\s]{600}.+',''| Out-File `$PROFILE.AllUsersAllHosts -Fo
# Execute the following to remove the user-level persistent payload
$UserTriggerRemoval
(gc `$PROFILE.CurrentUserAllHosts) -replace '[\s]{600}.+',''| Out-File `$PROFILE.CurrentUserAllHosts -Fo
"@