Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Generic_Bat_Script_Mock_Http_Services

Generic rule detecting BAT script using mock HTTP services (used by APT28)

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

What this rule detects

Generic rule detecting BAT script using mock HTTP services (used by APT28)

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

Summary generated from the rule's metadata and condition.

Rule source

generic-bat-script-mock-http-services.yarDetection Rule License 1.1
rule SEKOIA_Generic_Bat_Script_Mock_Http_Services : FILE
{
	meta:
		description = "Generic rule detecting BAT script using mock HTTP services (used by APT28)"
		author = "Sekoia.io"
		id = "1cfbe5ba-6304-476d-8308-928100a85c16"
		date = "2023-09-07"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/generic_bat_script_mock_http_services.yar#L1-L23"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "d34be59cfb054895381580e7852bba6b899cfb680882b7fd24a72438131c3bee"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$bat1 = "@echo off"
		$bat2 = "chcp 65001"
		$ps1 = "WebClient"
		$ps2 = "UploadString"
		$dom1 = "mockbin.org"
		$dom2 = "webhook.site"
		$dom3 = "mocky.io"
		$dom4 = "pipedream.com"

	condition:
		(1 of ( $bat* ) or 1 of ( $ps* ) ) and 1 of ( $dom* ) and filesize < 2000
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$bat1text"@echo off"
$bat2text"chcp 65001"
$ps1text"WebClient"
$ps2text"UploadString"
$dom1text"mockbin.org"
$dom2text"webhook.site"
$dom3text"mocky.io"
$dom4text"pipedream.com"

Condition

(1 of ( $bat* ) or 1 of ( $ps* ) ) and 1 of ( $dom* ) and filesize < 2000

In plain words (Heuristic)

  • The file must be smaller than 2000 (a cheap guard that skips large files).
  • At least 1 patterns in ( $bat* ) must match.
  • At least 1 patterns in ( $ps* ) must match.
  • At least 1 patterns in ( $dom* ) 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: 1cfbe5ba-6304-476d-8308-928100a85c16

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE