This detection targets adversaries utilizing the PipeCmd.exe utility to establish covert command-and-control channels or execute lateral movements within Azure environments. Proactive hunting for this specific artifact is critical because its legitimate appearance often masks persistent Chinese threat actor activity that may evade standard signature-based alerts due to its low severity classification.
rule HScan_v1_20_PipeCmd {
meta:
description = "Chinese Hacktool Set - file PipeCmd.exe"
author = "Florian Roth"
reference = "http://tools.zjqhr.com/"
date = "2015-06-13"
hash = "64403ce63b28b544646a30da3be2f395788542d6"
strings:
$s1 = "%SystemRoot%\\system32\\PipeCmdSrv.exe" fullword ascii
$s2 = "PipeCmd.exe" fullword wide
$s3 = "Please Use NTCmd.exe Run This Program." fullword ascii
$s4 = "%s\\pipe\\%s%s%d" fullword ascii
$s5 = "\\\\.\\pipe\\%s%s%d" fullword ascii
$s6 = "%s\\ADMIN$\\System32\\%s%s" fullword ascii
$s7 = "This is a service executable! Couldn't start directly." fullword ascii
$s8 = "Connecting to Remote Server ...Failed" fullword ascii
$s9 = "PIPECMDSRV" fullword wide
condition:
uint16(0) == 0x5a4d and filesize < 200KB and 4 of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 9 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the Chinese Hacktool Set - file PipeCmd.exe detection rule, along with suggested filters or exclusions:
Scenario: Legitimate Deployment via Microsoft Endpoint Configuration Manager (SCCM)
ccmexec.exe) frequently deploys custom PowerShell scripts or third-party utilities to client machines. If an organization uses a legitimate Chinese management utility named PipeCmd.exe for network diagnostics, the deployment of this file from the Software Distribution point will trigger the rule.ccmexec.exe and the source path contains \Microsoft\CCM\. Additionally, whitelist the specific SHA-256 hash of the known legitimate PipeCmd.exe binary used in your environment.Scenario: Scheduled Maintenance Job for Database Connectivity
PipeCmd.exe. This job executes under the context of System or a dedicated service account, creating temporary log files or configuration updates with this name.svchost.exe (specifically the Schedule service) and the user principal name matches the known maintenance service account (e.g., svc-db-maint).Scenario: Third-Party IT Asset Management Scanning
PipeCmd.exe in the %TEMP% directory during an inventory sweep to parse pipe-based data