diff --git a/data/meterpreter/ext_server_stdapi.py b/data/meterpreter/ext_server_stdapi.py index 660072ad2b..e462ed0f89 100644 --- a/data/meterpreter/ext_server_stdapi.py +++ b/data/meterpreter/ext_server_stdapi.py @@ -666,12 +666,11 @@ def stdapi_sys_config_sysinfo(request, response): @meterpreter.register_function def stdapi_sys_process_close(request, response): - proc_h_id = packet_get_tlv(request, TLV_TYPE_PROCESS_HANDLE) + proc_h_id = packet_get_tlv(request, TLV_TYPE_HANDLE) if not proc_h_id: return ERROR_SUCCESS, response proc_h_id = proc_h_id['value'] - proc_h = meterpreter.channels[proc_h_id] - proc_h.kill() + del meterpreter.processes[proc_h_id] return ERROR_SUCCESS, response @meterpreter.register_function diff --git a/data/meterpreter/meterpreter.py b/data/meterpreter/meterpreter.py index 693f83a3c5..50fbaec1a9 100644 --- a/data/meterpreter/meterpreter.py +++ b/data/meterpreter/meterpreter.py @@ -332,7 +332,6 @@ class PythonMeterpreter(object): response = self.create_response(request) self.socket.send(response) else: - channels_for_removal = [] # iterate over the keys because self.channels could be modified if one is closed channel_ids = list(self.channels.keys()) for channel_id in channel_ids: