下面是我为 Web 应用程序创建的示例配置文件,其中我限制了它可以访问的文件/命令。它包括配置文件nginx, php-fpm and mysql,不允许使用命令,只有少数目录/文件用于读/写/flock 访问,以及网络套接字。
(其余的位于我的 github 存储库中)
/usr/bin/php-fpm {
#include <abstractions/base>
capability chown,
capability kill,
capability setgid,
capability setuid,
# Suppress the "DENY" error logs
deny /usr/bin/bash x,
/etc/php/** r,
/run/php-fpm/ r,
/run/php-fpm/php-fpm.* w,
/usr/bin/php-fpm mr,
/usr/lib/php/modules/* mr,
/var/html/{**,} r,
# logs
/var/log/ r,
/var/log/php*.log w,
# Web folders that need write access
/var/html/icy/{cache,logs,files,images,downloads}/{**,} rwk,
}
现在我相信在远程利用成功后,攻击者只能影响 web 应用程序文件夹,而不能进一步破坏系统,
所以我的问题是,攻击者还有机会突破吗?
如何?