Skip to main content

simple telnet module

Project description

xtelnet

This is an easy to use telnet module to interact with a remote system smoothly over this protocol!

Install :

pip install xtelnet

or

pip3 install xtelnet

Usage on a script :

import xtelnet
t=xtelnet.session()
ip='192.168.0.32'#just an example
t.login(ip, username='root',password='toor',p=23,timeout=5)
output1=t.execute('echo ala_is_king')
print(output1)
output2=t.execute('cd / && ls')
print(output2)
t.close()

Usage from command line :


python -m xtelnet host [options...]


options:


--host : set a host to connect to (required)
--username : set a username (required if username is needed to access)
--password : set a password (required if password is needed to access)
--port : (23 by default) set port (optional)
--timeout : (5 by default) set timeout (optional)
--add-command : a command to execute after login (optional)
--command-timeout : timeout for command execution (optional)
--set-newline : set a new line indecator("\n" or "\r\n") (optional)
--no-shell : disable shell after authentication (optional)
--help : get this help message (optional)


example:


python -m xtelnet 127.0.0.1 --username root --password root --add-command "echo ala" --add-command "dir"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtelnet-1.1.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file xtelnet-1.1.1.tar.gz.

File metadata

  • Download URL: xtelnet-1.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/2.7.17

File hashes

Hashes for xtelnet-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a4d2cf0aaa5b807881964ef8a9baa9943438195b3dc765b9841eb3deac806385
MD5 ff3f2b7fbed1142836a4b3726b441cda
BLAKE2b-256 6f9efacefbd85dfdad01069a1c454af6ccc948dc80a977e9b8f1e3801d912ea7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page