Update README.md
This commit is contained in:
56
README.md
56
README.md
@@ -9,17 +9,18 @@
|
||||
--------
|
||||
+ 灵感来源于hanc00l的github项目[wooyun_public](https://github.com/hanc00l/wooyun_public)
|
||||
|
||||
+ wooyun_public基于flask或者tornado,而本项目可以布置在apache、nginx等web服务器上
|
||||
+ wooyun_public基于flask或者tornado,而本项目可以布置在apache、nginx等web服务器上。
|
||||
|
||||
+ 如果你有wooyun的静态网页数据,那么我们可以开始了!
|
||||
|
||||
+ 整个项目包括两个部分,第一部分是索引,将网页信息存储进数据库;第二部分是搜索,从数据库中查找信息。轻量级,支持进行二次开发
|
||||
+ 整个项目包括两个部分,第一部分是索引,将网页信息存储进数据库;第二部分是搜索,从数据库中查找信息。轻量级,支持进行二次开发。
|
||||
|
||||
+ 静态网页网盘链接:
|
||||
```
|
||||
bugs 链接: http://pan.baidu.com/s/1bpC8wkn 密码: q88g(9.25更新)
|
||||
drops 链接:http://pan.baidu.com/s/1i5Q8L3f 密码:6apj
|
||||
```
|
||||
|
||||
0x01.依赖组件及说明
|
||||
--------
|
||||
+ python 2.7和pip
|
||||
@@ -28,7 +29,7 @@ drops 链接:http://pan.baidu.com/s/1i5Q8L3f 密码:6apj
|
||||
|
||||
+ mysql,php及任意web服务器(php需开启pdo-mysql模块
|
||||
|
||||
+ 将本项目放进web服务器目录下,bugs目录下为漏洞库文件,drops目录下为知识库文件
|
||||
+ 将本项目放进web服务器目录下,bugs目录下为漏洞库文件,drops目录下为知识库文件。
|
||||
```
|
||||
文件说明:
|
||||
app_bugs.py bugs的索引,依赖lxml
|
||||
@@ -46,26 +47,47 @@ drops 链接:http://pan.baidu.com/s/1i5Q8L3f 密码:6apj
|
||||
|
||||
+ 因为python脚本中open()函数打开的文件名不能为中文,建议将drops目录下的中文文件名改为英文(例如,安全运维-xxxx.html=>safe-xxxx.html)
|
||||
|
||||
+ python脚本运行前需要修改如下语句,更改参数如主机、端口号、用户名、密码
|
||||
+ python脚本运行前需要修改如下语句,更改参数如主机、端口号、用户名、密码。
|
||||
```bash
|
||||
conn=MySQLdb.connect(host='localhost',port=3306,user='root',passwd='',db='wooyun',charset='utf8')
|
||||
```
|
||||
+ 注意mysql编码需要为utf-8
|
||||
|
||||
+ 在mysql中建立数据库wooyun,数据表bugs、drops,分别建立字段title,dates,author,type,corp,doc与title,dates,author,type,doc。
|
||||
```bash
|
||||
show variables like 'character%'; #查看编码
|
||||
```
|
||||
+ 在mysql中建立数据库wooyun,数据表bugs、drops,分别建立字段title,dates,author,type,corp,doc与title,dates,author,typedoc
|
||||
```bash
|
||||
create database wooyun;
|
||||
CREATE DATABASE `wooyun` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||||
create table bugs(title VARCHAR(500),dates DATETIME, author CHAR(255),type CHAR(255),corp CHAR(255),doc VARCHAR(200) PRIMARY KEY);
|
||||
create table drops(title VARCHAR(500),dates DATETIME, author CHAR(255),type CHAR(255),doc VARCHAR(200) PRIMARY KEY);
|
||||
```
|
||||
+ 注意mysql编码如下,需要为utf-8(character_set_server不为utf-8要修改mysql配置文件
|
||||
```bash
|
||||
use wooyun;
|
||||
show variables like 'character%'; #查看编码
|
||||
+--------------------------+----------------------------+
|
||||
| Variable_name | Value |
|
||||
+--------------------------+----------------------------+
|
||||
| character_set_client | utf8 |
|
||||
| character_set_connection | utf8 |
|
||||
| character_set_database | utf8 |
|
||||
| character_set_filesystem | binary |
|
||||
| character_set_results | utf8 |
|
||||
| character_set_server | utf8 |
|
||||
| character_set_system | utf8 |
|
||||
| character_sets_dir | /usr/share/mysql/charsets/ |
|
||||
+--------------------------+----------------------------+
|
||||
```
|
||||
如果编码错误会报错,比如:
|
||||
```
|
||||
Warning: Incorrect string value: '\xE5\xBB\xB6\xE9\x95\xBF...' for column 'title' at row 1
|
||||
cur.execute("INSERT INTO `drops`(`title`,`dates`,`author`,`type`,`doc`) VALUES(%s,%s,%s,%s,%s)", tmp)
|
||||
```
|
||||
在mysql里查看会发现有一堆???
|
||||
|
||||
+ 之后就可以建立索引了
|
||||
```bash
|
||||
sudo python ./app_bugs.py
|
||||
sudo python ./app_drops.py
|
||||
```
|
||||
+ bugs数目为40293,drops数目为1268
|
||||
+ bugs数目为40280,drops数目为1264
|
||||
```bash
|
||||
use wooyun;
|
||||
select count(*) from bugs;
|
||||
@@ -74,7 +96,7 @@ select count(*) from drops;
|
||||
|
||||
0x03.搜索配置
|
||||
--------
|
||||
+ 修改config.php中修改如下语句中参数,分别是主机、端口、用户名、密码与数据库
|
||||
+ 修改config.php中修改如下语句中参数,分别是主机、端口、用户名、密码与数据库。
|
||||
```php
|
||||
$config['host'] = '127.0.0.1';
|
||||
$config['port'] = '3306';
|
||||
@@ -86,12 +108,18 @@ $config['database'] = 'wooyun';
|
||||
+ index.html与search.php样式来自于前端静态资源托管库。f12进入开发者模式,如果样式文件访问不到可以使用本地或cdn的样式(bootstrap3.3.7、jquery3.1.0)。只需要更改两个网页里面的如下内容。
|
||||
|
||||
```
|
||||
<link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css">``
|
||||
<link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="//lib.baomitu.com/jquery/3.1.0/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
```
|
||||
|
||||
+ 为了防止因为web服务器配置不正确,导致访问http(s)://example.link/bugs/或者http(s)://example.link/drops/而进入index of页面泄露所有文件,在目录下放置内容为空的index.html即可·
|
||||
+ 为了防止因为web服务器配置不正确,导致访问http(s)://example.link/bugs/或者http(s)://example.link/drops/而进入index of页面泄露所有文件,在目录下放置内容为空的index.html即可。
|
||||
|
||||
+ linux下由于selinux可能会导致无法连接数据库,可以使用如下命令:
|
||||
```bash
|
||||
getenforce //查看selinux状态
|
||||
setenforce 0 //暂时关闭selinux
|
||||
```
|
||||
|
||||
0x04.问题
|
||||
--------
|
||||
|
||||
Reference in New Issue
Block a user