lib/ronin/network/extensions/telnet/net.rb in ronin-0.2.2 vs lib/ronin/network/extensions/telnet/net.rb in ronin-0.2.3
- old
+ new
@@ -22,11 +22,10 @@
#
require 'ronin/network/telnet'
require 'net/telnet'
-require 'net/telnets'
module Net
#
# Creates a new Telnet object with the specified _host_, given port
# and the given _options_. If a _block_ is given, it will be passed
@@ -65,17 +64,10 @@
# another telnet object or an IO object.
# Defaults to
# <tt>Ronin::Network::Telnet.proxy</tt>, if not given.
# <tt>:user</tt>:: The user to login with.
# <tt>:password</tt>:: The password to login with.
- # <tt>:ssl</tt>:: A Hash of SSL information to use for a SSLed
- # Telnet session. This hash must contain the following
- # keys.
- # <tt>:certfile</tt>:: The SSL Certfile to use.
- # <tt>:keyfile</tt>:: The SSL Key file to use.
- # <tt>:cafile</tt>:: The SSL CAFile to use.
- # <tt>:capath</tt>:: The SSL CAPath to use.
#
# Telnet.connect('towel.blinkenlights.nl') # => Telnet
#
def Net.telnet_connect(host,options={},&block)
sess_opts = {}
@@ -94,19 +86,9 @@
sess_opts['Waittime'] = options[:wait_time]
sess_opts['Proxy'] = (options[:proxy] || Ronin::Network::Telnet.proxy)
user = options[:user]
passwd = options[:passwd]
-
- if options[:ssl]
- sess_opts['CertFile'] = options[:ssl][:certfile]
- sess_opts['KeyFile'] = options[:ssl][:keyfile]
- sess_opts['CAFile'] = options[:ssl][:cafile]
- sess_opts['CAPath'] = options[:ssl][:capath]
- sess_opts['VerifyMode'] = (options[:ssl][:verify] || SSL::VERIFY_PEER)
- sess_opts['VerifyCallback'] = options[:ssl][:verify_callback]
- sess_opts['VerifyDepth'] = options[:ssl][:verify_depth]
- end
sess = Net::Telnet.new(sess_opts)
sess.login(user,passwd) if user
block.call(sess) if block