diff --git a/monkey/infection_monkey/exploit/log4shell_utils/ldap_server.py b/monkey/infection_monkey/exploit/log4shell_utils/ldap_server.py index e6efac5ff..f0acac141 100644 --- a/monkey/infection_monkey/exploit/log4shell_utils/ldap_server.py +++ b/monkey/infection_monkey/exploit/log4shell_utils/ldap_server.py @@ -89,4 +89,7 @@ class LDAPExploitServer: reactor.run(installSignalHandlers=0) def stop(self): - reactor.stop() + # Since `reactor.run()` may not be running on the main thread, reactor.stop() must be + # invoked with reactor.callFromThread() + # https://twistedmatrix.com/documents/12.2.0/core/howto/threading.html + reactor.callFromThread(reactor.stop)