forked from Cl0udG0d/SZhe_Scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportToRedis.py
44 lines (38 loc) · 1.21 KB
/
ImportToRedis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import redis
from config import redisPool
'''
默认6379端口,第0个数据库
'''
def ToRedis():
r = redis.Redis(connection_pool=redisPool)
# r.flushdb()
r.delete("SubScan")
r.delete("SenScan")
r.delete("XSSpayloads")
r.delete("bugtype")
r.delete("useragents")
file1 = open(r"dict/SUB_scan.txt", "r", encoding='utf-8')
for line1 in file1.readlines():
r.lpush("SubScan", line1.replace("\n", ''))
file1.close()
file2 = open(r"dict/SEN_scan.txt", "r", encoding='utf-8')
for line2 in file2.readlines():
r.lpush("SenScan", line2.replace("\n", ""))
file2.close()
file3=open('XSSBug/normal_payload.txt', 'r')
for line3 in file3.readlines():
r.lpush("XSSpayloads",line3.replace("\n",""))
file3.close()
file4=open('dict/bugtype.txt', 'r',encoding='utf-8')
for line4 in file4.readlines():
line4=line4.strip('\n')
name=line4.split(":")[0]
grade=line4.split(":")[1]
r.hset('bugtype',name,grade)
file4.close()
file5 = open('dict/useragents.txt', 'r', encoding='utf-8')
for line5 in file5.readlines():
line5=line5.strip('\n')
r.lpush('useragents',line5)
file5.close()
ToRedis()