Machine vérolée
Bonjour à tous,
Je reviens au sujet de ma machine vérolée. J'ai un peu avancé sur le
sujet. J'ai trouvé la porte d'entrée et corrigé.
Le processus hwm est un mineur de bitcoin. Celui-ci a été éradiqué et
ne revient plus m'embêter.
À intervalle régulier (ce matin à 08h50 par exemple), j'ai deux
processus qui déboulent :
30269 www-data 20 0 10816 7088 3336 S 0,0 0,0 0:00.65
/usr/local/apache/bin/httpd -DSSL
30275 www-data 20 0 10820 6660 2936 S 0,0 0,0 0:00.12
/usr/local/apache/bin/httpd -DSSL
Petit problème :
# ls -l /usr/local/apache/bin/httpd
ls: impossible d'accéder à '/usr/local/apache/bin/httpd': Aucun fichier
ou dossier de ce type
Un strace m'indique que le premier est un client, le second un serveur.
Aucune idée de ce qu'ils font réellement, ça ne passe pas le firewall :
connect(3, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("18.216.210.232")}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(48478),
sin_addr=inet_addr("192.168.15.18")}, [128 => 16]) = 0
write(3, "NICK xxx1851\n", 13) = 13
getsockname(3, {sa_family=AF_INET, sin_port=htons(48478),
sin_addr=inet_addr("192.168.15.18")}, [128 => 16]) = 0
write(3, "USER xxx2113 192.168.15.18 18.21"..., 51) = 51
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=2, tv_nsec=0},
0x7fff7e181650) = 0
pselect6(8, [3], NULL, NULL, {tv_sec=0, tv_nsec=600000000}, NULL) = 1
(in [3], left {tv_sec=0, tv_nsec=599995615})
read(3, "\r\n\r\nDisconnected\r\n", 4096) = 18
pselect6(8, [3], NULL, NULL, {tv_sec=0, tv_nsec=600000000}, NULL) = 1
(in [3], left {tv_sec=0, tv_nsec=599996008})
read(3, "", 4096) = 0
close(3) = 0
socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, TCGETS, 0x7fff7e181460) = -1 ENOTTY (Ioctl() inapproprié
pour un périphérique)
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Repérage non permis)
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, TCGETS, 0x7fff7e181460) = -1 ENOTTY (Ioctl() inapproprié
pour un périphérique)
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Repérage non permis)
connect(3, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("18.216.210.232")}, 16) = -1 ETIMEDOUT (Connexion
terminée par expiration du délai d'attente)
close(3) = 0
socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, TCGETS, 0x7fff7e181460) = -1 ENOTTY (Ioctl() inapproprié
pour un périphérique)
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Repérage non permis)
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, TCGETS, 0x7fff7e181460) = -1 ENOTTY (Ioctl() inapproprié
pour un périphérique)
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Repérage non permis)
Vu ce que je trouve dans le répertoire cwd de l'un des processus
(/tmp/.wwwodsfidsfe) :
# ls -alR
.:
total 8084
drwxrwxrwx 3 www-data www-data 4096 23 juin 08:50 .
drwxrwxrwt 10 root root 36864 23 juin 09:56 ..
drwxr-xr-x 2 www-data www-data 4096 23 juin 09:56 fs
-rw-rw-rw- 1 www-data www-data 8218683 23 juin 08:49 gg.tgz
./fs:
total 14928
drwxr-xr-x 2 www-data www-data 4096 23 juin 09:56 .
drwxrwxrwx 3 www-data www-data 4096 23 juin 08:50 ..
-rw-r--r-- 1 www-data www-data 24565 4 août 2022 1.html
-rw-r--r-- 1 www-data www-data 3014144 23 juin 08:50 abe
-rw-rw-rw- 1 www-data www-data 26 23 juin 09:56 bb
-rw-r--r-- 1 www-data www-data 34 3 août 2022 d
-rw-r--r-- 1 www-data www-data 26098 22 juin 09:10 da.html
-rw-rw-rw- 1 www-data www-data 33699 23 juin 09:55 di.html
-rw-r--r-- 1 www-data www-data 9235803 17 févr. 2022 git
-rw-rw-rw- 1 www-data www-data 29 23 juin 09:35 has
-rw-r--r-- 1 www-data www-data 43777 3 août 2022 me
-rw-r--r-- 1 www-data www-data 246233 14 juil. 2022 ok
-rw-r--r-- 1 www-data www-data 2598092 3 août 2022 ola
le truc en question doit être un genre de serveur de mails qui envoie du
pishing à la terre entière. Ces deux processus sont lancés par un script
sh qui reste dans l'état de zombie très longtemps. Le parent est init
(tant qu'à faire). Je n'arrive pas à trouver par quoi ce truc est lancé
périodiquement. Sans doute un processus avec les droits www-data.
Sur cette machine, les seules choses tournant avec les droits www-data
sont :
- un serveur apache2 (debian/testing)
- php 8.2 (et 7.4 pour un blog b2 evolution)
- trois sites SPIP (4.1.10 à jour, y compris les plugins)
Je n'ai rien trouvé dans le cron, rien dans les tâches planifiées des
sites en question, rien dans les logs. Je ne sais plus où chercher.
Si je tue ces deux processus, au bout d'un certain temps, ils reviennent.
Ma question est donc assez simple ;-) Comment trouver par quoi sont
lancés ces deux processus ?
Bien cordialement,
JB
Reply to: