All Projects → reiver → Go Telnet

reiver / Go Telnet

Licence: mit
Package telnet provides TELNET and TELNETS client and server implementations, for the Go programming language, in a style similar to the "net/http" library that is part of the Go standard library, including support for "middleware"; TELNETS is secure TELNET, with the TELNET protocol over a secured TLS (or SSL) connection.

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Go Telnet

Remotedebug
Library for Arduino to debug projects over WiFi, with web app or telnet, with print commands like Serial Monitor
Stars: ✭ 467 (+190.06%)
Mutual labels:  telnet
Fqterm
Stars: ✭ 50 (-68.94%)
Mutual labels:  telnet
Hisilicon Dvr Telnet
PoC materials for article https://habr.com/en/post/486856/
Stars: ✭ 101 (-37.27%)
Mutual labels:  telnet
Simpleremote
Remote Administration Tools
Stars: ✭ 504 (+213.04%)
Mutual labels:  telnet
Gensio
A library to abstract stream I/O like serial port, TCP, telnet, UDP, SSL, IPMI SOL, etc.
Stars: ✭ 30 (-81.37%)
Mutual labels:  telnet
Esp32 Ov7670 Hacking
Based on https://github.com/igrr/esp32-cam-demo extended with an ILI9341 display, with a Telnet interface to change OV7670 settings on the fly. Streams BMP files from RGB565 and YUV422 (encoded to RGB565) picture formats. Compile with latest esp-idf. Check out new telnet command "video 1" to auto capture to LCD as fast as possible for videocam mode, "video 0" to stop or "video Z" where Z is delay in ms between each capture / LCD refresh.
Stars: ✭ 55 (-65.84%)
Mutual labels:  telnet
Honeypot
Low interaction honeypot that displays real time attacks
Stars: ✭ 348 (+116.15%)
Mutual labels:  telnet
Eve Ng Integration
integrates EVE-NG (aka UNetLab) with Linux desktop
Stars: ✭ 143 (-11.18%)
Mutual labels:  telnet
Terminals
Terminals is a secure, multi tab terminal services/remote desktop client. It uses Terminal Services ActiveX Client (mstscax.dll). The project started from the need of controlling multiple connections simultaneously. It is a complete replacement for the mstsc.exe (Terminal Services) client. This is official source moved from Codeplex.
Stars: ✭ 971 (+503.11%)
Mutual labels:  telnet
Guacamole
Guacamole是无客户端的远程桌面网关。它支持VNC,RDP和SSH等标准协议。 我们称之为无客户端,因为不需要插件或客户端软件。 感谢HTML5,一旦Guacamole安装在服务器上,您访问桌面所需的全部功能就是一个Web浏览器。
Stars: ✭ 99 (-38.51%)
Mutual labels:  telnet
Pyptt
支援 PTT 還有 PTT2 的 PTT API
Stars: ✭ 527 (+227.33%)
Mutual labels:  telnet
Teleport
Teleport是一款简单易用的堡垒机系统。
Stars: ✭ 718 (+345.96%)
Mutual labels:  telnet
Nyancat
Nyancat in your terminal, rendered through ANSI escape sequences. This is the source for the Debian package `nyancat`.
Stars: ✭ 1,144 (+610.56%)
Mutual labels:  telnet
Sshwifty
Web SSH & Telnet (WebSSH & WebTelnet client) 🔮
Stars: ✭ 501 (+211.18%)
Mutual labels:  telnet
Ts3 Nodejs Library
TeamSpeak 3 Server Query Library supports SSH and RAW Query
Stars: ✭ 110 (-31.68%)
Mutual labels:  telnet
Cowrie
Cowrie SSH/Telnet Honeypot https://cowrie.readthedocs.io
Stars: ✭ 3,810 (+2266.46%)
Mutual labels:  telnet
Currymud
A Multi-User Dungeon server in Haskell.
Stars: ✭ 54 (-66.46%)
Mutual labels:  telnet
Hontel
Telnet Honeypot
Stars: ✭ 145 (-9.94%)
Mutual labels:  telnet
Print My Shell
Python script wrote to automate the process of generating various reverse shells.
Stars: ✭ 140 (-13.04%)
Mutual labels:  telnet
Docker Cowrie
Cowrie Docker GitHub repository
Stars: ✭ 68 (-57.76%)
Mutual labels:  telnet

go-telnet

Package telnet provides TELNET and TELNETS client and server implementations, for the Go programming language.

The telnet package provides an API in a style similar to the "net/http" library that is part of the Go standard library, including support for "middleware".

(TELNETS is secure TELNET, with the TELNET protocol over a secured TLS (or SSL) connection.)

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-telnet

GoDoc

Very Simple TELNET Server Example

A very very simple TELNET server is shown in the following code.

This particular TELNET server just echos back to the user anything they "submit" to the server.

