Revert last commit temporarily

git-svn-id: file:///home/svn/framework3/trunk@6313 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-03-07 23:00:17 +00:00
parent aa4274a3bb
commit 95f6aa0d02
6 changed files with 7 additions and 86 deletions

View File

@ -315,14 +315,6 @@ class Msf::Module::Platform
Alias = "linux"
end
#
# SCO
#
class SCO < Msf::Module::Platform
Rank = 100
Alias = "sco"
end
#
# Solaris
#

View File

@ -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

View File

@ -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')

View File

@ -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

View File

@ -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
@ -375,46 +347,4 @@ class Rex::Socket::Comm::Local
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