This detection identifies potential reconnaissance activity where adversaries execute portscan.exe to map network topology and identify open ports for lateral movement or data exfiltration. Proactive hunting in Azure Sentinel is essential to distinguish legitimate scanning from malicious behavior that often precedes more critical attack phases, ensuring early visibility into initial access attempts.
rule portscan {
meta:
description = "Auto-generated rule on file portscan.exe"
author = "yarGen Yara Rule Generator by Florian Roth"
hash = "a8bfdb2a925e89a281956b1e3bb32348"
strings:
$s5 = "0 :SCAN BEGUN ON PORT:"
$s6 = "0 :PORTSCAN READY."
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 4 specific false positive scenarios for the portscan.exe detection rule, including suggested filters and exclusions tailored for an enterprise environment:
Scenario: Automated Vulnerability Assessment Scans
portscan.exe (or similar) within their installation directory to probe network ports and services on the host itself before reporting findings.nessusagent.exe, qualyspcap.exe, or rapid7-agent.exe located in their standard installation directories (e.g., C:\Program Files\Tenable\Nessus Agent\), exclude the alert.Scenario: Scheduled Endpoint Security Health Checks
portscan.exe to verify that critical security ports are open and listening as part of their daily compliance reporting routine.--health-check, --compliance-scan, or specific internal GUIDs associated with the security vendor, suppress the alert for this process.Scenario: IT Operations and Network Configuration Audits