Module: Ronin::Network::Telnet

Defined in:
lib/ronin/network/telnet.rb

Overview

Global settings for accessing Telnet.

Constant Summary collapse

DEFAULT_PORT =

Default telnet port

23
DEFAULT_PROMPT =

The default prompt regular expression

/[$%#>] \z/n
DEFAULT_TIMEOUT =

The default timeout

10

Class Method Summary collapse

Class Method Details

.default_portInteger

Returns The default Ronin Telnet port.

Returns:

  • (Integer)

    The default Ronin Telnet port.



43
44
45
# File 'lib/ronin/network/telnet.rb', line 43

def Telnet.default_port
  @default_port ||= DEFAULT_PORT
end

.default_port=(port) ⇒ Object

Sets the default Ronin Telnet port.

Parameters:

  • port (Integer)

    The new default Ronin Telnet port.



55
56
57
# File 'lib/ronin/network/telnet.rb', line 55

def Telnet.default_port=(port)
  @default_port = port
end

.default_promptRegexp

Returns The default Ronin Telnet prompt pattern.

Returns:

  • (Regexp)

    The default Ronin Telnet prompt pattern.



65
66
67
# File 'lib/ronin/network/telnet.rb', line 65

def Telnet.default_prompt
  @default_prompt ||= DEFAULT_PROMPT
end

.default_prompt=(prompt) ⇒ Object

Sets the default Ronin Telnet prompt pattern.

Parameters:

  • prompt (Regexp)

    The new default Ronin Telnet prompt pattern.



77
78
79
# File 'lib/ronin/network/telnet.rb', line 77

def Telnet.default_prompt=(prompt)
  @default_prompt = prompt
end

.default_timeoutInteger

Returns The default Ronin Telnet timeout.

Returns:

  • (Integer)

    The default Ronin Telnet timeout.



87
88
89
# File 'lib/ronin/network/telnet.rb', line 87

def Telnet.default_timeout
  @default_timeout ||= DEFAULT_TIMEOUT
end

.default_timeout=(timeout) ⇒ Object

Sets the default Ronin Telnet timeout.

Parameters:

  • timeout (Integer)

    The new default Ronin Telnet timeout.



99
100
101
# File 'lib/ronin/network/telnet.rb', line 99

def Telnet.default_timeout=(timeout)
  @default_timeout = timeout
end

.proxyTelnet, ...

Returns The Ronin Telnet proxy.

Returns:

  • (Telnet, IO, nil)

    The Ronin Telnet proxy.



109
110
111
# File 'lib/ronin/network/telnet.rb', line 109

def Telnet.proxy
  @proxy ||= nil
end

.proxy=(new_proxy) ⇒ Object

Sets the Ronin Telnet proxy.

Parameters:

  • new_proxy (Telnet, IO, nil)

    The new Ronin Telnet proxy.



121
122
123
# File 'lib/ronin/network/telnet.rb', line 121

def Telnet.proxy=(new_proxy)
  @proxy = new_proxy
end