Detect Input Capture in Sumo Logic CSE
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.
MITRE ATT&CK
- Tactic
- Collection Credential Access
- Technique
- T1056 Input Capture
- Canonical reference
- https://attack.mitre.org/techniques/T1056/
Sumo Detection Query
/* T1056 Input Capture — Sumo Logic CSE Multi-Signal Detection */
/* Signal 1: Network Provider DLL Registration (Sysmon EID 13) */
_sourceCategory="windows/sysmon" EventCode=13
| where TargetObject matches "*\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order*"
OR TargetObject matches "*\\SYSTEM\\CurrentControlSet\\Services\\*\\NetworkProvider*"
| where !(Image matches "*\\services.exe"
OR Image matches "*\\svchost.exe"
OR Image matches "*\\msiexec.exe"
OR Image matches "*\\TrustedInstaller.exe")
| fields _messageTime, Computer, User, Image, TargetObject, Details
| withtime _messageTime
| eval SignalType="NetworkProviderRegistration", SeverityScore=90
/* Signal 2: Suspicious DLL Load into Credential Process (Sysmon EID 7) */
/* Run separately and union in dashboard */
_sourceCategory="windows/sysmon" EventCode=7
| where (Image matches "*\\winlogon.exe"
OR Image matches "*\\lsass.exe"
OR Image matches "*\\LogonUI.exe"
OR Image matches "*\\consent.exe"
OR Image matches "*\\credui.exe")
| where !(ImageLoaded matches "C:\\Windows\\System32\\*"
OR ImageLoaded matches "C:\\Windows\\SysWOW64\\*"
OR ImageLoaded matches "C:\\Program Files\\*"
OR ImageLoaded matches "C:\\Program Files (x86)\\*")
| fields _messageTime, Computer, User, Image, ImageLoaded, Hashes
| eval SignalType="SuspiciousDLLInCredentialProcess", SeverityScore=85
/* Signal 3: Input Capture API or Tool in Process Commandline (Sysmon EID 1) */
_sourceCategory="windows/sysmon" EventCode=1
| where CommandLine matches "*SetWindowsHookEx*"
OR CommandLine matches "*GetAsyncKeyState*"
OR CommandLine matches "*GetKeyState*"
OR CommandLine matches "*WH_KEYBOARD_LL*"
OR CommandLine matches "*WH_MOUSE_LL*"
OR CommandLine matches "*pyWinhook*"
OR CommandLine matches "*pynput*"
OR CommandLine matches "*Get-Clipboard*"
OR Image matches "*keylog*"
OR Image matches "*keyscan*"
OR Image matches "*inputcap*"
OR Image matches "*hookdll*"
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, ParentCommandLine
| eval SignalType="InputCaptureAPIOrTool", SeverityScore=70
/* Signal 4: Remote Thread into Credential Process (Sysmon EID 8) */
_sourceCategory="windows/sysmon" EventCode=8
| where TargetImage matches "*\\winlogon.exe"
OR TargetImage matches "*\\LogonUI.exe"
OR TargetImage matches "*\\credui.exe"
OR TargetImage matches "*\\consent.exe"
| fields _messageTime, Computer, SourceImage, SourceCommandLine, TargetImage, StartFunction
| eval SignalType="RemoteThreadInCredentialProcess", SeverityScore=95
/* Aggregation query for dashboard panel — run after unioning signals in separate panels */
_sourceCategory="windows/sysmon" (EventCode=1 OR EventCode=7 OR EventCode=8 OR EventCode=13)
| parse "EventCode=*" as EventCode
| parse "Image=*" as Image nodrop
| parse "TargetObject=*" as TargetObject nodrop
| parse "TargetImage=*" as TargetImage nodrop
| parse "ImageLoaded=*" as ImageLoaded nodrop
| parse "CommandLine=*" as CommandLine nodrop
| where (EventCode="13" AND (TargetObject matches "*NetworkProvider*") AND !(Image matches "*services.exe" OR Image matches "*svchost.exe"))
OR (EventCode="7" AND (Image matches "*winlogon.exe" OR Image matches "*lsass.exe" OR Image matches "*LogonUI.exe") AND !(ImageLoaded matches "C:\\Windows\\System32\\*"))
OR (EventCode="1" AND (CommandLine matches "*SetWindowsHookEx*" OR CommandLine matches "*GetAsyncKeyState*" OR CommandLine matches "*WH_KEYBOARD_LL*" OR Image matches "*keylog*"))
OR (EventCode="8" AND (TargetImage matches "*winlogon.exe" OR TargetImage matches "*LogonUI.exe" OR TargetImage matches "*credui.exe"))
| timeslice 1h
| count by _timeslice, EventCode, Computer
| sort by _count desc Sumo Logic multi-signal detection for T1056 Input Capture. Four discrete search queries cover: (1) Network Provider DLL registration via Sysmon registry events, (2) suspicious DLL loads into credential processes, (3) input capture API or tool name detection in process events, and (4) remote thread injection into authentication processes. Designed to be deployed as individual saved searches feeding a unified dashboard.
Data Sources
Required Tables
False Positives & Tuning
- Endpoint protection agents (Symantec, McAfee, Sophos) load monitoring DLLs into system processes including winlogon.exe as part of their protection hooks
- Network authentication clients (GlobalProtect, Cisco AnyConnect) register Network Provider DLLs during VPN client installation or updates
- Legitimate system administration PowerShell scripts using Get-Clipboard for clipboard monitoring in IT automation workflows
- Windows Credential Provider SDK development — developers testing custom credential providers load experimental DLLs into LogonUI or winlogon during development
- Smart card middleware and PKI clients register as Network Providers and load credential DLLs (ActivIdentity, Gemalto SafeNet)
Other platforms for T1056
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1NPPSPY Network Provider Registration (Credential Interception Setup)
Expected signal: Sysmon Event ID 12 (RegistryKeyCreate): TargetObject containing HKLM\SYSTEM\CurrentControlSet\Services\TestNPP. Sysmon Event ID 13 (RegistryValueSet): TargetObject containing NetworkProvider\Order with Details showing 'TestNPP' appended to ProviderOrder. Security Event ID 4657 (Registry value modification) if object access auditing is enabled. MDE DeviceRegistryEvents with ActionType=RegistryKeyCreated and RegistryKeyCreated for both the service key and NetworkProvider\Order.
- Test 2Low-Level Keyboard Hook via PowerShell PInvoke (SetWindowsHookEx WH_KEYBOARD_LL)
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'SetWindowsHookEx', 'WH_KEYBOARD_LL' or value '13', and 'Add-Type'. PowerShell ScriptBlock Log Event ID 4104 with the full PInvoke code including SetWindowsHookEx. MDE DeviceProcessEvents with ProcessCommandLine matching SetWindowsHookEx pattern.
- Test 3Clipboard Monitoring Loop with File Exfiltration Simulation
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-Clipboard', 'while', 'Start-Sleep', 'Add-Content', '-WindowStyle Hidden'. Sysmon Event ID 11 (File Create): cb_harvest.txt created in %TEMP%. MDE DeviceProcessEvents with ProcessCommandLine matching clipboard + loop pattern. MDE DeviceFileEvents showing file writes to TEMP directory.
- Test 4SSH Client Trojanization Simulation (Kobalos Pattern — Linux)
Expected signal: Auditd: file modification events on /usr/bin/ssh binary (syscall=rename or write). Syslog: file integrity monitoring alerts if AIDE/Tripwire/OSSEC is configured. If Linux auditd with file watches configured: SYSCALL records for rename/unlink on /usr/bin/ssh. Process execution telemetry showing /usr/bin/ssh spawning /tmp/ssh_real as child process. File creation event for /tmp/.ssh_capture.log.
- Test 5Python Keylogger via pynput (Cross-Platform)
Expected signal: Sysmon Event ID 1: Process Create for pip.exe (pynput installation) and python.exe (keylogger execution). CommandLine of python.exe containing 'pynput', 'keyboard', 'Listener', 'on_press'. Sysmon Event ID 7: Image loads for pynput DLL dependencies into python.exe. Network connection (Sysmon Event ID 3) from pip.exe to PyPI for package download during installation phase. MDE DeviceProcessEvents capturing both pip and python command lines.
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.