Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_Ligolo

Detects Ligolo tool for establishing SOCKS5 or TCP tunnels from a reverse connection

Suspicious / huntingditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-09-25
Score / Quality
75 / 73

What this rule detects

Detects Ligolo tool for establishing SOCKS5 or TCP tunnels from a reverse connection

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-ligolo.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_Ligolo : FILE
{
	meta:
		description = "Detects Ligolo tool for establishing SOCKS5 or TCP tunnels from a reverse connection"
		author = "ditekSHen"
		id = "cc461fd1-9a2f-59ce-af74-a0f55b8850b1"
		date = "2020-11-06"
		modified = "2024-09-25"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/indicator_tools.yar#L1371-L1385"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "b515dc184013c2f67d37e42d7172e2471b3a93c94024be12c7f587296287282d"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$p1 = "/ligolo/main.go" ascii
		$p2 = "/armon/go-socks5" ascii
		$s1 = "main.StartLigolo" fullword ascii
		$s2 = "main.handleRelay" fullword ascii
		$s3 = "main.startSocksProxy" fullword ascii
		$s4 = "_main.tlsFingerprint" fullword ascii
		$s5 = "main.verifyTlsCertificate" fullword ascii

	condition:
		( uint16( 0 ) == 0x5a4d or uint16( 0 ) == 0x457f or uint16( 0 ) == 0xfacf ) and ( ( all of ( $p* ) and 1 of ( $s* ) ) or all of ( $s* ) or ( 1 of ( $p* ) and 4 of ( $s* ) ) )
}

Strings (7 patterns)

IdentifierTypeValueModifiers
$p1text"/ligolo/main.go"ascii
$p2text"/armon/go-socks5"ascii
$s1text"main.StartLigolo"fullword ascii
$s2text"main.handleRelay"fullword ascii
$s3text"main.startSocksProxy"fullword ascii
$s4text"_main.tlsFingerprint"fullword ascii
$s5text"main.verifyTlsCertificate"fullword ascii

Condition

( uint16( 0 ) == 0x5a4d or uint16( 0 ) == 0x457f or uint16( 0 ) == 0xfacf ) and ( ( all of ( $p* ) and 1 of ( $s* ) ) or all of ( $s* ) or ( 1 of ( $p* ) and 4 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $p* ) must match.
  • All patterns in ( $s* ) must match.
  • At least 1 patterns in ( $s* ) must match.
  • At least 1 patterns in ( $p* ) must match.
  • At least 4 patterns in ( $s* ) 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: cc461fd1-9a2f-59ce-af74-a0f55b8850b1

Tags:FILE