SECURITM помогает построить и управлять ИСПДн, КИИ, ГИС, СМИБ/СУИБ, банковскими системами защиты.
А еще SECURITM это место для обмена опытом в рамках сообщества служб безопасности.
Create or Modify System Process: Служба systemd
Other sub-techniques of Create or Modify System Process (4)
ID | Название |
---|---|
.001 | Агент запуска |
.002 | Служба systemd |
.003 | Служба Windows |
.004 | Демон запуска |
Adversaries may create or modify systemd services to repeatedly execute malicious payloads as part of persistence. The systemd service manager is commonly used for managing background daemon processes (also known as services) and other system resources.(Citation: Linux man-pages: systemd January 2014)(Citation: Freedesktop.org Linux systemd 29SEP2018) Systemd is the default initialization (init) system on many Linux distributions starting with Debian 8, Ubuntu 15.04, CentOS 7, RHEL 7, Fedora 15, and replaces legacy init systems including SysVinit and Upstart while remaining backwards compatible with the aforementioned init systems.
Systemd utilizes configuration files known as service units to control how services boot and under what conditions. By default, these unit files are stored in the /etc/systemd/system
and /usr/lib/systemd/system
directories and have the file extension .service
. Each service unit file may contain numerous directives that can execute system commands:
* ExecStart, ExecStartPre, and ExecStartPost directives cover execution of commands when a services is started manually by 'systemctl' or on system start if the service is set to automatically start.
* ExecReload directive covers when a service restarts.
* ExecStop and ExecStopPost directives cover when a service is stopped or manually by 'systemctl'.
Adversaries have used systemd functionality to establish persistent access to victim systems by creating and/or modifying service unit files that cause systemd to execute malicious commands at system boot.(Citation: Anomali Rocke March 2019)
While adversaries typically require root privileges to create/modify service unit files in the /etc/systemd/system
and /usr/lib/systemd/system
directories, low privilege users can create/modify service unit files in directories such as ~/.config/systemd/user/
to achieve user-level persistence.(Citation: Rapid7 Service Persistence 22JUNE2016)
Примеры процедур |
|
Название | Описание |
---|---|
TeamTNT |
TeamTNT has established persistence through the creation of a cryptocurrency mining system service using |
Pupy |
Pupy can be used to establish persistence using a systemd service.(Citation: GitHub Pupy) |
Fysbis |
Fysbis has established persistence using a systemd service.(Citation: Fysbis Dr Web Analysis) |
Exaramel for Linux |
Exaramel for Linux has a hardcoded location under systemd that it uses to achieve persistence if it is running as root.(Citation: ESET TeleBots Oct 2018)(Citation: ANSSI Sandworm January 2021) |
Rocke |
Rocke has installed a systemd service script to maintain persistence.(Citation: Anomali Rocke March 2019) |
Hildegard |
Hildegard has started a monero service.(Citation: Unit 42 Hildegard Malware) |
Контрмеры |
|
Контрмера | Описание |
---|---|
User Account Management |
Manage the creation, modification, use, and permissions associated to user accounts. |
Restrict File and Directory Permissions |
Restrict access by setting directory and file permissions that are not specific to users or privileged accounts. |
Privileged Account Management |
Manage the creation, modification, use, and permissions associated to privileged accounts, including SYSTEM and root. |
Limit Software Installation |
Block users or groups from installing unapproved software. |
Обнаружение
Systemd service unit files may be detected by auditing file creation and modification events within the /etc/systemd/system
, /usr/lib/systemd/system/
, and /home/
directories, as well as associated symbolic links. Suspicious processes or scripts spawned in this manner will have a parent process of ‘systemd’, a parent process ID of 1, and will usually execute as the ‘root’ user.
Suspicious systemd services can also be identified by comparing results against a trusted system baseline. Malicious systemd services may be detected by using the systemctl utility to examine system wide services: systemctl list-units -–type=service –all
. Analyze the contents of .service
files present on the file system and ensure that they refer to legitimate, expected executables.
Auditing the execution and command-line arguments of the 'systemctl' utility, as well related utilities such as /usr/sbin/service
may reveal malicious systemd service execution.
Ссылки
- Rapid7. (2016, June 22). Service Persistence. Retrieved April 23, 2019.
- Anomali Labs. (2019, March 15). Rocke Evolves Its Arsenal With a New Malware Family Written in Golang. Retrieved April 24, 2019.
- Freedesktop.org. (2018, September 29). systemd System and Service Manager. Retrieved April 23, 2019.
- Linux man-pages. (2014, January). systemd(1) - Linux manual page. Retrieved April 23, 2019.
- ANSSI. (2021, January 27). SANDWORM INTRUSION SET CAMPAIGN TARGETING CENTREON SYSTEMS. Retrieved March 30, 2021.
- Cherepanov, A., Lipovsky, R. (2018, October 11). New TeleBots backdoor: First evidence linking Industroyer to NotPetya. Retrieved November 27, 2018.
- Chen, J. et al. (2021, February 3). Hildegard: New TeamTNT Cryptojacking Malware Targeting Kubernetes. Retrieved April 5, 2021.
- Doctor Web. (2014, November 21). Linux.BackDoor.Fysbis.1. Retrieved December 7, 2017.
- Nicolas Verdier. (n.d.). Retrieved January 29, 2018.
- Fiser, D. Oliveira, A. (n.d.). Tracking the Activities of TeamTNT A Closer Look at a Cloud-Focused Malicious Actor Group. Retrieved September 22, 2021.
- Darin Smith. (2022, April 21). TeamTNT targeting AWS, Alibaba. Retrieved August 4, 2022.
Связанные риски
Риск | Угроза | Уязвимость | Тип актива | Связи | |
---|---|---|---|---|---|
Закрепление злоумышленника в ОС
из-за
создания или изменение системного процесса: служба Systemd
в ОС Linux
Повышение привилегий
НСД
|
Закрепление злоумышленника в ОС
Повышение привилегий
НСД
|
Создание или изменение системного процесса: служба Systemd | 1 | ||
Повышение привилегий в ОС
из-за
создания или изменение системного процесса: служба Systemd
в ОС Linux
Повышение привилегий
Целостность
|
Повышение привилегий в ОС
Повышение привилегий
Целостность
|
Создание или изменение системного процесса: служба Systemd | 1 |