Created
January 23, 2024 15:13
-
-
Save ricardojoserf/6e1a242e77a52c78b630af22d5709153 to your computer and use it in GitHub Desktop.
Script to delete files generated to set persistence using Startup folder using the script: https://gist.github.com/ricardojoserf/d021310080ea34c8c6187d82065dde85
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
$Dir="C:\ProgramData\Outlook" | |
$ExeFile = "notmalicious.exe" | |
$VbsFile = "CheckUpdate.vbs" | |
$LnkFile = "Outlook.lnk" | |
$IcoFile = "microsoft-outlook.ico" | |
## Unhidden and delete files from Dir | |
cmd /c "dir /a $Dir" | |
attrib -h $Dir\$ExeFile | |
attrib -h $Dir\$VbsFile | |
attrib -h $Dir\$IcoFile | |
del $Dir\$ExeFile | |
del $Dir\$VbsFile | |
del $Dir\$IcoFile | |
cmd /c "dir /a $Dir" | |
## Delete .lnk | |
del "$($env:USERPROFILE)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\$LnkFile" | |
cmd /c "dir /a ""$($env:USERPROFILE)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment