2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2005-12-08 18:26:38 +00:00
|
|
|
#
|
|
|
|
# Provides some sanity checks against the ruby build and version
|
|
|
|
#
|
|
|
|
|
2009-06-14 21:37:02 +00:00
|
|
|
if(RUBY_PLATFORM == 'java')
|
2013-08-30 21:28:33 +00:00
|
|
|
require 'socket'
|
|
|
|
s = Socket.new(::Socket::AF_INET, ::Socket::SOCK_STREAM, ::Socket::IPPROTO_TCP)
|
|
|
|
if(not s.respond_to?('bind'))
|
|
|
|
$stderr.puts "*** JRuby 1.5.0+ is required to use Metasploit with jRuby"
|
|
|
|
exit(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
$stderr.puts "*** Warning: JRuby support is still incomplete, few things will work properly!"
|
|
|
|
trap Signal::list['INT'] do
|
|
|
|
Thread.main.raise Interrupt.new
|
|
|
|
end
|
|
|
|
|
|
|
|
s.close
|
2009-06-14 21:37:02 +00:00
|
|
|
end
|
2009-03-30 02:57:10 +00:00
|
|
|
|
2009-10-02 14:24:10 +00:00
|
|
|
# Check for OpenSSL and print a warning if it is not installed
|
|
|
|
begin
|
2013-08-30 21:28:33 +00:00
|
|
|
require 'openssl'
|
2009-10-02 14:24:10 +00:00
|
|
|
rescue ::LoadError
|
2013-08-30 21:28:33 +00:00
|
|
|
$stderr.puts "*** The ruby-openssl library is not installed, many features will be disabled!"
|
|
|
|
$stderr.puts "*** Examples: Meterpreter, SSL Sockets, SMB/NTLM Authentication, and more"
|
2009-10-02 14:24:10 +00:00
|
|
|
end
|