-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rule tuning based on initial Melofee analysis (#622)
- Loading branch information
1 parent
624befe
commit a8070a0
Showing
54 changed files
with
464 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import "elf" | ||
|
||
rule elf_with_bundled_glibc: medium { | ||
meta: | ||
description = "includes bundled copy of glibc" | ||
|
||
strings: | ||
$glibc_private = "GLIBC_PRIVATE" | ||
$glibc_tunables = "GLIBC_TUNABLES" | ||
$setup_vdso = "setup_vdso" | ||
condition: | ||
filesize > 1024 and filesize < 25MB and elf.type == elf.ET_EXEC and uint32(0) == 1179403647 and all of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import "elf" | ||
|
||
private rule _bundled_openssl: medium { | ||
meta: | ||
description = "includes bundled copy of OpenSSL" | ||
|
||
strings: | ||
$ref = "OpenSSL/" | ||
$aes_part = "AES part of OpenSSL" | ||
$montgomery = "Montgomery Multiplication for x86_64, CRYPTOGAMS" | ||
$rc4 = "RC4 for x86_64, CRYPTOGAMS" | ||
condition: | ||
filesize > 1024 and filesize < 150MB and elf.type == elf.ET_EXEC and uint32(0) == 1179403647 and any of them | ||
} | ||
|
||
private rule _bundled_glibc: medium { | ||
meta: | ||
description = "includes bundled copy of glibc" | ||
|
||
strings: | ||
$glibc_private = "GLIBC_PRIVATE" | ||
$glibc_tunables = "GLIBC_TUNABLES" | ||
$setup_vdso = "setup_vdso" | ||
condition: | ||
filesize > 1024 and filesize < 25MB and elf.type == elf.ET_EXEC and uint32(0) == 1179403647 and all of them | ||
} | ||
|
||
rule elf_with_bundled_glibc_and_openssl: high { | ||
meta: | ||
description = "includes bundled copy of glibc and OpenSSL" | ||
|
||
condition: | ||
_bundled_openssl and _bundled_glibc | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
rule openssl: medium { | ||
meta: | ||
description = "This binary includes OpenSSL source code" | ||
hash_2023_Linux_Malware_Samples_00ae = "00ae07c9fe63b080181b8a6d59c6b3b6f9913938858829e5a42ab90fb72edf7a" | ||
hash_2023_Linux_Malware_Samples_04b5 = "04b5e29283c60fcc255f8d2f289238430a10624e457f12f1bc866454110830a2" | ||
hash_2023_Linux_Malware_Samples_0ad6 = "0ad6c635d583de499148b1ec46d8b39ae2785303e8b81996d3e9e47934644e73" | ||
|
||
strings: | ||
$ref = "OpenSSL/" | ||
import "elf" | ||
|
||
condition: | ||
any of them | ||
} | ||
|
||
rule elf_with_bundled_openssl: high { | ||
rule openssl: medium { | ||
meta: | ||
hash_2023_Unix_Malware_Bruteforce_4020 = "4020b018fcebf76672af2824636e7948131b313f723adef6cf41ad06bd2c6a6f" | ||
hash_2023_Linux_Malware_Samples_24ee = "24ee0e3d65b0593198fbe973a58ca54402b0879d71912f44f4b831003a5c7819" | ||
hash_2023_Linux_Malware_Samples_2f85 = "2f85ca8f89dfb014b03afb11e5d2198a8adbae1da0fd76c81c67a81a80bf1965" | ||
description = "includes bundled copy of OpenSSL" | ||
|
||
strings: | ||
$aes_part = "AES part of OpenSSL" | ||
$ref = "OpenSSL/" | ||
$aes_part = "AES part of OpenSSL" | ||
$montgomery = "Montgomery Multiplication for x86_64, CRYPTOGAMS" | ||
$rc4 = "RC4 for x86_64, CRYPTOGAMS" | ||
condition: | ||
uint32(0) == 1179403647 and $aes_part | ||
filesize > 1024 and filesize < 150MB and elf.type == elf.ET_EXEC and uint32(0) == 1179403647 and any of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
rule dev_full: low linux { | ||
rule dev_full: harmless linux { | ||
meta: | ||
description = "tests full disk behavior" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
rule melofee_2023: critical linux { | ||
meta: | ||
description = "Melofee rootkit (2023)" | ||
ref = "https://blog.exatrack.com/melofee/" | ||
|
||
strings: | ||
$loader = "/etc/intel_audio/audio | xargs kill" | ||
$failed = "create rootkit file failed" | ||
$insmod = "/sbin/insmod /etc/intel_audio/intel_audio.ko" | ||
$lock = "/var/lock/%s.lock" | ||
condition: | ||
filesize < 5MB and uint32(0) == 1179403647 and 2 of them | ||
} | ||
|
||
rule melofee_2024: critical linux { | ||
meta: | ||
description = "Melofee rootkit (2024)" | ||
ref = "https://blog.xlab.qianxin.com/analysis_of_new_melofee_variant_en/" | ||
|
||
strings: | ||
$sodl = "/var/run/nscd/sodl-close.c" | ||
$hide_ok = "hide ok" | ||
$show_ok = "show ok" | ||
condition: | ||
filesize < 7MB and uint32(0) == 1179403647 and all of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.