Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Konni

Rule based on structure offsets and file extension

APT / threat actorKonniSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-09-12
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Rule based on structure offsets and file extension

Associated malware family: Konni.

Targets: Windows PE.

It defines 9 patterns (6 text, 3 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

apt-konni.yarDetection Rule License 1.1
rule SEKOIA_Apt_Konni : FILE
{
	meta:
		description = "Rule based on structure offsets and file extension"
		author = "Sekoia.io"
		id = "6a20c492-e932-41bd-ac4a-01d35bfb0c49"
		date = "2022-09-12"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_konni.yar#L1-L25"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "8f178421fd0968f4ce809054022579c7fc8dede5f6514e89966d13acb83d75d9"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ext_1 = ".zip" wide ascii fullword
		$ext_2 = ".cab" wide ascii fullword
		$ext_3 = ".rar" wide ascii fullword
		$ext_4 = ".ini" wide ascii fullword
		$ext_5 = ".dat" wide ascii fullword
		$offset_structure_1 = { 8d ?? 08 02 00 00 }
		$offset_structure_2 = { 8d ?? 10 04 00 00 }
		$offset_structure_3 = { 8d ?? 18 06 00 00 }
		$url = "%s/dn.php?name=%s&prefix=%s" wide

	condition:
		uint16be( 0 ) == 0x4d5a and filesize < 3MB and 3 of ( $ext_* ) and all of ( $offset_structure_* ) and $url
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$ext_1text".zip"wide ascii fullword
$ext_2text".cab"wide ascii fullword
$ext_3text".rar"wide ascii fullword
$ext_4text".ini"wide ascii fullword
$ext_5text".dat"wide ascii fullword
$offset_structure_1hex{ 8d ?? 08 02 00 00 }
$offset_structure_2hex{ 8d ?? 10 04 00 00 }
$offset_structure_3hex{ 8d ?? 18 06 00 00 }
$urltext"%s/dn.php?name=%s&prefix=%s"wide

Condition

uint16be( 0 ) == 0x4d5a and filesize < 3MB and 3 of ( $ext_* ) and all of ( $offset_structure_* ) and $url

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 3MB (a cheap guard that skips large files).
  • All patterns in ( $offset_structure_* ) must match.
  • At least 3 patterns in ( $ext_* ) must match.
  • Pattern $url must be present.

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: 6a20c492-e932-41bd-ac4a-01d35bfb0c49

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Konni rules