# webshell-detect **Repository Path**: theseuscode/webshell-detect ## Basic Information - **Project Name**: webshell-detect - **Description**: No description available - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-04 - **Last Updated**: 2022-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ANN(MLP) Webshell 检测模型 通过多层感知机检测 PHP 、ASP、JSP等恶意脚本 运行环境:linux、python3 ## 安装说明 安装依赖: 推荐安装顺序:pymysql,flask,tensorflow,scikit-learn,tflearn,h5py,scipy,numpy, ``` sudo pip3 install pymysql sudo pip3 install flask==1.1.0 sudo pip3 install tensorflow==1.14.0 sudo pip3 install scikit-learn==0.20.2 sudo pip3 install tflearn sudo pip3 install h5py==2.9.0 sudo pip3 install scipy==1.2.0 sudo pip3 install numpy==1.15.4 ``` > 参考命令: > > - 更新setuptools:`$ pip3 install --upgrade setuptools` > - 升级pip3:`$ pip3 install --upgrade pip` > 需要确认各模块的版本,建议安装一个模块时首先使用`sudo pip3 uninstall`卸载原有模块 初始化数据集,黑白样本分别位于 `dataset/{black,white}` 目录下。这可以自己调整,也可以自行到github中下载样本。 初始化数据库(用于运行 Web UI,程序demo.py需要用到): ``` mysql -u -p < schema.sql ``` ## 使用说明 1. 训练新模型: ``` ./training.py ``` 想要再次训练新的模型,只需要更改训练样本,然后再次运行training.py即可 2. 测试模型: ``` ./testing.py ``` 3. 检测: 运行 Demo(默认绑定在 `0.0.0.0:5000`): ``` ./demo.py ``` ## 参考资料 1. [cnn-webshell-detect: demo for detecting webshell with cnn (gitee.com)](https://gitee.com/w1nd7/cnn-webshell-detect?_from=gitee_search) 2. [基于机器学习的 Webshell 发现技术探索 (gitbook.cn)](https://gitbook.cn/books/5954727545ce787060240588/index.html) 3. [sklearn计算准确率和召回率----accuracy_score、metrics.precision_score、metrics.recall_score - 灰信网(软件开发博客聚合) (freesion.com)](https://www.freesion.com/article/518244864/) 4. [Environment: TensorFlow - FloydHub Documentation](https://docs.floydhub.com/guides/tensorflow/#tensorflow-22) 5. [ValueError: shapes (a,b) and (c,d) not aligned: b (dim 1) != c ( - 哔哩哔哩 (bilibili.com)](https://www.bilibili.com/read/cv7097548/) 6. [sklearn 神经网络 MLPClassifier简单应用与参数说明 - 简书 (jianshu.com)](https://www.jianshu.com/p/71fde5d90136)