Skip to content

Commit 53e150d

Browse files
committed
v1.0
1 parent 3092d16 commit 53e150d

7 files changed

Lines changed: 64 additions & 1048321 deletions

File tree

GNB_asp.pickle

Lines changed: 0 additions & 152 deletions
This file was deleted.

GNB_jsp.pickle

Lines changed: 0 additions & 152 deletions
This file was deleted.

GNB_php.pickle

Lines changed: 0 additions & 152 deletions
This file was deleted.

README.md

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,71 @@
1-
# WebShell AIHunter : 机器学习算法检测Webshell
1+
# WebShell AIHunter - 机器学习算法检测Webhell
22

3-
![](https://raw.githubusercontent.com/Coldwave96/WebShell-AIHunter/master/logo.png)
3+
<div style="align: center">
4+
<img src="https://raw.githubusercontent.com/Coldwave96/WebShell-AIHunter/master/logo.png"/>
5+
</div>
46

7+
<p align="center">
8+
<a><img src="https://img.shields.io/badge/Python-2-blue"></a>
9+
<a><img src="https://img.shields.io/github/v/release/coldwave96/WebShell-AIHunter"></a>
10+
<a><img src="https://img.shields.io/github/issues/coldwave96/WebShell-AIHunter"></a>
11+
<a><img src="https://img.shields.io/badge/Platform-Linux%20%7C%20Windows-orange"></a>
12+
</p>
513

6-
![](https://img.shields.io/github/issues/coldwave96/WebShell-AIHunter)
14+
<p align="center">
15+
<a href="https://coldwave96.github.io/">Welcome to my personal blog(^◇^)</a>
16+
</p>
717

8-
### 基于文本的WebShell检测系统
18+
<hr>
919

10-
系统采用机器学习算法(朴素贝叶斯算法),利用词袋加IF-TDF模型对数据进行预处理及特征提取,实现了基于文本的WebShell检测系统,目前支持检测php,asp和jsp三种类型的WebShell文件。
20+
## 工具介绍
1121

12-
### 调用方法
22+
- [] 机器学习NB算法(朴素贝叶斯算法)
1323

14-
首先是模型的训练,分别运行train_php,train_asp,train_jsp文件,将自动生成vocabulary_php.pickle,vocabulary_asp.pickle,vocabulary_jsp.pickle这3个字典文件以及GNB_php.pickle,GNB_asp.pickle,GNB_jsp.pickle这3个模型文件。
15-
检测只需运行check.py文件即可。
16-
17-
### 数据格式
18-
19-
数据存放文件夹形式默认结构如下:
20-
>Data
21-
>check
22-
>normal
23-
>asp
24-
>jsp
25-
>php
26-
>WebShell
27-
>asp
28-
>jsp
29-
>php
30-
PS.WebShell文件夹存放3种格式的WebShell文件,normal文件夹存放3种格式的正常文件,check文件夹下存放待检测的文件。
31-
所有文件下可以有子文件,但是不支持压缩文件包。
24+
- [] 词袋加IF-TDF模型对数据进行预处理及特征提取
25+
26+
- [] 基于文本的WebShell检测
27+
28+
- [] 支持检测php,asp和jsp三种类型的Webshell
29+
30+
## 数据格式
31+
32+
⚠️⚠️ Data文件夹形式默认结构如下:
33+
34+
* Data
35+
* check
36+
* normal
37+
* asp
38+
* jsp
39+
* php
40+
* WebShell
41+
* asp
42+
* jsp
43+
* php
44+
45+
> 💎 Tips:
46+
>
47+
> 1.训练时需自行填充Data文件夹下对应目录的文件
48+
>
49+
> 2.WebShell文件夹存放3种格式的WebShell文件,normal文件夹存放3种格式的正常文件,check文件夹下存放待检测的文件
50+
>
51+
> 3.待检测文件无需分类别存放
52+
>
53+
> 4.所有文件下可以有子文件,但是不支持压缩文件包。
54+
>
55+
> 5.训练和检测时只会打开对应格式的文件,错误格式文件会自动跳过
56+
>
57+
> 6.Release只会发布训练好的模型和检测脚本
58+
59+
## 使用方法
60+
61+
### 检测
62+
63+
* 只需要下载Release的版本,将待检测文件放入Data/check文件夹下,执行`python check.py`命令即可
64+
65+
### 训练
66+
67+
* 下载整个项目的源代码
68+
69+
* 按照[数据格式](#webshell-aihunter---webhell)部分分别填充黑白样本文件
70+
71+
* 依次执行`python train_php.py``python train_asp.py``python train_jsp.py`命令即可训练模型

0 commit comments

Comments
 (0)