Close sockets to resolve file handle error

MS-2855/keylogger-mettle-extension
Matthew Kienow 2017-11-13 18:51:07 -05:00
parent 52f56527d8
commit e07fe77a69
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 4 additions and 3 deletions

View File

@ -60,13 +60,14 @@ class MetasploitModule < Msf::Auxiliary
1.upto(thread_count) do |i|
threads << framework.threads.spawn("Module(#{self.refname})-request#{(starting_thread - 1) + i}", false, i) do |i|
begin
connect()
sock.puts(header)
current_sock = connect(global=false)
current_sock.puts(header)
headers.times do
data = "X-a-#{rand(0..1000)}: b\r\n"
sock.puts(data)
current_sock.puts(data)
sleep rand(1..timeout)
end
disconnect(nsock=current_sock)
end
end
end