sshproxy

package module
v0.0.0-...-9b3ed8f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2017 License: MIT Imports: 8 Imported by: 1

README

sshproxy

Golang library to proxy ssh connections

Why

I'm using this library in a honeypot, using this library I can intercept the ssh connections and connect each connection to their own container. Sessions can be recorder using the TypeWriterReadCloser.

Use cases

  • capture the flag
  • honeypots
  • creating screencasts
  • whatever you'd like

Example

go run examples/main.go --dest 172.16.84.182:22 --key examples/conf/id_rsa

Screencast of recorded session:

http://jsfiddle.net/qorz0any/1/

Contributions

Contributions are welcome.

Creators

Remco Verhoef

Code and documentation copyright 2011-2014 Remco Verhoef.

Code released under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(addr string, serverConfig *ssh.ServerConfig,
	callbackFn func(c ssh.ConnMetadata) (*ssh.Client, error),
	wrapFn func(c ssh.ConnMetadata, r io.ReadCloser) (io.ReadCloser, error),
	closeFn func(c ssh.ConnMetadata) error,
) error

func NewLogReadCloser

func NewLogReadCloser(r io.ReadCloser) io.ReadCloser

func NewTypeWriterReadCloser

func NewTypeWriterReadCloser(r io.ReadCloser) io.ReadCloser

Types

type LogReadCloser

type LogReadCloser struct {
	io.ReadCloser
}

func (*LogReadCloser) Close

func (lr *LogReadCloser) Close() error

func (*LogReadCloser) Read

func (lr *LogReadCloser) Read(p []byte) (n int, err error)

type SshConn

type SshConn struct {
	net.Conn
	// contains filtered or unexported fields
}

type TypeWriterReadCloser

type TypeWriterReadCloser struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

func (*TypeWriterReadCloser) Close

func (lr *TypeWriterReadCloser) Close() error

func (*TypeWriterReadCloser) Read

func (lr *TypeWriterReadCloser) Read(p []byte) (n int, err error)

func (*TypeWriterReadCloser) String

func (lr *TypeWriterReadCloser) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL