This detection rule identifies adversaries actively performing network reconnaissance by scanning ports to map potential attack surfaces and identify vulnerable services within the Azure environment. Proactively hunting for this behavior allows the SOC team to detect early-stage intrusion attempts before attackers can leverage discovered entry points for lateral movement or exploitation.
rule CN_Portscan : APT
{
meta:
description = "CN Port Scanner"
author = "Florian Roth"
release_date = "2013-11-29"
confidential = false
score = 70
strings:
$s1 = "MZ"
$s2 = "TCP 12.12.12.12"
condition:
($s1 at 0) and $s2
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the CN Port Scanner detection rule, including suggested filters and exclusions tailored for an enterprise environment:
Scenario: Scheduled Vulnerability Assessment Scans
10.50.20.0/24) or filter alerts where the source process name matches known scanner executables (e.g., nessuscli.exe, qualyspcd).Scenario: Internal Network Discovery by IT Operations
172.16.0.0/16) where monitoring appliances reside, or filter alerts where the destination port is restricted to standard discovery ports like UDP 161 (SNMP) or TCP 443 during off-peak hours.Scenario: Automated Software Update and Patch Deployment