-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattack_deliver.py
More file actions
45 lines (42 loc) · 1.25 KB
/
attack_deliver.py
File metadata and controls
45 lines (42 loc) · 1.25 KB
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
45
# !/usr/bin/env python
# -*- coding:utf-8 -*-
"""
attack catagory and delete the same line
"""
import record_err
import write_todb
import linecache
import commands
import time
filereadlist = []
xsslist = []
def catagory(attack_data):
try:
file = open('/tmp/attackinfo.txt', 'a')
count = 0
if attack_data[u'attack_type'] == u'文件读取' and attack_data[u'status'] == 200:
global filereadlist
if attack_data not in filereadlist:
filereadlist.append(attack_data)
count += 1
# print attack_data
elif attack_data[u'attack_type'] == u'XSS攻击' and attack_data[u'status'] == 200:
global xsslist
if attack_data not in xsslist:
xsslist.append(attack_data)
count += 1
elif attack_data[u'attack_type'] == u'SQL注入' :
global xsslist
if attack_data not in xsslist:
xsslist.append(attack_data)
count += 1
else:
pass
if count > 0:
file.write(str(attack_data))
file.write('\n')
file.close()
except Exception as e:
record_err.logrecord()
if __name__ == '__main__':
print __name__