Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_SCN_Portscan

Detects a port scanner tool observed as second or third stage post-compromise or dropped by malware.

Suspicious / huntingditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-09-25
Score / Quality
75 / 75

What this rule detects

Detects a port scanner tool observed as second or third stage post-compromise or dropped by malware.

Targets: Windows PE.

It defines 7 patterns (7 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-scn-portscan.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_SCN_Portscan : FILE
{
	meta:
		description = "Detects a port scanner tool observed as second or third stage post-compromise or dropped by malware."
		author = "ditekSHen"
		id = "f270e098-17a0-5d66-acd0-c946a29919f4"
		date = "2020-11-06"
		modified = "2024-09-25"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/indicator_tools.yar#L166-L180"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "ebe5eb045a250ca38a55ac43018548074e9db160d76737c36f8ae5ea268b7b10"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "HEAD / HTTP/1.0" fullword ascii
		$s2 = "Result.txt" fullword ascii
		$s3 = "Example: %s SYN " ascii
		$s4 = "Performing Time: %d/%d/%d %d:%d:%d -->" fullword ascii
		$s5 = "Bind On IP: %d.%d.%d.%d" fullword ascii
		$s6 = "SYN Scan: About To Scan %" ascii
		$s7 = "Normal Scan: About To Scan %" ascii

	condition:
		uint16( 0 ) == 0x5a4d and 5 of them
}

Strings (7 patterns)

IdentifierTypeValueModifiers
$s1text"HEAD / HTTP/1.0"fullword ascii
$s2text"Result.txt"fullword ascii
$s3text"Example: %s SYN "ascii
$s4text"Performing Time: %d/%d/%d %d:%d:%d -->"fullword ascii
$s5text"Bind On IP: %d.%d.%d.%d"fullword ascii
$s6text"SYN Scan: About To Scan %"ascii
$s7text"Normal Scan: About To Scan %"ascii

Condition

uint16( 0 ) == 0x5a4d and 5 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 5 patterns in the rule must match.

Test this rule in your browser

Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

References

Licence & attribution

Author: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: f270e098-17a0-5d66-acd0-c946a29919f4

Tags:FILE