Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Generic_Tor_Hidden_Service_Leading_To_Winports

Detects malicious TOR redirection affecting RDP, NetBios

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

What this rule detects

Detects malicious TOR redirection affecting RDP, NetBios

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

Summary generated from the rule's metadata and condition.

Rule source

generic-tor-hidden-service-leading-to-winports.yarDetection Rule License 1.1
rule SEKOIA_Generic_Tor_Hidden_Service_Leading_To_Winports : FILE
{
	meta:
		description = "Detects malicious TOR redirection affecting RDP, NetBios"
		author = "Sekoia.io"
		id = "1e5c469b-f721-44af-87b3-1adf423719c1"
		date = "2023-09-07"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/generic_tor_hidden_service_leading_to_winports.yar#L1-L21"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "39db199ba7fede8df4bdb505b071240dda96b74f66f818f90047dad338dc4a72"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "HiddenServiceDir "
		$s2 = "SocksPort "
		$s3 = "HiddenServicePort "
		$s4 = ":3389"
		$s5 = ":445"

	condition:
		$s1 and $s2 and ( $s4 in ( @s3 .. @s3 + 100 ) or $s5 in ( @s3 .. @s3 + 100 ) ) and filesize < 2000
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$s1text"HiddenServiceDir "
$s2text"SocksPort "
$s3text"HiddenServicePort "
$s4text":3389"
$s5text":445"

Condition

$s1 and $s2 and ( $s4 in ( @s3 .. @s3 + 100 ) or $s5 in ( @s3 .. @s3 + 100 ) ) and filesize < 2000

In plain words (Heuristic)

  • The file must be smaller than 2000 (a cheap guard that skips large files).
  • Pattern $s4 must be found within the range @s3 .. @s3 + 100.
  • Pattern $s5 must be found within the range @s3 .. @s3 + 100.
  • Pattern $s1 must be present.
  • Pattern $s2 must be present.

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: 1e5c469b-f721-44af-87b3-1adf423719c1

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE