Input Capture
Adversaries may use methods of capturing user input to obtain credentials or collect information. During normal system usage, users often provide credentials to various different locations, such as login pages/portals or system dialog boxes. Input capture mechanisms may be transparent to the user (e.g. Credential API Hooking) or rely on deceiving the user into providing input into what they believe to be a genuine service (e.g. Web Portal Capture). Common sub-techniques include keylogging via Windows hooks (SetWindowsHookEx), GUI input capture via credential dialog spoofing, web portal capture via fake login pages, and credential API hooking via DLL injection into authentication processes. Threat actors including APT42, Storm-1811, and APT39 have leveraged these techniques, as have malware families such as InvisibleFerret, Chaes, Kobalos, and NPPSPY.
// T1056 Input Capture — Multi-Signal Detection
// Covers: Network Provider DLL registration (NPPSPY), suspicious DLL loads into credential processes,
// input hook API usage, and clipboard/keyboard monitoring process activity
let SuspiciousInputAPIs = dynamic([
"SetWindowsHookEx", "GetAsyncKeyState", "GetKeyState", "GetRawInputData",
"pyWinhook", "pynput", "keyboard.hook", "InputCapture",
"WH_KEYBOARD", "WH_KEYBOARD_LL", "WH_MOUSE_LL"
]);
let CredentialProcesses = dynamic(["winlogon.exe", "lsass.exe", "LogonUI.exe", "consent.exe", "credui.exe"]);
// Signal 1: Suspicious network provider DLL registration (NPPSPY technique)
let NetworkProviderReg = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| where RegistryKey has @"SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"
or (RegistryKey has @"SYSTEM\CurrentControlSet\Services" and RegistryKey endswith @"\NetworkProvider")
| where InitiatingProcessFileName !in~ ("services.exe", "svchost.exe", "msiexec.exe", "TrustedInstaller.exe")
| extend SignalType = "NetworkProviderRegistration"
| project Timestamp, DeviceName, AccountName, SignalType,
RegistryKey, RegistryValueName, RegistryValueData,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessFolderPath;
// Signal 2: Suspicious DLL loaded into credential/authentication processes
let HookDLLLoad = DeviceImageLoadEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ (CredentialProcesses)
| where FolderPath !startswith @"C:\Windows\System32\\"
and FolderPath !startswith @"C:\Windows\SysWOW64\\"
and FolderPath !startswith @"C:\Program Files\\"
and FolderPath !startswith @"C:\Program Files (x86)\\"
| where FileName endswith ".dll"
| extend SignalType = "SuspiciousDLLInCredentialProcess"
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName, SignalType,
FileName, FolderPath, SHA256,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessFolderPath;
// Signal 3: Process creation with input capture indicators
let InputCaptureProcess = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (SuspiciousInputAPIs)
or (FileName has_any ("keylog", "keyscan", "hookdll", "inputcap", "credcap"))
or (FolderPath !startswith @"C:\Windows\" and FolderPath !startswith @"C:\Program Files"
and (ProcessCommandLine has "GetClipboard" or ProcessCommandLine has "Get-Clipboard")
and ProcessCommandLine has_any ("while", "loop", "sleep", "timer", "interval"))
| extend SignalType = "InputCaptureAPIOrTool"
| project Timestamp, DeviceName, AccountName, SignalType,
FileName, FolderPath, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessFolderPath;
// Signal 4: Process injection into Winlogon or credential UI (common for hooking)
let WinlogonInjection = DeviceEvents
| where Timestamp > ago(24h)
| where ActionType == "CreateRemoteThreadApiCall" or ActionType == "ProcessInjection"
| where AdditionalFields has_any ("winlogon.exe", "LogonUI.exe", "credui.exe", "consent.exe")
| extend SignalType = "InjectionIntoCredentialProcess"
| project Timestamp, DeviceName, AccountName, SignalType,
FileName, ProcessCommandLine=AdditionalFields,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessFolderPath;
// Union all signals
union isfuzzy=true NetworkProviderReg, HookDLLLoad, InputCaptureProcess, WinlogonInjection
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate accessibility software (screen readers, on-screen keyboards, Dragon NaturallySpeaking) that register low-level keyboard hooks via SetWindowsHookEx
- Enterprise security products (DLP agents, PAM tools like CyberArk) that monitor credential entry as a security control — these load DLLs into credential processes
- Password managers (1Password, Bitwarden, KeePass) that hook input fields for autofill functionality
- Keyboard remapping utilities (AutoHotkey, SharpKeys, Microsoft PowerToys) that legitimately intercept and redirect keystrokes
- Remote desktop and KVM software (TeamViewer, AnyDesk, VNC) that capture keyboard/mouse input for remote transmission
- Custom enterprise single-sign-on (SSO) credential providers legitimately registered as network providers in HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
References (14)
- https://attack.mitre.org/techniques/T1056/
- https://attack.mitre.org/techniques/T1056/001/
- https://attack.mitre.org/techniques/T1056/002/
- https://attack.mitre.org/techniques/T1056/003/
- https://attack.mitre.org/techniques/T1056/004/
- https://www.huntress.com/blog/credential-interception-via-nppspy
- https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowshookexw
- https://www.welivesecurity.com/2021/01/26/kobalos-complex-linux-threat-high-performance-computing-infrastructure/
- https://unit42.paloaltonetworks.com/contagious-interview-beavertail-invisibleferret/
- https://www.sentinelone.com/labs/metador-technical-appendix/
- https://www.cybereason.com/blog/research/chaes-hunting-the-prey
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1056.001/T1056.001.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/registry/registry_set/registry_set_credentials_stealing_via_network_provider.yml
- http://opensecuritytraining.info/Keylogging_files/The%20Adventures%20of%20a%20Keystroke.pdf
Unlock Pro Content
Get the full detection package for T1056 including response playbook, investigation guide, and atomic red team tests.