-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheln.py
More file actions
43 lines (38 loc) · 1.17 KB
/
eln.py
File metadata and controls
43 lines (38 loc) · 1.17 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
import BeautifulSoup
import xml.etree.ElementTree as ET
import urllib2
from termcolor import colored
import sys
def LookBIDexploit(urlBID,vuln):
try:
url = 'http://www.securityfocus.com/bid/'+urlBID+'/exploit'
request = urllib2.Request(url)
response = urllib2.urlopen(request)
http_response = response.read()
soup2 = BeautifulSoup.BeautifulSoup(http_response)
for link in soup2.findAll("a"):
if "/data/vulnerabilities/exploits/" in link.get("href"):
print colored(vuln, 'red', attrs=['bold'])
print soup2.span.string
print url + " - Exploit available"
print ""
break
except:
pass
def Extractor():
print colored("""
|-----------------------------------|
Nessus BID exploit finder
|-----------------------------------|
""", 'green', attrs=['bold'])
if len(sys.argv) < 2:
print colored("usage: python eln.py report.nessus")
else:
tree = ET.parse(sys.argv[1])
root = tree.findall('.//ReportItem')
for child in root:
vuln = child.attrib['pluginName'] + " - port: " + child.attrib['port']
for bid in child:
if "bid" in bid.tag:
LookBIDexploit(bid.text,vuln)
Extractor()