try to handle exceptions (not finished)

This commit is contained in:
ophirharpazg 2020-09-01 15:43:25 +03:00
parent 6efc7d8f82
commit cb6e516e79
1 changed files with 14 additions and 11 deletions

View File

@ -46,17 +46,20 @@ class DrupalExploiter(WebRCE):
:return: None (in-place addition)
"""
for url in potential_urls:
node_ids = find_exploitbale_article_ids(url)
if node_ids is None:
LOG.info('Could not find a Drupal node to attack')
continue
for node_id in node_ids:
node_url = urljoin(url, str(node_id))
if self.check_if_exploitable(node_url):
self.add_vuln_url(url) # This is for report. Should be refactored in the future
self.vulnerable_urls.append(node_url)
if stop_checking:
break
try:
node_ids = find_exploitbale_article_ids(url)
if node_ids is None:
LOG.info('Could not find a Drupal node to attack')
continue
for node_id in node_ids:
node_url = urljoin(url, str(node_id))
if self.check_if_exploitable(node_url):
self.add_vuln_url(url) # This is for report. Should be refactored in the future
self.vulnerable_urls.append(node_url)
if stop_checking:
break
except Exception as e: # We still don't know which errors to expect
LOG.error(f'url {url} failed in exploitability check: {e}')
if not self.vulnerable_urls:
LOG.info("No vulnerable urls found")