Merge pull request #19 from jvazquez-r7/land_wchen_3701

Add http socket to the module sockets array and allow the framework to cleanup
bug/bundler_fix
sinn3r 2014-09-03 12:08:51 -05:00
commit 37f110febb
2 changed files with 40 additions and 46 deletions

View File

@ -62,33 +62,30 @@ class Metasploit4 < Msf::Auxiliary
def send_image_request(opts)
http = nil
begin
http = Rex::Proto::Http::Client.new(
rhost,
rport.to_i,
{
'Msf' => framework,
'MsfExploit' => self
},
ssl,
ssl_version,
proxies,
datastore['USERNAME'],
datastore['PASSWORD']
)
http = Rex::Proto::Http::Client.new(
rhost,
rport.to_i,
{
'Msf' => framework,
'MsfExploit' => self
},
ssl,
ssl_version,
proxies,
datastore['USERNAME'],
datastore['PASSWORD']
)
add_socket(http)
http.set_config('agent' => datastore['UserAgent'])
http.set_config('agent' => datastore['UserAgent'])
req = http.request_raw(opts)
res = http.send_recv(req)
req = http.request_raw(opts)
res = http.send_recv(req)
sleep(datastore['TIME']) if res.code == 200
http.close
ensure
cleanup
end
Rex.sleep(datastore['TIME']) if res.code == 200
http.close
http
res
end

View File

@ -65,32 +65,29 @@ class Metasploit4 < Msf::Auxiliary
def send_video_request(opts)
http = nil
begin
http = Rex::Proto::Http::Client.new(
rhost,
rport.to_i,
{
'Msf' => framework,
'MsfExploit' => self
},
ssl,
ssl_version,
proxies,
datastore['USERNAME'],
datastore['PASSWORD']
)
http = Rex::Proto::Http::Client.new(
rhost,
rport.to_i,
{
'Msf' => framework,
'MsfExploit' => self
},
ssl,
ssl_version,
proxies,
datastore['USERNAME'],
datastore['PASSWORD']
)
add_socket(http)
http.set_config('agent' => datastore['UserAgent'])
http.set_config('agent' => datastore['UserAgent'])
req = http.request_raw(opts)
res = http.send_recv(req)
sleep(datastore['TIME']) if res.code == 200
http.close
ensure
cleanup
end
req = http.request_raw(opts)
res = http.send_recv(req)
Rex.sleep(datastore['TIME']) if res.code == 200
http.close
http
res
end