rename function that finds vulnerable node IDs

This commit is contained in:
ophirharpazg 2020-09-01 11:53:38 +03:00
parent cec57c1604
commit 6e2678473c
1 changed files with 3 additions and 3 deletions

View File

@ -25,8 +25,8 @@ def check_drupal_cache(r: requests.Response) -> bool:
return 'X-Drupal-Cache' in r.headers and r.headers['X-Drupal-Cache'] == 'HIT' return 'X-Drupal-Cache' in r.headers and r.headers['X-Drupal-Cache'] == 'HIT'
def find_articles(base_url: str, lower: int = 1, upper: int = 10): def find_exploitbale_article_ids(base_url: str, lower: int = 1, upper: int = 10) -> set:
""" Find a target article that does not 404 and is not cached """ """ Find target articles that do not 404 and are not cached """
articles = set() articles = set()
while lower < upper: while lower < upper:
u = urljoin(base_url, str(lower)) u = urljoin(base_url, str(lower))
@ -66,7 +66,7 @@ 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_articles(url) node_ids = find_exploitbale_article_ids(url)
if node_ids is None: if node_ids is None:
LOG.info('Could not find a Drupal node to attack') LOG.info('Could not find a Drupal node to attack')
continue continue