Linux 在具有 777 权限的目录中查找所有 .php 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11241289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Find all .php files inside directories with 777 permissions
提问by pleshy
I have recently had a linux server compromised from bots uploading .php scripts and posing as images. I'm currently in the process of fixing this.
我最近有一个 linux 服务器被机器人上传 .php 脚本并伪装成图像。我目前正在解决这个问题。
Because my server has a lot of websites I'm looking for a linux command to scan through all the 777 directories on the server and show ones with .php files inside them.
因为我的服务器有很多网站,所以我正在寻找一个 linux 命令来扫描服务器上的所有 777 个目录并显示其中包含 .php 文件的目录。
You can use the following command to return all 777 directories but this is not
您可以使用以下命令返回所有 777 个目录,但这不是
find httpdocs/ -type d -perm 777
find httpdocs/ -type d -perm 777
Any ideas?
有任何想法吗?
采纳答案by Aleks G
Try something like this:
尝试这样的事情:
find httpdocs/ -type d -perm 777 -exec find {} -name "*.php" \;
This will show you all .php files in directories with 777 permissions. May not be ideal, but will get you started.
这将显示具有 777 权限的目录中的所有 .php 文件。可能不理想,但会让你开始。