安全检查项 | 推荐工具 |
---|---|
Nginx配置安全 | gixy |
Nginx目录权限检查 | 手工 |
Apache日志安全检测 | apache-scalp |
PHP配置文件安全检测 | pcc |
主机安全审计 | lynis |
rootkit木马检查 | chkrootkit;rootkit hunter |
系统用户排查 | 手工,注意高权限和无需密码账号 |
线上代码.git泄露检查 | GitHack |
线上代码DS_Store文件泄露检查 | ds_store_exp |
1.Nginx配置安全
官方声明需要python2.7或3.5+
1 2 |
pip install gixy gixy ./nginx.conf |
删除gixy:
1 |
pip uninstall gixy |
项目地址:https://github.com/yandex/gixy
2.Nginx目录权限检查
可以参考:http://www.cnblogs.com/freeweb/p/4946101.html
3.Apache日志安全检测
1 2 3 |
wget https://github.com/neuroo/apache-scalp/blob/master/scalp.py wget https://raw.githubusercontent.com/PHPIDS/PHPIDS/master/lib/IDS/default_filter.xml ./scalp.py -l /var/log/httpd_log -f ./default_filter.xml -o ./scalp-output --html |
该工具较老,长期无人维护,但其报告也有一定的参考价值
项目地址:https://github.com/neuroo/apache-scalp
####4.PHP配置文件安全检测
1 2 |
git clone https://github.com/sektioneins/pcc.git php phpconfigcheck.php |
项目地址:https://github.com/sektioneins/pcc
5.主机安全审计
1 2 3 4 |
git clone https://github.com/CISOfy/lynis ./lynis audit system 或者 ./lynis --check-all –Q |
lynis检测过于严苛,不过还是有一定的参考价值
项目地址:https://github.com/CISOfy/lynis
6.rootkit木马检查
chkrootkit:http://www.chkrootkit.org/
长期维护项目,建议学习使用,若将来脱离阿里云平台可以作为定期任务检测
7.系统用户排查
注意高权限和无需密码账号
8.线上代码.git泄露检查
依赖Git,使用前需确保git在环境变量中存在
1 2 |
git clone https://github.com/BugScanTeam/GitHack.git python GitHack.py http://www.example.com/.git/ |
项目地址:https://github.com/BugScanTeam/GitHack
9.线上代码DS_Store文件泄露检查
1 2 |
git clone https://github.com/lijiejie/ds_store_exp.git python ds_store_exp.py http://www.example.com/.DS_Store |
项目地址:https://github.com/lijiejie/ds_store_exp
10.检测php webshell
1 2 |
git clone https://github.com/Neohapsis/NeoPI.git python neopi.py -a -A /var/www/html/ |
NeoPI会通过信息熵等分析混淆过的webshell文件,针对通过编码混淆的上传式小马检测率较高
项目地址:https://github.com/Neohapsis/NeoPI
php-malware-finder的检测率高于NeoPI,且长期维护,但安装复杂,需要安装yara等,可以先在测试服务器上进行:
安装yara参考:http://yara.readthedocs.io/en/latest/gettingstarted.html
1 2 3 4 |
git clone https://github.com/nbs-system/php-malware-finder.git yara -r ./php.yar /var/www 或: ./phpmalwarefinder -v -l php /var/www |
项目地址:https://github.com/nbs-system/php-malware-finder
11.多余端口排查
可以先用nmap扫描:
1 |
nmap -v XXXXX |
后在对应线上端口/服务进行排查
12.弱口令排查(应用和服务)
略
- Post author: E_Bwill