-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploit_code.py
More file actions
35 lines (30 loc) · 1.07 KB
/
exploit_code.py
File metadata and controls
35 lines (30 loc) · 1.07 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
import requests
import urllib3
from bs4 import BeautifulSoup
from exploit_link import *
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def exploit_code(cve_id):
new_exdb_id = exploit_id(cve_id)
print(new_exdb_id)
for URL in new_exdb_id:
headers = {'User-Agent': 'Mozilla/5.0'}
page = requests.get(URL, headers=headers, verify=False)
soup = BeautifulSoup(page.content, "html.parser")
results = soup.find("code")
return results
# new_exdb_id = exploit_id(input('Input CVE ID:'))
# print(new_exdb_id)
# for URL in new_exdb_id:
# headers = {'User-Agent': 'Mozilla/5.0'}
# page = requests.get(URL, headers=headers, verify=False)
# soup = BeautifulSoup(page.content, "html.parser")
# results = soup.find("code")
# print(results)
'''
URL = "https://www.exploit-db.com/exploits/16686"
headers = {'User-Agent': 'Mozilla/5.0'}
page = requests.get(URL, headers=headers, verify=False)
soup = BeautifulSoup(page.content, "html.parser")
results = soup.find_all("code", class_="language-rb")
print(results)
'''