diff --git a/lib/msf/core/module/platform.rb b/lib/msf/core/module/platform.rb index 8709d995bc..83e9fbf397 100644 --- a/lib/msf/core/module/platform.rb +++ b/lib/msf/core/module/platform.rb @@ -315,14 +315,6 @@ class Msf::Module::Platform Alias = "linux" end - # - # SCO - # - class SCO < Msf::Module::Platform - Rank = 100 - Alias = "sco" - end - # # Solaris # @@ -439,4 +431,4 @@ class Msf::Module::Platform Rank = 100 Alias = "php" end -end +end \ No newline at end of file diff --git a/lib/msf/core/module/platform_list.rb b/lib/msf/core/module/platform_list.rb index 1ebb5d85e4..f558b8daab 100644 --- a/lib/msf/core/module/platform_list.rb +++ b/lib/msf/core/module/platform_list.rb @@ -182,4 +182,4 @@ class Msf::Module::PlatformList raise RuntimeError, "No more expansion possible", caller end -end +end \ No newline at end of file diff --git a/lib/rex/parser/ini.rb b/lib/rex/parser/ini.rb index 89de1081cd..0cf701462e 100644 --- a/lib/rex/parser/ini.rb +++ b/lib/rex/parser/ini.rb @@ -114,13 +114,13 @@ class Ini < Hash def to_s str = '' keys.sort.each { |k| - str << "[#{k}]\n" + str += "[#{k}]\n" self[k].each_pair { |var, val| - str << "#{var}=#{val}\n" + str += "#{var}=#{val}\n" } - str << "\n"; + str += "\n"; } return str diff --git a/lib/rex/proto/smb/client.rb b/lib/rex/proto/smb/client.rb index f754c2a64c..593c6d78b6 100644 --- a/lib/rex/proto/smb/client.rb +++ b/lib/rex/proto/smb/client.rb @@ -1364,7 +1364,7 @@ EVADE = Rex::Proto::SMB::Evasions end # Perform a transaction2 request using the specified subcommand, parameters, and data - def trans2(subcommand, param = '', body = '', opts={}) + def trans2(subcommand, param = '', body = '') setup_count = 1 setup_data = [subcommand].pack('v') diff --git a/lib/rex/socket.rb b/lib/rex/socket.rb index ca34324651..a2ec483fd5 100644 --- a/lib/rex/socket.rb +++ b/lib/rex/socket.rb @@ -138,7 +138,6 @@ module Socket # def self.getaddress(addr) begin - addr,scope_id = addr.split('%') dotted_ip?(addr) ? addr : Resolv.getaddress(addr) rescue ::ArgumentError # Win32 bug nil diff --git a/lib/rex/socket/comm/local.rb b/lib/rex/socket/comm/local.rb index ecbd4009b1..238cdcee02 100644 --- a/lib/rex/socket/comm/local.rb +++ b/lib/rex/socket/comm/local.rb @@ -60,10 +60,6 @@ class Rex::Socket::Comm::Local # def self.create_by_type(param, type, proto = 0) - if(Rex::Compat.is_java) - return create_by_type_jruby(param, type, proto) - end - # Whether to use IPv6 addressing usev6 = false @@ -135,10 +131,7 @@ class Rex::Socket::Comm::Local end # Bind to a given local address and/or port if they are supplied - if ( - (param.localhost and param.localhost != "0.0.0.0") || - (param.localport and param.localport != 0) - ) + if (param.localhost || param.localport) begin sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_REUSEADDR, true) @@ -331,27 +324,6 @@ class Rex::Socket::Comm::Local if response[1] != 0 raise "SOCKS5 server responded with error code #{response[1]}" end - when 'bbproxy' - setup = "#{host}:#{port}\r\n" - - [4,1,port.to_i].pack('CCn') + Socket.gethostbyname(host)[3] + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00" - size = sock.put(setup) - if (size != setup.length) - raise ArgumentError, "Wrote less data than expected to the socks4 proxy" - end - - begin - ret = sock.get_once(8, 30) - rescue IOError - raise Rex::ConnectionRefused.new(host, port), caller - end - - if (ret.nil? or ret.length < 8) - raise ArgumentError, 'SOCKS4 server did not respond with a proper response' - end - if ret[1] != 90 - raise "SOCKS4 server responded with error code #{ret[0]}" - end else raise ArgumentError, 'Unsupported proxy type and/or version', caller end @@ -374,47 +346,5 @@ class Rex::Socket::Comm::Local def self.each_event_handler(handler) # :nodoc: self.instance.each_event_handler(handler) end - - - # - # JRuby is still really, really broken, but this lets us test - # - def self.create_by_type_jruby(param, type, proto = 0) - - begin - klass = nil - sock = nil - - if(type == 1 and proto == 6) - sock = TCPSocket.new(param.peerhost, param.peerport) - klass = Rex::Socket::Tcp - klass = Rex::Socket::SslTcp if param.ssl - end - - if(proto == 17) - sock = UDPSocket.new(param.peerhost, param.peerport) - klass = Rex::Socket::Udp - end - - raise ArgumentError,"Unsupported socket type" if not sock - - sock.extend(klass) - sock.initsock(param) - - return sock - - rescue ::Errno::EHOSTUNREACH,::Errno::ENETDOWN,::Errno::ENETUNREACH,::Errno::ENETRESET,::Errno::EHOSTDOWN,::Errno::EACCES,::Errno::EINVAL,::Errno::EADDRNOTAVAIL - sock.close if sock - raise Rex::HostUnreachable.new(param.peerhost, param.peerport), caller - - rescue Errno::ETIMEDOUT - sock.close if sock - raise Rex::ConnectionTimeout.new(param.peerhost, param.peerport), caller - - rescue ::Errno::ECONNRESET,::Errno::ECONNREFUSED,::Errno::ENOTCONN,::Errno::ECONNABORTED - sock.close if sock - raise Rex::ConnectionRefused.new(param.peerhost, param.peerport), caller - end - end end