Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Downloader_Win_Newsterminal

Detect the PowerShell based downloader used by APT42 called NEWSTERMINAL

MalwareSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X (with warnings)
Author
Sekoia.io
Date
2024-08-26
Modified
2024-12-19
Score / Quality
75 / 78

What this rule detects

Detect the PowerShell based downloader used by APT42 called NEWSTERMINAL

It defines 4 patterns (3 text, 1 hex, 0 regex).

YARA-X says: warning[text_as_hex]: hex pattern could be written as text literal

Summary generated from the rule's metadata and condition.

Rule source

downloader-win-newsterminal.yarDetection Rule License 1.1
rule SEKOIA_Downloader_Win_Newsterminal : FILE
{
	meta:
		description = "Detect the PowerShell based downloader used by APT42 called NEWSTERMINAL"
		author = "Sekoia.io"
		id = "2f9aae45-e3bd-4d87-b336-5d141738952b"
		date = "2024-08-26"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/downloader_win_newsterminal.yar#L1-L20"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "2b756515400d7e3b6e21ee3a83f313c8"
		logic_hash = "45c6c2b5b3723bf3ed46c82e6a254547d8c8b3446bb2fa4b4f0fc8441731ae7e"
		score = 75
		quality = 78
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "Start-Process -FilePath $takeownCommand -ArgumentList $takeownArgs -Wait -NoNewWindow"
		$ = "function Download-And-Extract-Dll {"
		$ = {24 69 63 61 63 6C 73 41 72 67 73 20 3D 20 24 64 65 73 74 69 6E 61 74 69 6F 6E 46 69 6C 65 50 61 74 68 2C 20 22 2F 67 72 61 6E 74 22 2C 20 22 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 73 3A 46 22 2C 20 22 2F 63 22 2C 20 22 2F 71 22}
		$ = "$publicip=(iwr http://127.0.0.1:4040/api/tunnels"

	condition:
		1 of them and filesize < 30KB
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$text"Start-Process -FilePath $takeownCommand -ArgumentList $takeownArgs -Wait -NoNewWindow"
$text"function Download-And-Extract-Dll {"
$hex{24 69 63 61 63 6C 73 41 72 67 73 20 3D 20 24 64 65 73 74 69 6E 61 74 69 6F 6E 46 69 6C 65 50 61 74 68 2C 20 22 2F 67 72 61 6E 74 22 2C 20 22 41 64 6D 69 6E 69 …
$text"$publicip=(iwr http://127.0.0.1:4040/api/tunnels"

Condition

1 of them and filesize < 30KB

In plain words (Heuristic)

  • The file must be smaller than 30KB (a cheap guard that skips large files).
  • At least 1 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).

  • 2b756515400d7e3b6e21ee3a83f313c8

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: 2f9aae45-e3bd-4d87-b336-5d141738952b

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE