Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_MAL_CN_Wocao_Getos_Py

Python getos utility

APT / threat actorSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Fox-IT SRT
Date
2019-12-20
Modified
2023-12-05
Score / Quality
75 / 85

What this rule detects

Python getos utility

It defines 19 patterns (17 text, 2 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

apt-mal-cn-wocao-getos-py.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_MAL_CN_Wocao_Getos_Py
{
	meta:
		description = "Python getos utility"
		author = "Fox-IT SRT"
		id = "4a731dde-87e4-566a-b559-d23e0bef5841"
		date = "2019-12-20"
		modified = "2023-12-05"
		reference = "https://www.fox-it.com/en/news/whitepapers/operation-wocao-shining-a-light-on-one-of-chinas-hidden-hacking-groups/"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_op_wocao.yar#L234-L295"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "2535c01b703c0fcba43e771832db8cd969e4a4b112ef28e4ddfeac6491ba604c"
		score = 75
		quality = 85
		tags = ""

	strings:
		$smb_1 = {
            00 00 00 85 ff 53 4d 42 72 00 00 00 00 18 53 c8
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff fe
            00 00 ff b4 00 62 00 02 50 43 20 4e 45 54 57 4f
            52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02
            4c 41 4e 4d 41 4e 31 2e 30 00 02 57 69 6e 64 6f
            77 73 20 66 6f 72 20 57 6f 72 6b 67 72 6f 75 70
            73 20 33 2e 31 61 00 02 4c 4d 31 2e 32 58 30 30
            32 00 02 4c 41 4e 4d 41 4e 32 2e 31 00 02 4e 54
            20 4c 4d 20 30 2e 31 32 00
        }
		$smb_2 = {
            00 00 00 c8 ff 53 4d 42 73 00 00 00 00 18 03 c8
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff fe
            00 00 3f b5 0c ff 00 c8 00 04 11 32 00 00 00 00
            00 00 00 28 00 00 00 00 00 d4 00 00 a0 8d 00 4e
            54 4c 4d 53 53 50 00 01 00 00 00 07 82 88 a2 00
            00 00 00 28 00 00 00 00 00 00 00 28 00 00 00 05
            01 28 0a 00 00 00 0f 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            00 00 00 00 00 00 00 00 00 00 00 00
        }
		$smbstr_1 = "\\x00\\x00\\x00\\x85\\xffSMBr\\x00\\x00\\x00\\x00\\x18S\\xc8\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xfe\\x00\\x00\\xff\\xb4\\x00b\\x00\\x02PC NETWORK PROGRAM 1.0\\x00\\x02LANMAN1.0\\x00\\x02Windows for Workgroups 3.1a\\x00\\x02LM1.2X002\\x00\\x02LANMAN2.1\\x00\\x02NT LM 0.12\\x00"
		$smbstr_2 = "\\x00\\x00\\x00\\xc8\\xffSMBs\\x00\\x00\\x00\\x00\\x18\\x03\\xc8\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xfe\\x00\\x00?\\xb5\\x0c\\xff\\x00\\xc8\\x00\\x04\\x112\\x00\\x00\\x00\\x00\\x00\\x00\\x00(\\x00\\x00\\x00\\x00\\x00\\xd4\\x00\\x00\\xa0\\x8d\\x00NTLMSSP\\x00\\x01\\x00\\x00\\x00\\x07\\x82\\x88\\xa2\\x00\\x00\\x00\\x00(\\x00\\x00\\x00\\x00\\x00\\x00\\x00(\\x00\\x00\\x00\\x05\\x01(\\n\\x00\\x00\\x00\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00"
		$code_1 = "return 'Other error.'" ascii wide
		$code_2 = "sblob = buf[47:47 + sbl]" ascii wide
		$code_3 = "re.split('[\\x00-,]+', y[-4])" ascii wide
		$code_4 = "('').join(sblob[off:off + hlen].split('\\x00'))" ascii wide
		$code_5 = "banner = '%s    %s' % (hostname, native)" ascii wide
		$code_6 = "banner = '%s\\\\%s    %s' % (dm, hostname, native)" ascii wide
		$tsk_1 = "PushTask" ascii wide
		$tsk_2 = "parse_task" ascii wide
		$tsk_3 = "commit_task" ascii wide
		$str_1 = "Usage: getos.py <ip-range|ip-file>" ascii wide
		$str_2 = "The path '%s' write fails." ascii wide
		$str_3 = "Receive a signal %d," ascii wide
		$str_4 = "Scan Complete!" ascii wide
		$str_5 = "line: %d, %s: %s" ascii wide
		$str_6 = "Other error." ascii wide

	condition:
		( all of ( $smb_* ) ) or ( all of ( $smbstr_* ) ) or ( 3 of ( $code_* ) ) or ( all of ( $tsk_* ) ) or ( 3 of ( $str_* ) )
}

Strings (19 patterns)

IdentifierTypeValueModifiers
$smb_1hex{ 00 00 00 85 ff 53 4d 42 72 00 00 00 00 18 53 c8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff fe 00 00 ff b4 00 62 00 02 50 …
$smb_2hex{ 00 00 00 c8 ff 53 4d 42 73 00 00 00 00 18 03 c8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff fe 00 00 3f b5 0c ff 00 c8 00 …
$smbstr_1text"\\x00\\x00\\x00\\x85\\xffSMBr\\x00\\x00\\x00\\x00\\x18S\\xc8\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xfe\\x00\\x00\\xff\\xb …
$smbstr_2text"\\x00\\x00\\x00\\xc8\\xffSMBs\\x00\\x00\\x00\\x00\\x18\\x03\\xc8\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xfe\\x00\\x00?\\xb …
$code_1text"return 'Other error.'"ascii wide
$code_2text"sblob = buf[47:47 + sbl]"ascii wide
$code_3text"re.split('[\\x00-,]+', y[-4])"ascii wide
$code_4text"('').join(sblob[off:off + hlen].split('\\x00'))"ascii wide
$code_5text"banner = '%s %s' % (hostname, native)"ascii wide
$code_6text"banner = '%s\\\\%s %s' % (dm, hostname, native)"ascii wide
$tsk_1text"PushTask"ascii wide
$tsk_2text"parse_task"ascii wide
$tsk_3text"commit_task"ascii wide
$str_1text"Usage: getos.py <ip-range|ip-file>"ascii wide
$str_2text"The path '%s' write fails."ascii wide
$str_3text"Receive a signal %d,"ascii wide
$str_4text"Scan Complete!"ascii wide
$str_5text"line: %d, %s: %s"ascii wide
$str_6text"Other error."ascii wide

Condition

( all of ( $smb_* ) ) or ( all of ( $smbstr_* ) ) or ( 3 of ( $code_* ) ) or ( all of ( $tsk_* ) ) or ( 3 of ( $str_* ) )

In plain words (Heuristic)

  • All patterns in ( $smb_* ) must match.
  • All patterns in ( $smbstr_* ) must match.
  • All patterns in ( $tsk_* ) must match.
  • At least 3 patterns in ( $code_* ) must match.
  • At least 3 patterns in ( $str_* ) 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: Fox-IT SRT

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

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: 4a731dde-87e4-566a-b559-d23e0bef5841