|
@@ -88,15 +88,21 @@ class Censys_WEB:
|
|
|
|
|
|
def parse_ipv4(self, data):
|
|
def parse_ipv4(self, data):
|
|
html = BeautifulSoup(data, "lxml")
|
|
html = BeautifulSoup(data, "lxml")
|
|
- vhosts = []
|
|
|
|
- protocols = []
|
|
|
|
results = html.find_all('div', {'class': 'SearchResult result'})
|
|
results = html.find_all('div', {'class': 'SearchResult result'})
|
|
for raw in results:
|
|
for raw in results:
|
|
|
|
+ vhosts = []
|
|
|
|
+ urls = []
|
|
|
|
+ protocols = []
|
|
ip = raw.find_all('span', {'class': 'dns'})[0].get('id')
|
|
ip = raw.find_all('span', {'class': 'dns'})[0].get('id')
|
|
vhosts_html = raw.find_all('i', {'title': 'names on certificate'})
|
|
vhosts_html = raw.find_all('i', {'title': 'names on certificate'})
|
|
if vhosts_html:
|
|
if vhosts_html:
|
|
l = vhosts_html[0].next_sibling.replace(' ', '')
|
|
l = vhosts_html[0].next_sibling.replace(' ', '')
|
|
for vhost in l.split(','):
|
|
for vhost in l.split(','):
|
|
vhosts.append(vhost)
|
|
vhosts.append(vhost)
|
|
- self.ipv4.append({'ip': ip, 'protocols': protocols, 'vhosts': vhosts})
|
|
|
|
- return True
|
|
|
|
|
|
+ protocols_html = raw.find_all('i', {'title': 'public protocols'})
|
|
|
|
+ if protocols_html:
|
|
|
|
+ l = protocols_html[0].next_sibling.replace(' ', '')
|
|
|
|
+ for protocol in l.split(','):
|
|
|
|
+ protocols.append(protocol)
|
|
|
|
+ self.ipv4.append({'ip': ip, 'protocols': protocols, 'vhosts': vhosts, 'urls': urls})
|
|
|
|
+ return True
|