Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Bot_Lin_Enemybot_April22

Detect enemybot based on command line observed in strings

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

What this rule detects

Detect enemybot based on command line observed in strings

Targets: Linux ELF, macOS Mach-O.

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

Summary generated from the rule's metadata and condition.

Rule source

bot-lin-enemybot-april22.yarDetection Rule License 1.1
rule SEKOIA_Bot_Lin_Enemybot_April22 : FILE
{
	meta:
		description = "Detect enemybot based on command line observed in strings"
		author = "Sekoia.io"
		id = "5778c653-39ce-4f5d-b10b-1503b74e5041"
		date = "2022-04-14"
		modified = "2024-12-19"
		reference = "https://twitter.com/3xp0rtblog/status/137520616938452173://www.fortinet.com/blog/threat-research/enemybot-a-look-into-keksecs-latest-ddos-botnet"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/bot_lin_enemybot_april22.yar#L1-L26"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "18ea06e60259f8d7d639b0e4659f0f5e166e9589d617f5766c06968af5e56aa6"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$cmd0 = "wget http://%s/update.sh" ascii
		$cmd1 = "busybox wget http://%s/update.sh" ascii
		$cmd2 = "curl http://%s/update.sh" ascii
		$cmd3 = "chmod 777 update.sh" ascii
		$cmd4 = "rm -rf update.sh" ascii
		$str0 = "ENEMEYBOT" ascii xor
		$str1 = "KEKSEC" ascii xor
		$str2 = "/tmp/.pwned" ascii xor
		$str3 = "echo -e \"\x65\x6e\x65\x6d\x79"

	condition:
		( uint32( 0 ) == 0x464c457f or uint32( 0 ) == 0xfeedfacf ) and ( 4 of ( $cmd* ) or 2 of ( $str* ) )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$cmd0text"wget http://%s/update.sh"ascii
$cmd1text"busybox wget http://%s/update.sh"ascii
$cmd2text"curl http://%s/update.sh"ascii
$cmd3text"chmod 777 update.sh"ascii
$cmd4text"rm -rf update.sh"ascii
$str0text"ENEMEYBOT"ascii xor
$str1text"KEKSEC"ascii xor
$str2text"/tmp/.pwned"ascii xor
$str3text"echo -e \"\x65\x6e\x65\x6d\x79"

Condition

( uint32( 0 ) == 0x464c457f or uint32( 0 ) == 0xfeedfacf ) and ( 4 of ( $cmd* ) or 2 of ( $str* ) )

In plain words (Heuristic)

  • The file must start with the ELF header — a Linux/Unix executable.
  • The file must start with a Mach-O / fat binary magic — a macOS executable.
  • At least 4 patterns in ( $cmd* ) must match.
  • At least 2 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: 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: 5778c653-39ce-4f5d-b10b-1503b74e5041

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE