This detection rule identifies the presence of the pscan2 file on Linux systems, which often indicates an adversary deploying network scanning or reconnaissance tools to map internal infrastructure and discover vulnerable hosts. A SOC team should proactively hunt for this artifact in Azure Sentinel because early identification of such diagnostic utilities can reveal initial footholds established by attackers before they escalate to more aggressive lateral movement or data exfiltration phases.
rule LinuxHacktool_eyes_pscan2 {
meta:
description = "Linux hack tools - file pscan2"
author = "Florian Roth"
reference = "not set"
date = "2015/01/19"
hash = "56b476cba702a4423a2d805a412cae8ef4330905"
strings:
$s0 = "# pscan completed in %u seconds. (found %d ips)" fullword ascii
$s1 = "Usage: %s <b-block> <port> [c-block]" fullword ascii
$s3 = "%s.%d.* (total: %d) (%.1f%% done)" fullword ascii
$s8 = "Invalid IP." fullword ascii
$s9 = "# scanning: " fullword ascii
$s10 = "Unable to allocate socket." fullword ascii
condition:
2 of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 6 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the Linux hack tools - file pscan2 detection rule, including suggested filters and exclusions:
Scheduled Security Compliance Scans
pscan2 (or similar port scanning utilities) to verify network exposure on critical servers. These jobs are triggered via cron at 02:00 AM daily, executing the tool as a non-interactive system user.root or a dedicated service account (e.g., compliance_svc) and the execution time falls within the maintenance window (01:00–04:00). Additionally, filter by command line arguments containing specific flags like --mode=audit.DevOps Pipeline Provisioning
pscan2 against internal Docker bridges, often running as the jenkins user with elevated privileges.java, node, or python3 associated with Jenkins/GitLab). Filter based on the source IP belonging to the internal DevOps subnet range (e.g., 10.20.x.x).Automated Patch Management & Inventory
pscan2 to map open ports on newly patched