telnet implementation over TCP socket with python

Related tags

NetworkingCN-telnet
Overview

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:

  1. Sending plain and encrypted text messages to server
  2. Upload and download files to and from a peer
  3. Execute commands on another peer and get the results
  4. Scan open ports of a host
  5. 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:

    1. Send message to another peer:

      127.0.0.1:2250> send message
      hi
      done
      
    2. Send message to a remote SMTP or HTTP server:

      301 Moved

      301 Moved

      The document has moved here. Server response recieved! ">
      google.com:80>send remote
      GET / HTTP/1.1
      HOST: google.com
      
      done
      
      Waiting for server...
      HTTP/1.1 301 Moved Permanently
      Location: http://www.google.com/
      Content-Type: text/html; charset=UTF-8
      Date: Sun, 30 May 2021 11:24:52 GMT
      Expires: Tue, 29 Jun 2021 11:24:52 GMT
      Cache-Control: public, max-age=2592000
      Server: gws
      Content-Length: 219
      X-XSS-Protection: 0
      X-Frame-Options: SAMEORIGIN
      
      
      301 Moved
      

      301 Moved

      The document has moved here. Server response recieved!
    3. Upload a file to a peer:

      127.0.0.1:2250> upload [path]
      
    4. Download file from a peer:

      127.0.0.1:2250> download [path]
      
    5. Execute a command on peer:

      127.0.0.1:2250> exec [command]
      
    6. Disconnect:

      127.0.0.1:2250> quit
      
  • To scan 1 to 1024 ports from start_ip to end_port:

    telnet> scan [start_ip] [end_ip]
    
  • You could also see the previouse commands:

    telnet> history
    
Module for convenient work with TCP sockets.

m_socket-py Module for convenient work with TCP sockets. Contributing Pool Request is supported! Ask questions in the Issues section. License Copyrigh

Egor Arskiy 5 Mar 09, 2022
Converts Cisco formatted MAC Addresses to PC formatted MAC Addresses

Cisco-MAC-to-PC-MAC Converts a file with a list of Cisco formatted MAC Addresses to PC formatted MAC Addresses... Ex: abcd.efgh.ijkl to AB:CD:EF:GH:I

Stew Alexander 0 Jan 04, 2022
Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Tawren007 2 Nov 08, 2021
Multi-vendor library to simplify CLI connections to network devices

Netmiko Multi-vendor library to simplify CLI connections to network devices Why Netmiko? Network automation to screen-scraping devices is primarily co

Kirk Byers 3k Jan 01, 2023
A Python3 discord trojan, utilizing discord webhooks for sending information.

Vape-Lite-RAT A Python3 discord trojan, utilizing discord webhooks for sending information. What you do with this code / project / idea is non of my b

NightTab 12 Oct 15, 2022
A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

2 Jul 06, 2022
A repository dedicated to IoT(internet of things ) and python scripts

📑 Introduction Week of Learning is a weekly program in which you will get all the necessary knowledge about Circuit-Building, Arduino and Micro-Contr

27 Nov 22, 2022
Aiotor - a pool of proxies, shifting on each request

Aiotor - a pool of proxies, shifting on each request

Leon 32 Dec 26, 2022
Readable, simple and fast asynchronous non-blocking network apps

Fast and readable async non-blocking network apps Netius is a Python network library that can be used for the rapid creation of asynchronous non-block

Hive Solutions 120 Nov 20, 2022
AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

9 Mar 07, 2022
This python script can change the mac address after some attack

MAC-changer Hello people, this python script was written for people who want to change the mac address after some attack, I know there are many ways t

5 Oct 10, 2022
Jogo da forca simples com conexão entre cliente e servidor utilizando TCP.

JogoDaForcaTCP Um jogo da forca simples com conexão entre cliente e servidor utilizando o protocólo TCP. Como jogar: Habilite a porta 20000, inicie o

Kelvin Santos 1 Dec 01, 2021
GNS3 Graphical Network Simulator

GNS3-gui GNS3 GUI repository.

GNS3 1.7k Dec 29, 2022
Automatically block traffic on Cloudflare's side based on Nginx Log parsing.

AutoRL This is a PoC of automatically block traffic on Cloudflare's side based on Nginx Log parsing. It will evaluate Nginx access.log and find potent

Nova Kwok 62 Dec 28, 2022
D-dos attack GUI tool written in python using tkinter module

ddos D-dos attack GUI tool written in python using tkinter module #to use this tool on android, do the following on termux. *. apt update *. apt upgra

6 Feb 05, 2022
A simple multi-threaded time server and client in python.

time-server-client A simple multi-threaded time server and client in Python. This uses the latest match/case command found in Python 3.10 so requires

Zeeshan Mulk 1 Jan 29, 2022
A simple tool to get information about IP

IP Info Tool Just a simple tool to get IP's information, it uses requests module to gather information about IP, if you dont have much knowledge about

0 Dec 01, 2021
NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.

NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.

NetworkX 12k Jan 02, 2023
snappi-trex is a snappi plugin that allows executing scripts written using snappi with Cisco's TRex Traffic Generator

snappi-trex snappi-trex is a snappi plugin that allows executing scripts written using snappi with Cisco's TRex Traffic Generator Design snappi-trex c

Open Traffic Generator 14 Sep 07, 2022
Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Cybersecurity and Infrastructure Security Agency 1.3k Jan 08, 2023