From 27e3cc6b4cf0b57c54bb2635027aee786b841f06 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 9 Mar 2022 15:21:46 -0500 Subject: [PATCH] Agent: Add @wraps to WmiTools decorators --- monkey/infection_monkey/exploit/tools/wmi_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monkey/infection_monkey/exploit/tools/wmi_tools.py b/monkey/infection_monkey/exploit/tools/wmi_tools.py index 976e462e5..ab0afdb89 100644 --- a/monkey/infection_monkey/exploit/tools/wmi_tools.py +++ b/monkey/infection_monkey/exploit/tools/wmi_tools.py @@ -1,5 +1,6 @@ import logging import threading +from functools import wraps from impacket.dcerpc.v5.dcom import wmi from impacket.dcerpc.v5.dcom.wmi import DCERPCSessionError @@ -26,6 +27,7 @@ class AccessDeniedException(Exception): class WmiTools(object): @staticmethod def impacket_user(func): + @wraps(func) def _wrapper(*args, **kwarg): logger.debug("Waiting for impacket lock") with lock: @@ -92,6 +94,7 @@ class WmiTools(object): @staticmethod def dcom_wrap(func): + @wraps(func) def _wrapper(*args, **kwarg): try: logger.debug("Running function from dcom_wrap")