This detection identifies potential reconnaissance activity where adversaries utilize a PortScanner.exe tool to map network topology and identify open services for lateral movement opportunities. Proactively hunting for this behavior in Azure Sentinel is essential because early-stage port scanning often precedes more critical attacks like credential dumping or remote exploitation, allowing the SOC team to mitigate risks before they escalate.
rule PortScanner {
meta:
description = "Auto-generated rule on file PortScanner.exe"
author = "yarGen Yara Rule Generator by Florian Roth"
hash = "b381b9212282c0c650cb4b0323436c63"
strings:
$s0 = "Scan Ports Every"
$s3 = "Scan All Possible Ports!"
condition:
all of them
}
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 PortScanner.exe detection rule, including suggested filters and exclusions tailored for an enterprise environment:
Scenario: IT Admin Network Audit via PowerShell
C:\Tools\NetworkUtils\PortScanner.exe with arguments like -s 192.168.x.x -p 443. This is a legitimate, manual or scripted administrative task often performed during maintenance windows.Logon User matches specific service accounts (e.g., svc-network-audit) or domain admin groups (e.g., DOMAIN\IT-Admins). Additionally, filter by command line arguments containing -audit or -scheduled.Scenario: Endpoint Detection and Response (EDR) Health Check
PortScanner.exe to verify firewall rule integrity and network connectivity between the endpoint and the management server. This occurs automatically every 4 hours.C:\Program Files\CrowdStrike\csagent.exe or MsMpEng.exe). This ensures that scans initiated by the security tool itself do not trigger self-alerts.Scenario: Automated Software Deployment via SCCM/Intune