From 355b75e21fb8eaf057c8570b21da228727133745 Mon Sep 17 00:00:00 2001 From: Gianfranco Alongi Date: Sun, 3 Apr 2022 13:38:48 +0200 Subject: [PATCH] Stop crackmapexec from crashing completely when concurrency issues cause lock-contention on the database - in SMB-mode. --- cme/crackmapexec.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cme/crackmapexec.py b/cme/crackmapexec.py index 7dd90165..eb4331ea 100755 --- a/cme/crackmapexec.py +++ b/cme/crackmapexec.py @@ -75,6 +75,8 @@ async def run_protocol(loop, protocol_obj, args, db, target, jitter): except asyncio.CancelledError: logging.debug("Stopping thread") thread.cancel() + except sqlite3.OperationalError as e: + logging.debug("Sqlite error - sqlite3.operationalError - {}".format(str(e))) async def start_threadpool(protocol_obj, args, db, targets, jitter): pool = ThreadPoolExecutor(max_workers=args.threads + 1) @@ -261,4 +263,4 @@ def main(): module_server.shutdown() if __name__ == '__main__': - main() \ No newline at end of file + main()