From f3f9008dd88aec84e96b7e24c514731822fbd0da Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 18 Jul 2019 17:14:18 +0200 Subject: [PATCH 1/2] Fix attribute selector error with a beautifulsoup4 package in version 4.7.1-1 --- domi_owned/hashdump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domi_owned/hashdump.py b/domi_owned/hashdump.py index d99f3bc..598a19f 100644 --- a/domi_owned/hashdump.py +++ b/domi_owned/hashdump.py @@ -72,7 +72,7 @@ def get_accounts(self): if 'No documents found' in str(soup.findAll('h2')): break else: - links = [a.attrs.get('href') for a in soup.select('a[href^=/names.nsf/]')] + links = [a.attrs.get('href') for a in soup.select('a[href^="/names.nsf/"]')] for link in links: if self.utilities.ACCOUNT_REGEX.search(link): account_url = "{0}/names.nsf/{1}?OpenDocument".format(self.url, self.utilities.ACCOUNT_REGEX.search(link).group(1)) From 4bed112e72400a24067ed087669cbac7c84d7bb5 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 18 Jul 2019 17:15:32 +0200 Subject: [PATCH 2/2] Fix issues produced with async --- domi_owned/enumerate.py | 18 ++++++++++-------- domi_owned/hashdump.py | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/domi_owned/enumerate.py b/domi_owned/enumerate.py index 28c4a78..d85134c 100644 --- a/domi_owned/enumerate.py +++ b/domi_owned/enumerate.py @@ -97,14 +97,16 @@ def enum_dirs(self, urls): else: client = aiohttp.ClientSession(headers=self.utilities.HEADERS, loop=loop) - with client as session: - try: - loop.run_until_complete(self.query(session, urls)) - except asyncio.CancelledError: - sys.exit() - except Exception as error: - self.logger.error('An error occurred while enumerating Domino URLs') - sys.exit() + #with client as session: + try: + task = loop.create_task(self.query(client, urls)) + loop.run_until_complete(task) + loop.close() + except asyncio.CancelledError: + sys.exit() + except Exception as error: + self.logger.error('An error occurred while enumerating Domino URLs') + sys.exit() async def query(self, session, urls): """ diff --git a/domi_owned/hashdump.py b/domi_owned/hashdump.py index 598a19f..065fb68 100644 --- a/domi_owned/hashdump.py +++ b/domi_owned/hashdump.py @@ -112,14 +112,16 @@ def get_hashes(self, urls): else: client = aiohttp.ClientSession(headers=self.utilities.HEADERS, loop=loop) - with client as session: - try: - loop.run_until_complete(self.query(session, urls)) - except asyncio.CancelledError: - sys.exit() - except Exception as error: - self.logger.error('An error occurred while dumping Domino account hashes') - sys.exit() + #with client as session: + try: + task = loop.create_task(self.query(client, urls)) + loop.run_until_complete(task) + loop.close() + except asyncio.CancelledError: + sys.exit() + except Exception as error: + self.logger.error('An error occurred while dumping Domino account hashes') + sys.exit() async def query(self, session, urls): """