diff --git a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb index 0306f5a2b8..30ef5c56cc 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb @@ -107,7 +107,14 @@ class Socket # Creates a TCP client channel. # def create_tcp_client(params) + begin return SocketSubsystem::TcpClientChannel.open(client, params) + rescue ::Rex::Post::Meterpreter::RequestError => e + if(e.result == 10061) + raise ::Rex::ConnectionError.new + end + raise e + end end #