# T1218.002 - Control Panel
## [Description from ATT&CK](https://attack.mitre.org/techniques/T1218/002)
<blockquote>Adversaries may abuse control.exe to proxy execution of malicious payloads. The Windows Control Panel process binary (control.exe) handles execution of Control Panel items, which are utilities that allow users to view and adjust computer settings.

Control Panel items are registered executable (.exe) or Control Panel (.cpl) files, the latter are actually renamed dynamic-link library (.dll) files that export a <code>CPlApplet</code> function.(Citation: Microsoft Implementing CPL)(Citation: TrendMicro CPL Malware Jan 2014) For ease of use, Control Panel items typically include graphical menus available to users after being registered and loaded into the Control Panel.(Citation: Microsoft Implementing CPL) Control Panel items can be executed directly from the command line, programmatically via an application programming interface (API) call, or by simply double-clicking the file.(Citation: Microsoft Implementing CPL) (Citation: TrendMicro CPL Malware Jan 2014)(Citation: TrendMicro CPL Malware Dec 2013)

Malicious Control Panel items can be delivered via [Phishing](https://attack.mitre.org/techniques/T1566) campaigns(Citation: TrendMicro CPL Malware Jan 2014)(Citation: TrendMicro CPL Malware Dec 2013) or executed as part of multi-stage malware.(Citation: Palo Alto Reaver Nov 2017) Control Panel items, specifically CPL files, may also bypass application and/or file extension allow lists.

Adversaries may also rename malicious DLL files (.dll) with Control Panel file extensions (.cpl) and register them to <code>HKCU\Software\Microsoft\Windows\CurrentVersion\Control Panel\Cpls</code>. Even when these registered DLLs do not comply with the CPL file specification and do not export <code>CPlApplet</code> functions, they are loaded and executed through its <code>DllEntryPoint</code> when Control Panel is executed. CPL files not exporting <code>CPlApplet</code> are not directly executable.(Citation: ESET InvisiMole June 2020)</blockquote>

## Atomic Tests

- [Atomic Test #1 - Control Panel Items](#atomic-test-1---control-panel-items)


<br/>

## Atomic Test #1 - Control Panel Items
This test simulates an adversary leveraging control.exe
Upon execution calc.exe will be launched

**Supported Platforms:** Windows


**auto_generated_guid:** 037e9d8a-9e46-4255-8b33-2ae3b545ca6f





#### Inputs:
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| cpl_file_path | path to cpl file | Path | PathToAtomicsFolder&#92;T1218.002&#92;bin&#92;calc.cpl|


#### Attack Commands: Run with `command_prompt`! 


```cmd
control.exe #{cpl_file_path}
```




#### Dependencies:  Run with `powershell`!
##### Description: Cpl file must exist on disk at specified location (#{cpl_file_path})
##### Check Prereq Commands:
```powershell
if (Test-Path #{cpl_file_path}) {exit 0} else {exit 1}
```
##### Get Prereq Commands:
```powershell
New-Item -Type Directory (split-path #{cpl_file_path}) -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1218.002/bin/calc.cpl" -OutFile "#{cpl_file_path}"
```




<br/>
