Agent: Add debug logging to decorators in WmiTools

This commit is contained in:
Mike Salvatore 2022-03-09 14:43:10 -05:00
parent 2c8aef6d80
commit 720768e25d
1 changed files with 4 additions and 1 deletions

View File

@ -24,11 +24,12 @@ class AccessDeniedException(Exception):
class WmiTools(object):
@staticmethod
def impacket_user(func):
def _wrapper(*args, **kwarg):
logger.debug("Waiting for impacket lock")
with lock:
logger.debug("Acquired impacket lock")
return func(*args, **kwarg)
return _wrapper
@ -93,8 +94,10 @@ class WmiTools(object):
def dcom_wrap(func):
def _wrapper(*args, **kwarg):
try:
logger.debug("Running function from dcom_wrap")
return func(*args, **kwarg)
finally:
logger.debug("Running dcom cleanup")
WmiTools.dcom_cleanup()
return _wrapper