Skip to content

Commit ab1fb88

Browse files
committed
集成了乌云漏洞查询
1 parent 8d54d77 commit ab1fb88

4 files changed

Lines changed: 102 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
> web框架是flask 前端框架是amazeUI
55
66
## 安装
7-
pip install flask
8-
pip install requests
7+
`pip install flask`
8+
`pip install requests`
9+
`pip install MySQLdb `
10+
911
[usage]: python `myweb.py `
1012

13+
乌云数据库文件安装 链接: http://pan.baidu.com/s/1hrKYy8W 密码: yrrr
14+
1115
## 更新
1216

1317
- 11.7 更新 加入了在线社工库 调用的接口~
1418
- 10.25 更新 加入了社会工程学密码生成和whois查询
1519
- 10.21 更新 加入了CMS在线识别
20+
- 11.22 更新 集成了乌云漏洞查询 [搭建教程][3]
1621

1722
## 学习教程
1823
每一步都记录了 [编写记录][1]
@@ -23,3 +28,4 @@ pip install requests
2328

2429
[1]: http://bbs.ichunqiu.com/forum.php?mod=collection&action=view&ctid=65
2530
[2]: http://systeminfo.applinzi.com/
31+
[3]: http://bbs.ichunqiu.com/forum.php?mod=viewthread&tid=15744&page=1&extra=#pid261144

myweb.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010
import whois
1111
import skg
1212

13+
import MySQLdb
14+
import sys
1315
reload(sys)
1416
sys.setdefaultencoding('utf-8')
1517

16-
app = Flask(__name__)
1718

1819

20+
app = Flask(__name__)
21+
#连接数据库操作
22+
db = MySQLdb.connect("127.0.0.1","root","","pyhack",charset='utf8' )
23+
cursor = db.cursor()
24+
1925
@app.route('/',methods=["get","post"])
2026
def index():
2127
return render_template('ip.html')
@@ -94,5 +100,33 @@ def findpass():
94100
else:
95101
return render_template('skg.html',title="社工库查询")
96102

103+
#集成wooyun漏洞平台
104+
@app.route('/wooyun',methods=["get","post"])
105+
def wooyun():
106+
searchword = request.args.get('key', '').strip()
107+
log_id = request.args.get('id', '').strip()
108+
data = {}
109+
table = list()
110+
if log_id:
111+
# 使用execute方法执行SQL语句
112+
cursor.execute(MySQLdb.escape_string("SELECT * from emlog_blog where gid=%s"%log_id))
113+
# 使用 fetchone() 方法获取一条数据库。
114+
results = cursor.fetchone()
115+
data["id"] = results[0]
116+
data["text"] = results[2]
117+
data["title"] = results[1]
118+
if searchword:
119+
sql = 'SELECT gid,title from emlog_blog where title like "%%%s%%"'%searchword
120+
cursor.execute(sql)
121+
#cursor.execute('SELECT * from emlog_blog limit 10')
122+
results = cursor.fetchall()
123+
124+
for rows in results:
125+
tdata = {}
126+
tdata["id"] = rows[0]
127+
tdata["title"] = rows[1]
128+
table.append(tdata)
129+
return render_template("wooyun.html",title="乌云漏洞查询",data=data,table=table)
130+
97131
if __name__ == '__main__':
98132
app.run(debug=True)

templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ <h1 class="am-topbar-brand">
168168
<li><a href="/password"><span class="am-icon-cube"></span> 密码生成</a></li>
169169
<li><a href="/whois"><span class="am-icon-cube"></span> whois查询</a></li>
170170
<li><a href="/pass"><span class="am-icon-cube"></span> 社工库</a></li>
171+
<li><a href="/wooyun"><span class="am-icon-cube"></span> 漏洞查询</a></li>
171172
<li><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
172173

173174
</ul>

templates/wooyun.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{% extends "base.html" %}
2+
{% block content %}
3+
<div class="get">
4+
<div class="am-g">
5+
<div class="am-u-lg-12">
6+
<h1 class="get-title">WooYun漏洞查询</h1>
7+
</div>
8+
<div class="am-form-group">
9+
<form action="" method="GET">
10+
<div class="am-u-sm-5 am-u-sm-offset-3">
11+
<input id='search1' type="text" name="key" minchecked="3" class="am-form-field am-round" placeholder="请输入KeyWords"/>
12+
</div>
13+
<div class="am-u-sm-1">
14+
<button id='search' type="submit" class="am-btn am-btn-primary">查询</button>
15+
</div>
16+
17+
<div class="box">
18+
</div></form>
19+
</div>
20+
</div>
21+
</div>
22+
23+
<div class="about">
24+
<div class="am-g am-container">
25+
<div class="am-g doc-am-g">
26+
<div class="am-form-group">
27+
{% if table %}
28+
<table class="am-table am-table-bordered am-table-radius">
29+
<thead>
30+
<tr>
31+
<th>id</th>
32+
<th>标题</th>
33+
<th>查看</th>
34+
</tr>
35+
</thead>
36+
<tbody>
37+
{% for foo in table %}
38+
<tr>
39+
<td>{{foo.id}}</td>
40+
<td>{{foo.title}}</td>
41+
<td><a href="?id={{ foo.id }}">查看</a></td>
42+
</tr>
43+
{% endfor %}
44+
</tbody>
45+
</table>
46+
{% endif %}
47+
{% if data %}
48+
<h1>{{data.title}}</h1>
49+
{{data.text|safe}}
50+
{% endif %}
51+
<div class="box">
52+
</div>
53+
</div>
54+
</div>
55+
</div>
56+
57+
</div>
58+
{% endblock %}

0 commit comments

Comments
 (0)