Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Solarmarker_Powershell

Finds SolarMarker PowerShell script based on characteristic strings

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

What this rule detects

Finds SolarMarker PowerShell script based on characteristic strings

Associated malware family: Solarmarker.

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

Summary generated from the rule's metadata and condition.

Rule source

infostealer-win-solarmarker-powershell.yarDetection Rule License 1.1
rule SEKOIA_Infostealer_Win_Solarmarker_Powershell : FILE
{
	meta:
		description = "Finds SolarMarker PowerShell script based on characteristic strings"
		author = "Sekoia.io"
		id = "a2fe7f09-7134-4054-ba40-5ea66785a26d"
		date = "2022-12-09"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/infostealer_win_solarmarker_powershell.yar#L1-L25"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "32267cf7e03ed65da969aeeff5ef5d7291e47446ea11a4b391f085967e8aa67d"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$fun = "function " ascii
		$ps0 = "return -join (0..(10..30|Get-Random)|%{[char]((65..90)+(97..122)|Get-Random)})" ascii
		$ps1 = /new-item -path \$[a-zA-Z0-9_]* -itemtype registrykey -force;/
		$ps2 = /set-item -path \$[a-zA-Z0-9_]* -value \$[a-zA-Z0-9_]*;/
		$str0 = "[IO.File]::WriteAllText($" ascii
		$str1 = "CreateShortcut($env:appdata+" ascii
		$str2 = "Registry::HKEY_CURRENT_USER\\Software\\Classes\\" ascii
		$str3 = "New-Object System.Security.Cryptography.AesCryptoServiceProvider" ascii
		$str4 = "[Convert]::FromBase64String([IO.File]::ReadAllText(" ascii

	condition:
		$fun at 0 and 1 of ( $ps* ) and 2 of ( $str* )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$funtext"function "ascii
$ps0text"return -join (0..(10..30|Get-Random)|%{[char]((65..90)+(97..122)|Get-Random)})"ascii
$ps1regex/new-item -path \$[a-zA-Z0-9_]* -itemtype registrykey -force;/
$ps2regex/set-item -path \$[a-zA-Z0-9_]* -value \$[a-zA-Z0-9_]*;/
$str0text"[IO.File]::WriteAllText($"ascii
$str1text"CreateShortcut($env:appdata+"ascii
$str2text"Registry::HKEY_CURRENT_USER\\Software\\Classes\\"ascii
$str3text"New-Object System.Security.Cryptography.AesCryptoServiceProvider"ascii
$str4text"[Convert]::FromBase64String([IO.File]::ReadAllText("ascii

Condition

$fun at 0 and 1 of ( $ps* ) and 2 of ( $str* )

In plain words (Heuristic)

  • At least 1 patterns in ( $ps* ) must match.
  • At least 2 patterns in ( $str* ) must match.
  • Pattern $fun must be found at offset 0.

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: a2fe7f09-7134-4054-ba40-5ea66785a26d

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Solarmarker rules