bug/bundler_fix
Stuart Morgan 2015-11-29 18:59:40 +00:00
parent 6a567845e0
commit 10f89239a5
1 changed files with 100 additions and 105 deletions

View File

@ -9,7 +9,6 @@ require 'msf/core'
require 'rex'
class Metasploit3 < Msf::Post
def initialize(info = {})
super(update_info(info,
'Name' => 'Generate TCP/UDP Outbound Traffic On Multiple Ports',
@ -59,7 +58,7 @@ class Metasploit3 < Msf::Post
vprint_status("[#{num}:NATIVE] Connecting to #{ip} port #{proto}/#{port}")
if proto == 'TCP'
begin
rtcp = Rex::Socket::Tcp.create(
Rex::Socket::Tcp.create(
'PeerHost' => ip,
'PeerPort' => port,
'Timeout' => 1
@ -142,9 +141,8 @@ class Metasploit3 < Msf::Post
# If native, set up the route
if type == 'NATIVE'
if (gw = framework.sessions.get(datastore['SESSION'])) and (gw.kind_of?(Msf::Session::Comm))
route_result = Rex::Socket::SwitchBoard.add_route(remote, '255.255.255.255', gw)
if route_result
if (gw = framework.sessions.get(datastore['SESSION'])) && (gw.is_a?(Msf::Session::Comm))
route_result = Rex::Socket::SwitchBoard.add_route(remote, '255.255.255.255', gw) if route_result
print_status("Adding route to direct egress traffic to #{remote}")
else
print_error("Error adding route to direct egress traffic to #{remote}")
@ -152,7 +150,6 @@ class Metasploit3 < Msf::Post
else
print_error("Error getting session to route egress traffic through to #{remote}")
end
end
print_status("Generating #{proto} traffic to #{remote}...")
@ -190,7 +187,6 @@ class Metasploit3 < Msf::Post
end
print_status("#{proto} traffic generation to #{remote} completed.")
return
end
# This will generate a packet on proto <proto> to IP <remote> on port <dport>
@ -213,5 +209,4 @@ class Metasploit3 < Msf::Post
client.railgun.ws2_32.closesocket(socket_handle['return'])
end
end