Security-Experts-Community / open-xp-rules

Открытый репозиторий с правилами на языке eXtraction and Processing (XP)
Apache License 2.0
20 stars 44 forks source link

Add rule to detect execution of trojan Shlayer #393

Closed grikos closed 3 months ago

grikos commented 3 months ago

Add rule to detect execution of trojan Shlayer that distributed as fake Adobe Flash Player

Trojan Shlayer use bash script that decode another script from one of its files:

#!/bin/bash
cd "$(dirname "$BASH_SOURCE")"
fileDir="$(dirname "$(pwd -P)")"
eval "$(openssl enc -base64 -d -aes-256-cbc -nosalt -pass pass:2833846567 <"$fileDir"/Resources/enc)"

To detect the execution of this script, we can check the execution of the dirname utility and the subsequent execution of openssl with certain parameters. The actual password may differ in different versions of the Trojan, but other parameters always remain the same. Including subject.process.name and object.process.cwd in the list of keys are important becase we need to avoid possible false positives. In case of execution from such bash script (as shown above) subject.process.name and object.process.cwd must be equal.

Resolves #376

grikos commented 3 months ago

@Keks1993 Спасибо за фидбек. Я допускаю, что различных комбинаций подозрительного использования openssl действительно может быть достаточное количество. Тем не менее, считаю, что в данном случае гораздо полезнее иметь более точное правило, которое учитывает не только подозрительный вызов openssl, но и вызов dirname перед этим. Учет последовательности этих двух событий и определенный набор параметров при запуске openssl позволяет рассчитывать на большую точность правила и меньшее число возможных ложных срабатываний на обычный запуск утилиты openssl. Предлагаю оставить текущее правило как есть, а при необходимости разработать дополнительное правило, предназначенное для более выявления "подозрительного использования openssl" в широком смысле. Особенно с учетом того, что для полноценного исследования различных вариантов подозрительного использования openssl необходимо больше тестовых данных.