Windows Taskkill Used for Defense Evasion
The analytic identifies the use of taskkill.exe to forcibly terminate processes, focusing on command-line executions that include specific taskkill parameters, which can indicate attempts to disable security tools or disrupt legitimate applications.
This analytic focuses on detecting the use of taskkill.exe to forcibly terminate processes on Windows systems. Attackers commonly use this technique to disable security tools, disrupt legitimate applications, and evade detection. The detection leverages endpoint detection and response (EDR) agents to monitor command-line executions of taskkill.exe with specific parameters, such as /f (force), /t (terminate child processes), /im (image name), and /pid (process ID). Identifying this activity is crucial for defenders because successful termination of security processes can allow attackers to operate undetected, maintain persistence, and escalate their privileges within the compromised environment. This technique has been observed in malware operations, including those associated with remote access trojans (RATs) like NjRAT.
Attack Chain
- Initial access is gained through an exploit or social engineering.
- The attacker executes
taskkill.exewith the/imparameter followed by the image name of a security tool (e.g.,taskkill /im av.exe /f). - Alternatively, the attacker uses the
/pidparameter to terminate a specific process by its process ID (e.g.,taskkill /pid 1234 /f). - The
/fparameter forces the termination of the targeted process, bypassing normal termination procedures. - The
/tparameter is used to terminate any child processes associated with the targeted process, ensuring complete removal (e.g.,taskkill /im process.exe /t /f). - Successful termination of security tools allows the attacker to evade detection.
- The attacker can then execute malicious payloads or perform lateral movement without interference from security software.
- The final objective is to exfiltrate data, deploy ransomware, or achieve other malicious goals.
Impact
Successful use of taskkill.exe to disable or disrupt security tools can severely compromise a system’s defenses. This can lead to extended periods of undetected malicious activity, resulting in data theft, system instability, or complete system compromise. Specific impacts may include data breaches, financial loss, and reputational damage. This technique is often a precursor to more serious attacks like ransomware deployment, with potential widespread damage across the targeted organization.
Recommendation
- Enable Sysmon Event ID 1 and Windows Event Log Security 4688 logging to capture process creation events with command-line arguments for
taskkill.exe. - Deploy the Sigma rules provided to your SIEM to detect suspicious use of
taskkill.exe, focusing on processes being terminated and the users initiating the termination. - Investigate any alerts generated by the Sigma rules, focusing on the parent processes of
taskkill.exeand the processes being terminated. - Tune the Sigma rules based on your environment to reduce false positives from legitimate administrative activity, as identified in the ‘known_false_positives’ section.
- Implement network segmentation to limit the potential impact of a successful attack, mitigating lateral movement post-compromise.
Detection coverage 3
Detect Taskkill with Force Option
highDetects taskkill.exe being used with the /f (force) option, which can indicate attempts to disable security tools.
Detect Taskkill Terminating Child Processes
mediumDetects taskkill.exe being used with the /t (terminate child processes) option, often used to ensure complete removal of a process.
Detect Taskkill Targeting Specific Processes by Name
mediumDetects taskkill.exe being used with the /im option to target processes by image name, potentially to disable security software.
Detection queries are kept inside the platform. Get full rules →