Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Lastconn

Detects LastConn

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

What this rule detects

Detects LastConn

Associated malware family: Lastconn.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-lastconn.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Lastconn : FILE
{
	meta:
		description = "Detects LastConn"
		author = "ditekSHen"
		id = "18727c30-d84d-5ffa-acd4-2cc54e553604"
		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#L6865-L6894"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "94f5874353d0fb475595373c06a0de91603cad9b435d35dc00febf90608d6b5a"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "System.Net.Http.SysSR" fullword wide
		$s2 = "System.Net.Http.WrSR" fullword wide
		$s3 = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK" fullword wide
		$s4 = { 63 00 6f 00 6e 00 74 00 65 00 6e 00 74 00 0c 6e
               00 6f 00 74 00 69 00 66 00 79 00 04 06 12 80 e8
               05 00 00 12 80 e8 08 75 00 73 00 65 00 72 00 08
               74 00 65 00 61 00 6d 00 06 61 00 70 00 70 00 0c
               6e 00 6f 00 61 00 75 00 74 00 68 00 }
		$s5 = { 68 00 69 00 64 00 64 00 65 00 6e 00 10 64 00 69
               00 73 00 61 00 6c 00 6c 00 6f 00 77 00 0e 65 00
               78 00 74 00 65 00 6e 00 64 00 73 00 04 69 00 64
               00 16 75 00 6e 00 69 00 71 00 75 00 65 00 49 00
               74 00 65 00 6d 00 73 }
		$s6 = "<RunFileOnes>d__" ascii
		$s7 = "<UploadFile>d__" ascii
		$s8 = "<ChunkUpload>d__" ascii
		$s9 = "<StartFolder>d__" ascii
		$s10 = "<ReadFileAlw>d__" ascii
		$s12 = "<WriteFileToD>d__" ascii
		$s13 = "<ReadFile>d__" ascii
		$s14 = "<GetUpload>d__" ascii
		$s15 = "CDropbox.Api.DropboxRequestHandler+<RequestJsonStringWithRetry>d__" ascii

	condition:
		uint16( 0 ) == 0x5a4d and 12 of them
}

Strings (14 patterns)

IdentifierTypeValueModifiers
$s1text"System.Net.Http.SysSR"fullword wide
$s2text"System.Net.Http.WrSR"fullword wide
$s3text"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"fullword wide
$s4hex{ 63 00 6f 00 6e 00 74 00 65 00 6e 00 74 00 0c 6e 00 6f 00 74 00 69 00 66 00 79 00 04 06 12 80 e8 05 00 00 12 80 e8 08 75 00 73 00 …
$s5hex{ 68 00 69 00 64 00 64 00 65 00 6e 00 10 64 00 69 00 73 00 61 00 6c 00 6c 00 6f 00 77 00 0e 65 00 78 00 74 00 65 00 6e 00 64 00 73 …
$s6text"<RunFileOnes>d__"ascii
$s7text"<UploadFile>d__"ascii
$s8text"<ChunkUpload>d__"ascii
$s9text"<StartFolder>d__"ascii
$s10text"<ReadFileAlw>d__"ascii
$s12text"<WriteFileToD>d__"ascii
$s13text"<ReadFile>d__"ascii
$s14text"<GetUpload>d__"ascii
$s15text"CDropbox.Api.DropboxRequestHandler+<RequestJsonStringWithRetry>d__"ascii

Condition

uint16( 0 ) == 0x5a4d and 12 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 12 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

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: 18727c30-d84d-5ffa-acd4-2cc54e553604

Tags:FILE