Backdoor.Linux.Bew.a and Client BitCoin

Here is a little post about an infection found on servers that I have been administering recently.
It all starts with an alert by email from Munin freshly set up. Munin is an rddtools grapher who sends alerts when thresholds are exceeded, in this case it was the CPU.
Which is super convenient.

Les graphs :

hack_serveurs2 suddenly, a little tour on the server and I launch top and there the drama, I see a bfgminer process, which looks like a Bitcoin client from the name.

hack_serveurs3 I take a look at the processes and there I see a .bbb – which is not good.
Files starting with. under Linux are hidden.
The latter is executed as root.

hack_serveurs4

So I launch the command

find / -regextype egrep -regex ".*/.[a-z0-9_.-]+$" -exec file {} ;|grep executable

in order to list the hidden files likely to be executables.
Bingo is crowded:

/usr/local/psa/tmp/…/.tar: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped
/usr/local/psa/tmp/…/.bbb: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped
/usr/local/psa/tmp/…/.ew3: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, corrupted section header size
/usr/local/psa/tmp/…/.true: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped

A small recovery of files and scan on VirusTotal, we find a certain Backdoor.Linux.Bew.a whose detections are quite moldy:
https://www.virustotal.com/fr/file/b208643dbec66168ee66d8b7d8210a2156a2444e3bc9885be9ae07633a50cbf5/analysis/1395411155/
https://www.virustotal.com/fr/file/f4308d69578ffbe48216e99adfa1ac8c7fe357ac86a602c655e3241f29687323/analysis/1395411156/
https://www.virustotal.com/fr/file/7498e90c019f783c9e05abd33de746e78fb449f36d6a741d3c52502c0a45f815/analysis/1395411139/
https://www.virustotal.com/fr/file/7498e90c019f783c9e05abd33de746e78fb449f36d6a741d3c52502c0a45f815/analysis/1395411139/

Some files date from June 2013.

There is also a crond launched by Apache.

hack_serveurs5

The bitcoin process is in defunct, we can’t kill it directly.
You must kill the parent process (here httpd).

hack_serveurs4 hack_serveurs8

Note that ps does not show everything, at least it shows the process names with the desired names, suddenly it is possible to use already existing process names.
pstree lets see this:

hacklinux_pstree

A small egrep -r « base64 | eval | deflate | REQUEST » * php and there are some PHP Backdoor on the sites:hack_serveurs6 hack_serveurs7

It appears that the malware has been dropped on a Parallels Plesk Panel vulnerability
Note that the servers (fifteen) had no firewall, it does not help either.

When you know it is relatively conspicuous, especially by linking the processes the command find helps a lot.
We see here the importance of a minimum of monitoring tools that can warn of the presence of a Bitcoin client when the latter is a bit too much.

EDIT –

A small edit with a variant, cpio: open errors when using yum.

hack_linux_permissions This is because we cannot write in certain folders, in particular / usr / bin and / sbin
Hackers added s (secure deletion) i (immutable) a (append only) attributes in extended permissions.

The lsattr command is used to list the attributes and the chattr command to modify them, all the extended attributes must be removed at once: chattr -R -i -a -s
hack_linux_permissions2

 

Check Also

ShellExecuteEx error on Windows 10

On Windows 10, when running or installing an application, a erreur ShellExecuteEx is displayed. An …

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *