# Regsvr32

Adversaries may abuse Regsvr32.exe to proxy execution of malicious code. Regsvr32.exe is a command-line program used to register and unregister object linking and embedding controls, including dynamic link libraries (DLLs), on Windows systems. Regsvr32.exe is also a Microsoft signed binary.

Malicious usage of Regsvr32.exe may avoid triggering security tools that may not monitor execution of, and modules loaded by, the regsvr32.exe process because of allow lists or false positives from Windows using regsvr32.exe for normal operations. Regsvr32.exe can also be used to specifically bypass application control using functionality to load COM scriptlets to execute DLLs under user permissions. Since Regsvr32.exe is network and proxy aware, the scripts can be loaded by passing a uniform resource locator (URL) to file on an external Web Server as an argument during invocation. This method makes no changes to the Registry as the COM object is not actually registered, only executed. This variation of the technique  is often referred to as "Squiblydoo" attack and has been used in campaigns targeting governments.

Regsvr32.exe can also be leveraged to register a COM Object used to establish persistence via Component Object Model Hijacking.

**Example:**

By creating an sct file by using the scriptlet provided by pentesterlab it's slightly edited to execute calc.exe

![](https://315180959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRkYsMT_--86drnHom5%2F-MRkYtUKKstCp-Pyz9TR%2Fimage.png?alt=media\&token=620c6f1e-e151-47a6-ae7b-241df932b9ed)

The execution type on this one is locally, regsvr32 is proxy aware so execution can also be done from remote hosts.

![](https://315180959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRkYsMT_--86drnHom5%2F-MRkYuQBUT6eIUElTwE7%2Fimage.png?alt=media\&token=647b50b1-0579-47fb-bf58-738b073305dd)

We can see on our server it was called as well

![](https://315180959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRkYsMT_--86drnHom5%2F-MRkYvImw3xdh6_Th_mc%2Fimage.png?alt=media\&token=bb26ed6e-c86d-4c7c-9801-fed4db259ec2)

Had to be quick and capture the execution on Process Explorer.

![](https://315180959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRkYsMT_--86drnHom5%2F-MRkYw2x2a3t1xguCAv2%2Fimage.png?alt=media\&token=a3170860-c111-497a-ba09-010fc6622872)

References:

[https://pentestlab.blog/2017/05/11/applocker-bypass-regsvr32/](https://pentestlab.blog/2017/05/11/applocker-bypass-regsvr32/)
