Я нахожусь в некоторой ситуации, мой сервер был взломан, и, похоже, он вовлечен в операцию майнинга биткойнов.
Мне нужно знать, с чего начать, я начинающий системный администратор и до этого не сталкивался с этим. Он уносит мою пропускную способность из воды, и мой хостинг-провайдер платит мне 50 центов за ГБ, и из-за этого он подскочил на 255 ГБ -> 301,8 ГБ за один день. Любая помощь приветствуется.
Я нашел много мусора в журналах, относящихся к Stratum, а также в сценариях на внешних IP-адресах, работающих на моем сервере. Затем я смотрю в директорию /tmp и вижу 7 файлов, которые
- удар
- cron.d
- mech.dir
- ш
- spamd_full.sock
- Обновить
Пример содержимого моего журнала ошибок apache:
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] --2013-11-28 16:27:40-- http://74.208.228.113/sh
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] Connecting to 74.208.228.113:80...
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] connected.
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] HTTP request sent, awaiting response...
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] 200 OK
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] Length:
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] 518288
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] (506K)
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] [text/plain]
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] Saving to: `sh'
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] 0K
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] ... .......... .......... 9% 148K 3s
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] 50K ........
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] .. .......... .......... .......... .....
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] ..... 19% 172K 3s
[Thu Nov 28 16:27:40 2013] [error] [client 173.201.45.104] 100K .......... .......... ......
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .... .......... .......... 29% 344K 2s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 150K .......
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ... .......... .......... .......... .......... 39% 514K 1s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 200K .........
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ..
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ..
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .. .......... .......... .......... 49% 347K 1s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 250K .......... .......... .......... ........
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] .. .......... 59% 347K 1s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 300K .......... .......... .......... .......... .......... 69% 224M 1s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 350K .
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ......... .......... .......... .......... .......... 79% 347K 0s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 400K .......... ...
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ....... .......... .......... .......... 88% 348K 0s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 450K .......... .......... .......... .......... .......... 98% 254M 0s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 500K ...
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] ... 100% 64.1K=1.5s
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104] 2013-11-28 16:27:41 (328 KB/s) - `sh' saved [518288/518288]
[Thu Nov 28 16:27:41 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:27:58 2013] [error] [client 173.201.45.104] kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] a: line 24: ./bash: No such file or directory
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] chattr
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] :
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] Operation not permitted
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] while setting flags on bash
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] \r
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] chattr
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] :
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] Operation not permitted
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104]
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] while setting flags on sh
[Thu Nov 28 16:28:26 2013] [error] [client 173.201.45.104] \r
[Thu Nov 28 16:28:28 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:28] 2 miner threads started, using 'scrypt' algorithm.
[Thu Nov 28 16:28:28 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:28] Starting Stratum on stratum+tcp://216.230.103.42:3333
[Thu Nov 28 16:28:28 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:28] Stratum connection failed: Failed connect to 216.230.103.42:3333; Connection refused
[Thu Nov 28 16:28:28 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:28] ...retry after 30 seconds
[Thu Nov 28 16:28:33 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:33] Binding thread 1 to cpu 1
[Thu Nov 28 16:28:58 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:58] Stratum connection failed: Failed connect to 216.230.103.42:3333; Connection refused
[Thu Nov 28 16:28:58 2013] [error] [client 173.201.45.104] [2013-11-28 16:28:58] ...retry after 30 seconds
[Thu Nov 28 16:29:21 2013] [error] [client 173.201.45.104] [2013-11-28 16:29:21] Binding thread 0 to cpu 0
[Thu Nov 28 16:29:28 2013] [error] [client 173.201.45.104] [2013-11-28 16:29:28] Stratum connection failed: Failed connect to 216.230.103.42:3333; Connection refused