Module: Ronin::Network::Mixins::Telnet
Overview
Adds Telnet convenience methods and connection parameters to a class.
Defines the following parameters:
host
(String
) - Telnet host.port
(Integer
) - Telnet port.telnet_user
(String
) - Telnet user to login as.telnet_password
(String
) - Telnet password to login with.telnet_proxy
(String
) - Telnet proxy.telnet_ssl
(Boolean
) - Enable Telnet over SSL. Defaults totrue
.
Constant Summary
Constants included from Telnet
Telnet::DEFAULT_PORT, Telnet::DEFAULT_PROMPT, Telnet::DEFAULT_TIMEOUT
Class Method Summary collapse
-
.host ⇒ Object
Telnet host.
-
.host=(value) ⇒ Object
Telnet host.
-
.port ⇒ Object
Telnet port.
-
.port=(value) ⇒ Object
Telnet port.
-
.telnet_password ⇒ Object
Telnet password.
-
.telnet_password=(value) ⇒ Object
Telnet password.
-
.telnet_proxy ⇒ Object
Telnet proxy.
-
.telnet_proxy=(value) ⇒ Object
Telnet proxy.
-
.telnet_ssl ⇒ Object
Enable Telnet SSL.
-
.telnet_ssl=(value) ⇒ Object
Enable Telnet SSL.
-
.telnet_user ⇒ Object
Telnet user.
-
.telnet_user=(value) ⇒ Object
Telnet user.
Instance Method Summary collapse
-
#host ⇒ Object
Telnet host.
-
#host=(value) ⇒ Object
Telnet host.
-
#port ⇒ Object
Telnet port.
-
#port=(value) ⇒ Object
Telnet port.
-
#telnet_connect(options = {}) {|connection| ... } ⇒ Net::Telnet
protected
Creates a connection to a Telnet server.
-
#telnet_password ⇒ Object
Telnet password.
-
#telnet_password=(value) ⇒ Object
Telnet password.
-
#telnet_proxy ⇒ Object
Telnet proxy.
-
#telnet_proxy=(value) ⇒ Object
Telnet proxy.
-
#telnet_session(options = {}) {|session| ... } ⇒ Object
protected
Starts a session with a Telnet server.
-
#telnet_ssl ⇒ Object
Enable Telnet SSL.
-
#telnet_ssl=(value) ⇒ Object
Enable Telnet SSL.
-
#telnet_user ⇒ Object
Telnet user.
-
#telnet_user=(value) ⇒ Object
Telnet user.
Methods included from Mixin
Methods included from UI::Output::Helpers
format, #print_debug, #print_error, #print_exception, #print_info, #print_warning, #printf, #putc, #puts, #write
Methods included from Telnet
default_port, default_port=, default_prompt, default_prompt=, default_timeout, default_timeout=, proxy, proxy=
Class Method Details
.host ⇒ Object
Telnet host
43 44 |
# File 'lib/ronin/network/mixins/telnet.rb', line 43 parameter :host, :type => String, :description => 'Telnet host' |
.host=(value) ⇒ Object
Telnet host
43 44 |
# File 'lib/ronin/network/mixins/telnet.rb', line 43 parameter :host, :type => String, :description => 'Telnet host' |
.port ⇒ Object
Telnet port
47 48 |
# File 'lib/ronin/network/mixins/telnet.rb', line 47 parameter :port, :type => Integer, :description => 'Telnet port' |
.port=(value) ⇒ Object
Telnet port
47 48 |
# File 'lib/ronin/network/mixins/telnet.rb', line 47 parameter :port, :type => Integer, :description => 'Telnet port' |
.telnet_password ⇒ Object
Telnet password
55 56 |
# File 'lib/ronin/network/mixins/telnet.rb', line 55 parameter :telnet_password, :type => String, :description => 'Telnet password to login with' |
.telnet_password=(value) ⇒ Object
Telnet password
55 56 |
# File 'lib/ronin/network/mixins/telnet.rb', line 55 parameter :telnet_password, :type => String, :description => 'Telnet password to login with' |
.telnet_proxy ⇒ Object
Telnet proxy
59 |
# File 'lib/ronin/network/mixins/telnet.rb', line 59 parameter :telnet_proxy, :description => 'Telnet proxy' |
.telnet_proxy=(value) ⇒ Object
Telnet proxy
59 |
# File 'lib/ronin/network/mixins/telnet.rb', line 59 parameter :telnet_proxy, :description => 'Telnet proxy' |
.telnet_ssl ⇒ Object
Enable Telnet SSL
62 63 |
# File 'lib/ronin/network/mixins/telnet.rb', line 62 parameter :telnet_ssl, :type => true, :description => 'Enable Telnet over SSL' |
.telnet_ssl=(value) ⇒ Object
Enable Telnet SSL
62 63 |
# File 'lib/ronin/network/mixins/telnet.rb', line 62 parameter :telnet_ssl, :type => true, :description => 'Enable Telnet over SSL' |
Instance Method Details
#host ⇒ Object
Telnet host
43 44 |
# File 'lib/ronin/network/mixins/telnet.rb', line 43 parameter :host, :type => String, :description => 'Telnet host' |
#host=(value) ⇒ Object
Telnet host
43 44 |
# File 'lib/ronin/network/mixins/telnet.rb', line 43 parameter :host, :type => String, :description => 'Telnet host' |
#port ⇒ Object
Telnet port
47 48 |
# File 'lib/ronin/network/mixins/telnet.rb', line 47 parameter :port, :type => Integer, :description => 'Telnet port' |
#port=(value) ⇒ Object
Telnet port
47 48 |
# File 'lib/ronin/network/mixins/telnet.rb', line 47 parameter :port, :type => Integer, :description => 'Telnet port' |
#telnet_connect(options = {}) {|connection| ... } ⇒ Net::Telnet (protected)
Creates a connection to a Telnet server. The host
, port
,
telnet_user
, telnet_password
, telnet_proxy
and
telnet_ssl
parameters will also be used to connect to the
Telnet server.
139 140 141 142 143 |
# File 'lib/ronin/network/mixins/telnet.rb', line 139 def telnet_connect(={},&block) print_info "Connecting to #{host_port} ..." return super(self.host,(),&block) end |
#telnet_password ⇒ Object
Telnet password
55 56 |
# File 'lib/ronin/network/mixins/telnet.rb', line 55 parameter :telnet_password, :type => String, :description => 'Telnet password to login with' |
#telnet_password=(value) ⇒ Object
Telnet password
55 56 |
# File 'lib/ronin/network/mixins/telnet.rb', line 55 parameter :telnet_password, :type => String, :description => 'Telnet password to login with' |
#telnet_proxy ⇒ Object
Telnet proxy
59 |
# File 'lib/ronin/network/mixins/telnet.rb', line 59 parameter :telnet_proxy, :description => 'Telnet proxy' |
#telnet_proxy=(value) ⇒ Object
Telnet proxy
59 |
# File 'lib/ronin/network/mixins/telnet.rb', line 59 parameter :telnet_proxy, :description => 'Telnet proxy' |
#telnet_session(options = {}) {|session| ... } ⇒ Object (protected)
Starts a session with a Telnet server. The host
, port
,
telnet_user
, telnet_password
, telnet_proxy
and
telnet_ssl
parameters will also be used to connect to the
Telnet server.
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/ronin/network/mixins/telnet.rb', line 168 def telnet_session(={},&block) super(()) do |sess| yield sess if block_given? print "Logging out ..." end print_info "Disconnected to #{host_port}" return nil end |
#telnet_ssl ⇒ Object
Enable Telnet SSL
62 63 |
# File 'lib/ronin/network/mixins/telnet.rb', line 62 parameter :telnet_ssl, :type => true, :description => 'Enable Telnet over SSL' |
#telnet_ssl=(value) ⇒ Object
Enable Telnet SSL
62 63 |
# File 'lib/ronin/network/mixins/telnet.rb', line 62 parameter :telnet_ssl, :type => true, :description => 'Enable Telnet over SSL' |