(By default, a TELNET client does not send anything to the server until the [Enter] key is pressed. "Submit" means typing something and then pressing the [Enter] key.)

package main

import (
	"github.com/reiver/go-telnet"
)

func main() {

	var handler telnet.Handler = telnet.EchoHandler
	
	err := telnet.ListenAndServe(":5555", handler)
	if nil != err {
		//@TODO: Handle this error better.
		panic(err)
	}
}

If you wanted to test out this very very simple TELNET server, if you were on the same computer it was running, you could connect to it using the bash command:

telnet localhost 5555

(Note that we use the same TCP port number -- "5555" -- as we had in our code. That is important, as the value used by your TELNET server and the value used by your TELNET client must match.)

Very Simple (Secure) TELNETS Server Example

TELNETS is the secure version of TELNET.

The code to make a TELNETS server is very similar to the code to make a TELNET server. (The difference between we use the telnet.ListenAndServeTLS func instead of the telnet.ListenAndServe func.)

package main

import (
	"github.com/reiver/go-telnet"
)

func main() {

	var handler telnet.Handler = telnet.EchoHandler
	
	err := telnet.ListenAndServeTLS(":5555", "cert.pem", "key.pem", handler)
	if nil != err {
		//@TODO: Handle this error better.
		panic(err)
	}
}

If you wanted to test out this very very simple TELNETS server, get the telnets client program from here: https://github.com/reiver/telnets

TELNET Client Example:

package main

import (
	"github.com/reiver/go-telnet"
)

func main() {
	var caller telnet.Caller = telnet.StandardCaller

	//@TOOD: replace "example.net:5555" with address you want to connect to.
	telnet.DialToAndCall("example.net:5555", caller)
}

TELNETS Client Example:

package main

import (
	"github.com/reiver/go-telnet"

	"crypto/tls"
)

func main() {
	//@TODO: Configure the TLS connection here, if you need to.
	tlsConfig := &tls.Config{}

	var caller telnet.Caller = telnet.StandardCaller

	//@TOOD: replace "example.net:5555" with address you want to connect to.
	telnet.DialToAndCallTLS("example.net:5555", caller, tlsConfig)
}

TELNET Shell Server Example

A more useful TELNET servers can be made using the "github.com/reiver/go-telnet/telsh" sub-package.

For example:

package main


import (
	"github.com/reiver/go-oi"
	"github.com/reiver/go-telnet"
	"github.com/reiver/go-telnet/telsh"

	"io"
	"time"
)



func fiveHandler(stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser, args ...string) error {
	oi.LongWriteString(stdout, "The number FIVE looks like this: 5\r\n")

	return nil
}

func fiveProducer(ctx telnet.Context, name string, args ...string) telsh.Handler{
	return telsh.PromoteHandlerFunc(fiveHandler)
}



func danceHandler(stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser, args ...string) error {
	for i:=0; i<20; i++ {
		oi.LongWriteString(stdout, "\r⠋")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠙")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠹")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠸")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠼")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠴")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠦")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠧")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠇")
		time.Sleep(50*time.Millisecond)

		oi.LongWriteString(stdout, "\r⠏")
		time.Sleep(50*time.Millisecond)
	}
	oi.LongWriteString(stdout, "\r \r\n")

	return nil
}

func danceProducer(ctx telnet.Context, name string, args ...string) telsh.Handler{

	return telsh.PromoteHandlerFunc(danceHandler)
}


func main() {

	shellHandler := telsh.NewShellHandler()

	shellHandler.WelcomeMessage = `
 __          __ ______  _        _____   ____   __  __  ______ 
 \ \        / /|  ____|| |      / ____| / __ \ |  \/  ||  ____|
  \ \  /\  / / | |__   | |     | |     | |  | || \  / || |__   
   \ \/  \/ /  |  __|  | |     | |     | |  | || |\/| ||  __|  
    \  /\  /   | |____ | |____ | |____ | |__| || |  | || |____ 
     \/  \/    |______||______| \_____| \____/ |_|  |_||______|

`


	// Register the "five" command.
	commandName     := "five"
	commandProducer := telsh.ProducerFunc(fiveProducer)

	shellHandler.Register(commandName, commandProducer)



	// Register the "dance" command.
	commandName      = "dance"
	commandProducer  = telsh.ProducerFunc(danceProducer)

	shellHandler.Register(commandName, commandProducer)



	shellHandler.Register("dance", telsh.ProducerFunc(danceProducer))

	addr := ":5555"
	if err := telnet.ListenAndServe(addr, shellHandler); nil != err {
		panic(err)
	}
}

TELNET servers made using the "github.com/reiver/go-telnet/telsh" sub-package will often be more useful as it makes it easier for you to create a shell interface.

More Information

There is a lot more information about documentation on all this here: http://godoc.org/github.com/reiver/go-telnet

(You should really read those.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].