基于神经网络的 PHP webshell检测器

requirements

php环境,安装vld拓展 python库:tensorflow(1或2)、numpy、sklearn等

文件结构

bin: 储存二进制文件,如内存中加载好的数据 data: 数据集 etc: 杂项、临时文件等 log: 训练记录 model: 模型存放 result: 准确率等结果存放 utils.py: 参数、函数库 data_proc.py: 数据预处理,将所有PHP文件转化为操作码字符串,并写入黑白两个txt中 word2vec.py: 向量化预处理并把结果pickle打包 show_lens.py:查看所有payload的长度分布统计图 lstm_tf1.py:tf1 lstm模型代码 lstm_tf2.py:tf2 lstm模型代码 detect_lstm_tf1.py:tensorflow1检测API,使训练好的LSTM模型支持单个webshell检测 detect_lstm_tf2.py:tensorflow2检测API,使训练好的LSTM模型支持单个webshell检测 attention_tf2.py:tf2 attention模型代码 detect_attention_tf2.py:tensorflow2检测API,使训练好的attention模型支持单个webshell检测 test.py:草稿文件

执行顺序

在utils.py中调整各项参数,在其他文件中适当调整各项参数 data_proc.py word2vec.py lstm_tf2.py

参考资料

https://paper.seebug.org/526/ https://xz.aliyun.com/t/2016

数据集来源

bad

https://github.com/JohnTroony/php-webshells https://github.com/ysrc/webshell-sample https://github.com/tennc/webshell https://github.com/xl7dev/WebShell

good

https://github.com/WordPress/WordPress https://github.com/typecho/typecho https://github.com/phpmyadmin/phpmyadmin https://github.com/laravel/laravel http://www.phpcms.cn/ https://github.com/symfony/symfony https://github.com/yiisoft/yii2-redis https://github.com/bcit-ci/CodeIgniter/ https://github.com/smarty-php/smarty http://www.thinkphp.cn https://github.com/top-think/framework

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。