Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Windows_Wip19_Screencap

Detects ScreenCap resource

APT / threat actorScreencapSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X (with warnings)
Author
Sekoia.io
Date
2022-10-18
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects ScreenCap resource

Associated malware family: Screencap.

Targets: Windows PE, Linux ELF.

It has no patterns: the condition alone decides (modules, file properties or other rules). YARA modules used: pe, hash.

YARA-X says: warning[deprecated_field]: field `number_of_resources` is deprecated

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

apt-windows-wip19-screencap.yarDetection Rule License 1.1
import "pe"
import "hash"

rule SEKOIA_Apt_Windows_Wip19_Screencap : FILE
{
	meta:
		description = "Detects ScreenCap resource"
		author = "Sekoia.io"
		id = "ebf5d2c5-81c9-45c3-aa61-05870f800f6b"
		date = "2022-10-18"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_windows_wip19_screencap.yar#L4-L18"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "02479f0c8199b31f089608da0f44f1487b75790cb31c77bb65ca1fb0fd57ac0d"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	condition:
		( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and for any i in ( 0 .. pe.number_of_resources -1 ) : ( hash.sha256 ( pe.resources [ i ] . offset , pe.resources [ i ] . length ) == "89f4d0e3f7f3318270aa9c8345c1402202b1a02ffefc03c7a86636e297aa0ffc" ) and filesize < 2MB
}

Condition

( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and for any i in ( 0 .. pe.number_of_resources -1 ) : ( hash.sha256 ( pe.resources [ i ] . offset , pe.resources [ i ] . length ) == "89f4d0e3f7f3318270aa9c8345c1402202b1a02ffefc03c7a86636e297aa0ffc" ) and filesize < 2MB

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must start with the ELF header — a Linux/Unix executable.
  • The file must be smaller than 2MB (a cheap guard that skips large files).
  • A for-loop checks a property over several matches or items.
  • Uses the pe module.
  • Uses the hash module.
  • Compares a hash of the file or a part of it.

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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

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

Rule id: ebf5d2c5-81c9-45c3-aa61-05870f800f6b

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE