Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Gasket

Detects Gasket

MalwareGasketditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 73

What this rule detects

Detects Gasket

Associated malware family: Gasket.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-gasket.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Gasket : FILE
{
	meta:
		description = "Detects Gasket"
		author = "ditekSHen"
		id = "3afa131d-9c88-50df-a3b4-552db4a84e69"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L7220-L7250"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "0279979915891fc8c813ba555120ee5705b53b234a808b5ca77bff35a082e376"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$s1 = "main.checkGasket" ascii
		$s2 = "main.connectGasket" ascii
		$s3 = "/cert/trust/dev/stderr/dev/stdout/index.html" ascii
		$f1 = ".SetPingHandler." ascii
		$f2 = ".SetPongHandler." ascii
		$f3 = ".computeMergeInfo." ascii
		$f4 = ".computeDiscardInfo." ascii
		$f5 = ".readPlatformMachineID." ascii
		$f6 = ".(*Session).establishStream." ascii
		$f7 = ".(*Session).handleGoAway." ascii
		$f8 = ".(*Stream).processFlags." ascii
		$f9 = ".(*Session).handlePing." ascii
		$f10 = ".(*windowsService).Install." ascii
		$f11 = ".(*windowsService).Uninstall." ascii
		$f12 = ".(*windowsService).Status." ascii
		$f13 = ".getStopTimeout." ascii
		$f14 = ".DialContext." ascii
		$f15 = ".WriteControl." ascii
		$f16 = ".(*Server).authenticate." ascii
		$f17 = ".(*Server).ServeConn." ascii
		$f18 = ".(*TCPProxy).listen." ascii
		$f19 = ".UserPassAuthenticator.Authenticate." ascii
		$f20 = ".(*InfoPacket).XXX_" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 16 of ( $f* ) )
}

Strings (23 patterns)

IdentifierTypeValueModifiers
$s1text"main.checkGasket"ascii
$s2text"main.connectGasket"ascii
$s3text"/cert/trust/dev/stderr/dev/stdout/index.html"ascii
$f1text".SetPingHandler."ascii
$f2text".SetPongHandler."ascii
$f3text".computeMergeInfo."ascii
$f4text".computeDiscardInfo."ascii
$f5text".readPlatformMachineID."ascii
$f6text".(*Session).establishStream."ascii
$f7text".(*Session).handleGoAway."ascii
$f8text".(*Stream).processFlags."ascii
$f9text".(*Session).handlePing."ascii
$f10text".(*windowsService).Install."ascii
$f11text".(*windowsService).Uninstall."ascii
$f12text".(*windowsService).Status."ascii
$f13text".getStopTimeout."ascii
$f14text".DialContext."ascii
$f15text".WriteControl."ascii
$f16text".(*Server).authenticate."ascii
$f17text".(*Server).ServeConn."ascii
$f18text".(*TCPProxy).listen."ascii
$f19text".UserPassAuthenticator.Authenticate."ascii
$f20text".(*InfoPacket).XXX_"ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 16 of ( $f* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $s* ) must match.
  • At least 16 patterns in ( $f* ) 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: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

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

Rule id: 3afa131d-9c88-50df-a3b4-552db4a84e69

Tags:FILE