TELNET Protocol Implementation
This a P2P implementation of telnet. This program transfers data on TCP sockets as plain text. However there is also an option to send and recieve messages in encryption mode. It uses the rsa module to generate public and private keys and a handshake is done between client and server to transfer their public key to the otherside.
This is not a complete implementation in telnet protocol based on rfc854. There is no option negotiation to establish an NVT
This script could be used for:
- Sending plain and encrypted text messages to server
- Upload and download files to and from a peer
- Execute commands on another peer and get the results
- Scan open ports of a host
- Send other requests such as SMTP or HTTP requests to servers.
This program uses PostgreSQL to save commands entered on client side on telnet_history database. When you run program in client mode it asks for username and password to connect to Postgre database.
You need to run this script as 2 proccesses for client and server mode.
To exit the program press Ctrl+c.
Server Mode
To run in server mode you need to run the following command in terminal:
>python3 main.py server [portnumber] [-e]
portnumber is the port server is going to listen on.
-e should be provided if you would like to enter encrypted mode.
Client Mode
To run in client mode you need to run the following command in terminal:
>python3 main.py client
-
To establish a connection:
telnet> open [host] [port] [-e]
When connection is established you can:
-
Send message to another peer:
127.0.0.1:2250> send message hi done
-
Send message to a remote SMTP or HTTP server:
-