Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Trojan_And_Keepspy

Finds KeepSpy samples based on specific strings

MalwareSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2023-06-28
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Finds KeepSpy samples based on specific strings

Targets: ZIP / Office Open XML.

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

Summary generated from the rule's metadata and condition.

Rule source

trojan-and-keepspy.yarDetection Rule License 1.1
rule SEKOIA_Trojan_And_Keepspy : FILE
{
	meta:
		description = "Finds KeepSpy samples based on specific strings"
		author = "Sekoia.io"
		id = "9390e7c8-a996-45cc-b642-c23d4b7dcf34"
		date = "2023-06-28"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/trojan_and_keepspy.yar#L1-L22"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "03a954a5585a9a80fdc5a0cd2644a819c540d43b260e040b627530ca88ee08fa"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$str01 = "Characters entered %1$d of %2$d" ascii
		$str02 = "com.google.android.material.behavior.HideBottomViewOnScrollBehavior" ascii
		$str03 = "com/j256/ormlite/core/VERSION.txt" ascii
		$str04 = "res/raw/empty.wav" ascii
		$str05 = "res/mipmap/ic_launcher.png" ascii
		$str06 = "res/interpolator/fast_out_slow_in.xml" ascii
		$str07 = "OnePixelActivity" ascii

	condition:
		uint32be( 0 ) == 0x504B0304 and 6 of them and filesize > 2MB
}

Strings (7 patterns)

IdentifierTypeValueModifiers
$str01text"Characters entered %1$d of %2$d"ascii
$str02text"com.google.android.material.behavior.HideBottomViewOnScrollBehavior"ascii
$str03text"com/j256/ormlite/core/VERSION.txt"ascii
$str04text"res/raw/empty.wav"ascii
$str05text"res/mipmap/ic_launcher.png"ascii
$str06text"res/interpolator/fast_out_slow_in.xml"ascii
$str07text"OnePixelActivity"ascii

Condition

uint32be( 0 ) == 0x504B0304 and 6 of them and filesize > 2MB

In plain words (Heuristic)

  • The file must start with “PK” — a ZIP archive (also Office Open XML, JAR, APK).
  • The file must be larger than 2MB.
  • At least 6 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: 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: 9390e7c8-a996-45cc-b642-c23d4b7dcf34

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE