1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-02-28 06:13:03 +01:00

Remove an unnecessary var and fix process_close

This commit is contained in:
Spencer McIntyre 2014-10-02 20:52:45 -04:00
parent 3cecd9173f
commit 510ef4e3ca
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
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

View File

@ -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: