This detection identifies the presence of the NC.EXE executable, a known component of the Chinese Hacktool set often associated with reconnaissance and lateral movement activities by state-sponsored threat actors. Proactively hunting for this file in Azure Sentinel is critical to uncover early-stage adversary footholds that may evade standard signature-based alerts due to their low severity classification and legitimate appearance.
rule Dos_NC {
meta:
description = "Chinese Hacktool Set - file NC.EXE"
author = "Florian Roth"
reference = "http://tools.zjqhr.com/"
date = "2015-06-13"
hash = "57f0839433234285cc9df96198a6ca58248a4707"
strings:
$s1 = "nc -l -p port [options] [hostname] [port]" fullword ascii
$s2 = "invalid connection to [%s] from %s [%s] %d" fullword ascii
$s3 = "post-rcv getsockname failed" fullword ascii
$s4 = "Failed to execute shell, error = %s" fullword ascii
$s5 = "UDP listen needs -p arg" fullword ascii
condition:
uint16(0) == 0x5a4d and filesize < 290KB and all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 5 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the Chinese Hacktool Set - file NC.EXE detection rule, including suggested filters and exclusions:
Scenario: Legitimate Network Configuration Utility Deployment
NC.EXE filename is frequently used by legitimate network management suites (e.g., Huawei eSight, H3C iMC, or custom internal tools named “Network Controller”) deployed on Windows servers to manage switch configurations. When these utilities are installed or updated via a standard installer, the file is created in C:\Program Files\VendorName\NC.EXE.msiexec.exe or setup.exe).
C:\Program Files\Huawei\*, C:\Program Files\H3C\*, C:\Program Files\InternalIT\NetworkController\NC.EXE.msiexec.exe or Microsoft.Workflow.Compiler.exe.Scenario: Scheduled Patch Management and Compliance Scans
NC.EXE to perform nightly compliance checks, network connectivity tests, or software inventory scans. These run as scheduled tasks under the context of the Local System account.Scheduled Task Name contains “PatchCompliance”, “InventoryScan”, or “NetworkHealthCheck”.