# chattr +i /etc/passwd
# chattr +i /etc/group
# chattr +i /etc/shadow
# chattr +i /etc/gshadow
# chattr +i /etc/ssh/sshd_config
使用DenyHost程序防止SSH被暴力攻击,具体方法见站外文章:http://www.myhack58.com/Article/48/66/2011/28833.htm
location ~ .*\.(php|php5)?$ {
rewrite ^/(uc\_client|templates|include|plugins|admin|attachments|images|
forumdata)/.*\.(php|php5)?$ /50x.php last;
}
apache规则相关脚本
php.ini需要修改的地方
查找:disable_functions找到后在=后面添加这里都是禁止在php里面执行的函数exec,system,passthru,error_log,ini_alter,dl,openlog,syslog,readlink,symlink,link,leak,fsockopen,proc_open,
popepassthru,chroot,scandir,chgrp,chown,escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,popen
服务器木马查杀篇(PHP)
find /home/www/ -type f -name "*.php" | xargs grep "eval(" |more
增强版(在网站目录执行):
find ./ -name "*.php" |xargs egrep "phpspy|c99sh|milw0rm|eval\(gunerpress|eval\(base64_decoolcode|spider_bc"> /tmp/php.txt
grep -r –include=*.php '[^a-z]eval($_POST' . >/tmp/eval.txt
grep -r –include=*.php 'file_put_contents(.*$_POST\[ .*\ ]);' . >/tmp/file_put_contents.txt
find ./ -name "*.php" -type f -print0 | xargs -0 egrep "(phpspy|c99sh|milw0rm|eval\(gzuncompress\(base64_decoolcode|eval\(base64_decoolcode|spider_bc|gzinflate)" | awk -F: '{print $1}' | sort | uniq
代码中的空格使用时注意下
#find -mtime -1 -type f -name \*.php
修改网站的权限
find -type f -name \*.php -exec chmod 444 {} \;
find ./ -type d -exec chmod 555{} \;