zoukankan      html  css  js  c++  java
  • centos7环境下php网站通过webshell安全扫描工具对系统做检测

    公司的网站半夜的时候不能访问,折腾了一些时间弄好了
    发现是.htaccess文件被改,还有index.html被清空

    很可能是入侵者对网站系统不熟悉误操作让站点出现异常,否则我们不会发现后门

    系统恢复以后进行了回溯,找到了一个后门webshell,可以上传文件

    既然有了一个后门可能会有其他后门,找几个工具扫描了一下(多个工具作对比,让结果更加立体)


    1.河马查杀(试用了几个最好用的一个,强烈推荐)
    下载地址:https://www.shellpub.com/
    帮助文档:https://www.shellpub.com/doc/hm_linux_usage.html

    wget -O /opt/hm-linux.tgz http://dl.shellpub.com/hm/latest/hm-linux-amd64.tgz
    tar xf hm-linux.tgz
    cd hm
    # 简单扫描
    ./hm scan 需要扫描的目录


    ./hm deepscan 你的web目录
    扫描时开启深度解码


    注意:
    不要将本软件放置到web目录下
    不要在web目录下运行软件,因为生成的结果文件会被下载可能被人恶意利用

    生成的报告默认保存在当前目录下 result.csv

    使用简单,报告明晰,而且扫描的结果也很准确


    2.CloudWalker牧云:开源项目已经停止更新,结果明晰,可惜停止更新了
    使用简单,直接下载添加可执行文件就可以扫描了

    ./webshell-detector -html -output result.html 需要扫描的目录


    python版本的findwebshell

    python main.py -e php -p /var/www/test -o output
    -e 网页格式
    -p 扫描的路径
    -o 生成的html文件名,默认生成report.html

    3.PHP Malware Finder查杀
    使用方法:
    # 安装yara依赖,这个工具要3.4以上版本
    yum install yara -y
    # 下载查杀源码
    git clone https://github.com/nbs-system/php-malware-finder.git
    cd php-malware-finder
    yara -r ./php.yar /var/www


    [/data/hm/php-malware-finder/php-malware-finder-master/php-malware-finder]# yara -r ./php.yar /home/edra0604/

    ObfuscatedPhp /data/www/phpetector/shelldetect.php
    DodgyPhp /data/www/phpetector/shelldetect.php
    DangerousPhp /data/www/phpetector/shelldetect.php
    DodgyStrings /data/www/phpetector/shelldetect.php
    NonPrintableChars /data/www/share.php

    4.findwebshell
    一款python的扫描工具
    https://github.com/he1m4n6a/findWebshell

    # 运行参数
    python main.py -e php -p /home/edra0604/public_html/ -o result02.html

    扫描的结果一般,只能检测出有限的问题

    5.Web Shell Detector直接拷贝到php目录就可以用
    不推荐,不知道在干啥,好几个小时一直没有输出结果

  • 相关阅读:
    Python读写ini文件
    MySQL 让主键id 从1开始自增
    python 找字符串中所有包含字符的下标
    centos7防火墙命令
    如何将npm升级到最新版本
    将 Npm 的源替换成淘宝的源
    MySQL 时间格式化/ MySQL DATE_FORMAT
    Python中crypto模块进行AES加密和解密
    windows环境下python3安装Crypto
    Nginx+PHPSTORM+Xdebug 配置
  • 原文地址:https://www.cnblogs.com/reblue520/p/13402780.html
Copyright © 2011-2022 走看看