forked from p34709852/monkey
try to handle exceptions (not finished)
This commit is contained in:
parent
6efc7d8f82
commit
cb6e516e79
|
@ -46,17 +46,20 @@ class DrupalExploiter(WebRCE):
|
||||||
:return: None (in-place addition)
|
:return: None (in-place addition)
|
||||||
"""
|
"""
|
||||||
for url in potential_urls:
|
for url in potential_urls:
|
||||||
node_ids = find_exploitbale_article_ids(url)
|
try:
|
||||||
if node_ids is None:
|
node_ids = find_exploitbale_article_ids(url)
|
||||||
LOG.info('Could not find a Drupal node to attack')
|
if node_ids is None:
|
||||||
continue
|
LOG.info('Could not find a Drupal node to attack')
|
||||||
for node_id in node_ids:
|
continue
|
||||||
node_url = urljoin(url, str(node_id))
|
for node_id in node_ids:
|
||||||
if self.check_if_exploitable(node_url):
|
node_url = urljoin(url, str(node_id))
|
||||||
self.add_vuln_url(url) # This is for report. Should be refactored in the future
|
if self.check_if_exploitable(node_url):
|
||||||
self.vulnerable_urls.append(node_url)
|
self.add_vuln_url(url) # This is for report. Should be refactored in the future
|
||||||
if stop_checking:
|
self.vulnerable_urls.append(node_url)
|
||||||
break
|
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:
|
if not self.vulnerable_urls:
|
||||||
LOG.info("No vulnerable urls found")
|
LOG.info("No vulnerable urls found")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue