Agent: Add human-readable thread name to MonkeyTunnel

This commit is contained in:
Mike Salvatore 2022-03-09 08:53:23 -05:00 committed by vakarisz
parent f9a7672767
commit 87dbe20c23
2 changed files with 5 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class MonkeyTunnel(Thread):
self._stopped = Event()
self._clients = []
self.local_port = None
super(MonkeyTunnel, self).__init__()
super(MonkeyTunnel, self).__init__(name="MonkeyTunnelThread")
self.daemon = True
self.l_ips = None
self._wait_for_exploited_machines = Event()

View File

@ -7,7 +7,10 @@ logger = logging.getLogger(__name__)
def run_worker_threads(
target: Callable[..., None], name_prefix: str = None, args: Tuple = (), num_workers: int = 2
target: Callable[..., None],
name_prefix: Optional[str] = None,
args: Tuple = (),
num_workers: int = 2,
):
worker_threads = []
counter = run_worker_threads.counters.setdefault(name_prefix, count(start=1))