我们使用 CentOS。
我们被黑客入侵了,正在努力找出原因。查看 /tmp 文件夹时,我想知道这些是否存在安全威胁:
-rw-rw---- 1 mysql mysql 11665408 Apr 3 18:59 #sql_6bc_0.MYD
-rw-rw---- 1 mysql mysql 1024 Apr 3 18:59 #sql_6bc_0.MYI
drwxrwxrwt 5 root root 647168 Apr 3 18:59 ./
dr-xr-xr-x 25 root root 4096 Mar 31 19:34 ../
drwxrwxrwt 2 root root 4096 Mar 31 19:34 .ICE-unix/
-rw------- 1 cpanel cpanel 0 Dec 3 11:18 .ftpquota
-rw------- 1 root root 1 Mar 18 00:19 cache_03ccc987bb84ad942c7bdc1b37a1d5af
-rw------- 1 root root 1 Mar 18 00:19 cache_0f1ff313f7d5dc65958843d70148d9f6
-rw------- 1 root root 1 Mar 18 00:19 cache_3ebbab63ff1d3bffdaddb17747049f2d
-rw------- 1 root root 581 Mar 14 00:46 cache_5a3dafb5b1cf70a9b76b7e70107b3ba0
-rw------- 1 root root 1 Mar 18 00:19 cache_763860a21a94412ffb8081c5efb43196
-rw------- 1 root root 1 Mar 18 00:19 cache_85daced7c4de2f5a2c332a7d8a7a3803
-rw------- 1 root root 1 Mar 18 00:19 cache_8c1e2d0573ed1f99fd247768110f872f
-rw------- 1 root root 16093 Mar 18 00:19 cache_b9813b3134c6afdd77d72c595ebda25d
-rw------- 1 root root 440 Mar 18 00:19 horde_cache_gc
-rwxr-xr-x 1 root root 34087 May 16 2013 latest*
lrwxrwxrwx 1 root root 27 Dec 3 11:15 mysql.sock -> ../var/lib/mysql/mysql.sock=
drwxr-xr-x 3 root root 4096 Dec 3 11:31 pear/
-rw------- 1 user user 122856 Mar 31 00:13 php9YFHLD
-rw------- 1 user user 0 Apr 3 18:38 sess_00257f10fae6be00b90d5ba805ad30af
-rw------- 1 user user 0 Apr 3 18:58 sess_003d98e029b3d2c0fab09d926c0dd761
-rw------- 1 user user 0 Apr 3 18:59 sess_0047577f2d01487f4fa75724d0b3f7ee
-rw------- 1 user user 0 Apr 3 18:58 sess_0070e5da229b113786f64f39cae87daf
-rw------- 1 user user 0 Apr 3 18:59 sess_0077dea73523b2548e8eb100ff76359f
-rw------- 1 user user 0 Apr 3 18:46 sess_00882cd396bd3452665c9d973918afdb
-rw------- 1 user user 0 Apr 3 18:46 sess_00b82f19cf9a685d1aceeb7f70de6608
-rw------- 1 user user 0 Apr 3 18:50 sess_00d77c2027af0c19151a1b99021f3758
-rw------- 1 user user 0 Apr 3 18:51 sess_0108c3a1bd1f79e0aa0b27045e23ea08
-rw------- 1 user user 0 Apr 3 18:53 sess_011637bd373ae7cffb2725820d89fd5a
-rw------- 1 user user 0 Apr 3 18:43 sess_0131292a1d637c2317dcaafed09df456
想知道为什么这么多都是由 root 运行的?为什么有些过了这么多天还在那里?
我听说 tmp 文件存在漏洞。我应该如何监控 /tmp 文件?
答案1
这些是来自 MySQL 和 PHP 会话的缓存文件。无需担心。
如果您担心 /tmp,请noexec,nodev,nosuid
在 中添加 /tmp 的选项列/etc/fstab
。这将阻止在该卷上执行任何操作。
尝试查找过去 X 天内修改的文件:
find /etc -iname "*.conf" -mtime -1 -print