-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchexploits.py
99 lines (97 loc) · 3.88 KB
/
searchexploits.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import requests
import json
def searchsploit(query):
results={}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Referer': 'https://www.exploit-db.com/',
'X-Requested-With': 'XMLHttpRequest',
'Connection': 'keep-alive',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'TE': 'trailers',
}
params = (
('draw', '1'),
('columns[0][data]', 'date_published'),
('columns[0][name]', 'date_published'),
('columns[0][searchable]', 'true'),
('columns[0][orderable]', 'true'),
('columns[0][search][value]', ''),
('columns[0][search][regex]', 'false'),
('columns[1][data]', 'download'),
('columns[1][name]', 'download'),
('columns[1][searchable]', 'false'),
('columns[1][orderable]', 'false'),
('columns[1][search][value]', ''),
('columns[1][search][regex]', 'false'),
('columns[2][data]', 'application_md5'),
('columns[2][name]', 'application_md5'),
('columns[2][searchable]', 'true'),
('columns[2][orderable]', 'false'),
('columns[2][search][value]', ''),
('columns[2][search][regex]', 'false'),
('columns[3][data]', 'verified'),
('columns[3][name]', 'verified'),
('columns[3][searchable]', 'true'),
('columns[3][orderable]', 'false'),
('columns[3][search][value]', ''),
('columns[3][search][regex]', 'false'),
('columns[4][data]', 'description'),
('columns[4][name]', 'description'),
('columns[4][searchable]', 'true'),
('columns[4][orderable]', 'false'),
('columns[4][search][value]', ''),
('columns[4][search][regex]', 'false'),
('columns[5][data]', 'type_id'),
('columns[5][name]', 'type_id'),
('columns[5][searchable]', 'true'),
('columns[5][orderable]', 'false'),
('columns[5][search][value]', ''),
('columns[5][search][regex]', 'false'),
('columns[6][data]', 'platform_id'),
('columns[6][name]', 'platform_id'),
('columns[6][searchable]', 'true'),
('columns[6][orderable]', 'false'),
('columns[6][search][value]', ''),
('columns[6][search][regex]', 'false'),
('columns[7][data]', 'author_id'),
('columns[7][name]', 'author_id'),
('columns[7][searchable]', 'false'),
('columns[7][orderable]', 'false'),
('columns[7][search][value]', ''),
('columns[7][search][regex]', 'false'),
('columns[8][data]', 'code'),
('columns[8][name]', 'code.code'),
('columns[8][searchable]', 'true'),
('columns[8][orderable]', 'true'),
('columns[8][search][value]', ''),
('columns[8][search][regex]', 'false'),
('columns[9][data]', 'id'),
('columns[9][name]', 'id'),
('columns[9][searchable]', 'false'),
('columns[9][orderable]', 'true'),
('columns[9][search][value]', ''),
('columns[9][search][regex]', 'false'),
('order[0][column]', '9'),
('order[0][dir]', 'desc'),
('start', '0'),
('length', '15'),
('search[value]', query),
('search[regex]', 'false'),
('author', ''),
('port', ''),
('type', ''),
('tag', ''),
('platform', ''),
('_', '1641031395845'),
)
response = requests.get('https://www.exploit-db.com/', headers=headers, params=params)
data=json.loads(response.text)
for element in data["data"]:
index=data["data"].index(element)
results["https://www.exploit-db.com/exploits/"+data["data"][index]["id"]] = data["data"][index]["description"][1]
return(results)