Remove an unnecessary var and fix process_close

bug/bundler_fix
Spencer McIntyre 2014-10-02 20:52:45 -04:00
parent 0820a4fe6a
commit 7da22d064d
2 changed files with 2 additions and 4 deletions

View File

@ -666,12 +666,11 @@ def stdapi_sys_config_sysinfo(request, response):
@meterpreter.register_function @meterpreter.register_function
def stdapi_sys_process_close(request, response): 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: if not proc_h_id:
return ERROR_SUCCESS, response return ERROR_SUCCESS, response
proc_h_id = proc_h_id['value'] proc_h_id = proc_h_id['value']
proc_h = meterpreter.channels[proc_h_id] del meterpreter.processes[proc_h_id]
proc_h.kill()
return ERROR_SUCCESS, response return ERROR_SUCCESS, response
@meterpreter.register_function @meterpreter.register_function

View File

@ -332,7 +332,6 @@ class PythonMeterpreter(object):
response = self.create_response(request) response = self.create_response(request)
self.socket.send(response) self.socket.send(response)
else: else:
channels_for_removal = []
# iterate over the keys because self.channels could be modified if one is closed # iterate over the keys because self.channels could be modified if one is closed
channel_ids = list(self.channels.keys()) channel_ids = list(self.channels.keys())
for channel_id in channel_ids: for channel_id in channel_ids: