Skip to content

Telnet Client

Marcin Bury edited this page Oct 12, 2018 · 1 revision

Telnet Client

Example exploit that utilises Telnet communication as a client

TelnetClient Methods

TelnetClient.telnet_create

Create TelnetCli object

Params

Param Type Description Required
target str target Telnet IP address no, default=exploit.target
port int target Telnet port no, default=exploit.port

Returns

Type Description
TelnetCli TelnetCli object that is used for communication

Example

TelnetCli Methods

TelnetCli.connect

Connect to Telnet server

Params

  • None

Returns

Type Description
bool True if connection was successful, False otherwise

Example

TelnetCli.login

Login to Telnet server

Params

Param Type Description Required
username str Telnet account username yes
password str Telnet account password yes
retries int number of authentication attempts retries no, default=1

Returns

Type Description
bool True if authentication was successful, False otherwise

Example

TelnetCli.test_connect

Test connection to Telnet server

Params

  • None

Returns

Type Description
bool True if test connection was successful, False otherwise

Example

TelnetCli.interactive

Start interactive mode with Telnet server

Params

  • None

Returns

  • None

Example

TelnetCli.read_until

Read until specified data found in response

Params

Param Type Description Required
data bytes bytes until which data should be read yes

Returns

Type Description
bytes bytes read until specified data

Example

TelnetCli.write

Write data to Telnet server

Params

Param Type Description Required
data bytes data that should be written to Telnet server yes

Returns

Type Description
bool True if data was written successful, False otherwise

Example

TelnetCli.close

Close connection to Telnet server

Params

  • None

Returns

Type Description
bool True if closing connection was successful, False otherwise

Example