Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Loader_Win_Batloader_Scripts

Finds BatLoader samples based on the specific download URL

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

What this rule detects

Finds BatLoader samples based on the specific download URL

It defines 15 patterns (14 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

loader-win-batloader-scripts.yarDetection Rule License 1.1
rule SEKOIA_Loader_Win_Batloader_Scripts : FILE
{
	meta:
		description = "Finds BatLoader samples based on the specific download URL"
		author = "Sekoia.io"
		id = "31a04ad3-74f8-4aa5-b3fc-df792bdc71b5"
		date = "2022-11-30"
		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_batloader_scripts.yar#L1-L30"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "aab6c7780bbc7bed8994b4e70129107bb7b719642fae92b1d3f9146eb11efabc"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$url = /https?:\/\/[^\s]{15,35}\/index\/[^\s]{1,40}servername=msi/ ascii wide
		$str00 = "Invoke-WebRequest" ascii wide
		$str01 = "PSScriptRoot" ascii wide
		$str02 = "Add-MpPreference" ascii wide
		$str03 = "Install-GnuPG" ascii wide
		$str04 = "wmic computersystem get domain" ascii wide
		$str05 = "ArpInfo" ascii wide
		$str06 = "$script:List_ProccesCheck" ascii wide
		$str07 = "Get-Process -Name" ascii wide
		$str08 = "f001_SetProcessList" ascii wide
		$str09 = "var WshShell" ascii wide
		$str10 = "WScript.Sleep" ascii wide
		$str11 = "WshShell.Run" ascii wide
		$str12 = "powershell Invoke-WebRequest" ascii wide
		$str13 = "-nop -w hidden " ascii wide

	condition:
		$url and 2 of ( $str* ) and filesize < 50KB
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$urlregex/https?:\/\/[^\s]{15,35}\/index\/[^\s]{1,40}servername=msi/ascii wide
$str00text"Invoke-WebRequest"ascii wide
$str01text"PSScriptRoot"ascii wide
$str02text"Add-MpPreference"ascii wide
$str03text"Install-GnuPG"ascii wide
$str04text"wmic computersystem get domain"ascii wide
$str05text"ArpInfo"ascii wide
$str06text"$script:List_ProccesCheck"ascii wide
$str07text"Get-Process -Name"ascii wide
$str08text"f001_SetProcessList"ascii wide
$str09text"var WshShell"ascii wide
$str10text"WScript.Sleep"ascii wide
$str11text"WshShell.Run"ascii wide
$str12text"powershell Invoke-WebRequest"ascii wide
$str13text"-nop -w hidden "ascii wide

Condition

$url and 2 of ( $str* ) and filesize < 50KB

In plain words (Heuristic)

  • The file must be smaller than 50KB (a cheap guard that skips large files).
  • At least 2 patterns in ( $str* ) 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: 31a04ad3-74f8-4aa5-b3fc-df792bdc71b5

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE