Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Loader_Win_Konni_Bat

Detect the BAT files (named trap.bat or yup.bat) used by KONNI

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

What this rule detects

Detect the BAT files (named trap.bat or yup.bat) used by KONNI

Associated malware family: Konni.

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

Summary generated from the rule's metadata and condition.

Rule source

loader-win-konni-bat.yarDetection Rule License 1.1
rule SEKOIA_Loader_Win_Konni_Bat : FILE
{
	meta:
		description = "Detect the BAT files (named trap.bat or yup.bat) used by KONNI"
		author = "Sekoia.io"
		id = "e8921336-6c91-4b46-bd3f-3cf4a9b31082"
		date = "2023-09-26"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/loader_win_konni_bat.yar#L1-L22"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "3476e41461692c3ccfc0ef47a4d5b8822c4940987755763d2a5913e27d9350d4"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "del /f /q \"%~dp0\\*.zip\" > nul"
		$ = "del /f /q \"%~dp0\\*.xml\" > nul"
		$ = "del /f /q \"%~dp0\\wpnprv*.dll\" > nul"
		$ = "del /f /q \"%~dp0\\*.bat\" > nul"
		$ = "del /f /q \"%~dpnx0\" > nul"
		$ = "echo %~dp0 | findstr /i \"system32\" > nul"
		$ = "if %ERRORLEVEL% equ 0 (goto INSTALL) else (goto COPYFILE)"
		$ = "if exist \"%ProgramFiles(x86)%\" ("

	condition:
		3 of them and filesize < 3KB
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$text"del /f /q \"%~dp0\\*.zip\" > nul"
$text"del /f /q \"%~dp0\\*.xml\" > nul"
$text"del /f /q \"%~dp0\\wpnprv*.dll\" > nul"
$text"del /f /q \"%~dp0\\*.bat\" > nul"
$text"del /f /q \"%~dpnx0\" > nul"
$text"echo %~dp0 | findstr /i \"system32\" > nul"
$text"if %ERRORLEVEL% equ 0 (goto INSTALL) else (goto COPYFILE)"
$text"if exist \"%ProgramFiles(x86)%\" ("

Condition

3 of them and filesize < 3KB

In plain words (Heuristic)

  • The file must be smaller than 3KB (a cheap guard that skips large files).
  • At least 3 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: e8921336-6c91-4b46-bd3f-3cf4a9b31082

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Konni rules