Skip to content

YARA · elceef yara-rulz

ELCEEF_Base64_SVG_Javascript

Detects base64 encoded SVG objects containing Javascript

Genericelceef yara-rulzMIT LicenseCompiles with YARA-X
Author
marcin@ulikowski.pl
Date
2022-10-25
Modified
2022-12-12
Score / Quality
75 / 75

What this rule detects

Detects base64 encoded SVG objects containing Javascript

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

Summary generated from the rule's metadata and condition.

Rule source

base64-svg-javascript.yarMIT License
rule ELCEEF_Base64_SVG_Javascript
{
	meta:
		description = "Detects base64 encoded SVG objects containing Javascript"
		author = "marcin@ulikowski.pl"
		id = "99275772-1f4f-5616-9a9c-f76b613fe143"
		date = "2022-10-25"
		modified = "2022-12-12"
		reference = "https://github.com/elceef/yara-rulz"
		source_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/Base64_SVG_Javascript.yara#L1-L16"
		license_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
		hash = "fe394a59e961c3fbcc326e7d0ee5909596de55249e669bc4da0aed172c11fda8"
		hash = "f0c94f2705b1aea17f4a6c6d71c6ed725fe71bf66b03b0117060010859ca8a19"
		logic_hash = "e4cb08ccc75dc00b518c4ee1495409ae6bb99e7d493be55312b8d39aa9099cfc"
		score = 75
		quality = 75
		tags = ""

	strings:
		$svg = "\"data:image/svg+xml;base64" wide ascii
		$js = "<script type=\"text/javascript\">" base64

	condition:
		all of them
}

Strings (2 patterns)

IdentifierTypeValueModifiers
$svgtext"\"data:image/svg+xml;base64"wide ascii
$jstext"<script type=\"text/javascript\">"base64

Condition

all of them

In plain words (Heuristic)

  • All 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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • fe394a59e961c3fbcc326e7d0ee5909596de55249e669bc4da0aed172c11fda8
  • f0c94f2705b1aea17f4a6c6d71c6ed725fe71bf66b03b0117060010859ca8a19

Licence & attribution

Author: marcin@ulikowski.pl

Source repository: elceef yara-rulz @ 5683b294a1

Licence: MIT License (repository licence)

Copyright notice: Copyright (c) 2022 Marcin Ulikowski

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 99275772-1f4f-5616-9a9c-f76b613fe143