glutton

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 34 Imported by: 1

README

Glutton

Tests GoDoc

Setup go 1.17. Install required system packages:

apt-get install gcc libpcap-dev iptables

Arch:

pacman -S gcc libpcap iptables

To change your SSH server default port (i.e. 5001, see rules.yaml) and restart SSHD:

sed -i 's/[# ]*Port .*/Port 5001/g' /etc/ssh/sshd_config

Build glutton:

make build

To run/test glutton:

bin/server

Use as Proxy

Glutton provide SSH and a TCP proxy. SSH proxy works as a MITM between attacker and server to log everything in plain text. TCP proxy does not provide facility for logging yet. Examples can be found here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsoleLogger

func NewConsoleLogger(id string) zapcore.Core

NewConsoleLogger creates the console logger fabric

func NewFileLogger

func NewFileLogger(id string) zapcore.Core

NewFileLogger creates a logger instance

func NewLogger

func NewLogger(id string) *zap.Logger

NewLogger creates a logger instance

Types

type DummyLogger

type DummyLogger struct{}

func (DummyLogger) Debug

func (DummyLogger) Debug(args ...interface{})

func (DummyLogger) Debugf

func (DummyLogger) Debugf(format string, args ...interface{})

func (DummyLogger) Error

func (DummyLogger) Error(args ...interface{})

func (DummyLogger) Errorf

func (DummyLogger) Errorf(format string, args ...interface{})

func (DummyLogger) Fatal

func (DummyLogger) Fatal(args ...interface{})

func (DummyLogger) Fatalf

func (DummyLogger) Fatalf(format string, args ...interface{})

func (DummyLogger) Info

func (DummyLogger) Info(args ...interface{})

func (DummyLogger) Infof

func (DummyLogger) Infof(format string, args ...interface{})

func (DummyLogger) Panic

func (DummyLogger) Panic(args ...interface{})

func (DummyLogger) Panicf

func (DummyLogger) Panicf(format string, args ...interface{})

func (DummyLogger) Warn

func (DummyLogger) Warn(args ...interface{})

func (DummyLogger) Warnf

func (DummyLogger) Warnf(format string, args ...interface{})

type Glutton

type Glutton struct {
	Logger *zap.Logger
	Server *Server

	Producer *producer.Producer
	// contains filtered or unexported fields
}

Glutton struct

func New

func New(ctx context.Context) (*Glutton, error)

New creates a new Glutton instance

func (*Glutton) ConnectionByFlow

func (g *Glutton) ConnectionByFlow(ckey [2]uint64) *connection.Metadata

ConnectionByFlow returns connection metadata by connection key

func (*Glutton) Init

func (g *Glutton) Init() error

Init initializes server and handles

func (*Glutton) MetadataByConnection

func (g *Glutton) MetadataByConnection(conn net.Conn) (*connection.Metadata, error)

MetadataByConnection returns connection metadata by connection

func (*Glutton) NewSSHProxy

func (g *Glutton) NewSSHProxy(destinationURL string) error

NewSSHProxy creates a new SSH proxy instance

func (*Glutton) NewTelnetProxy

func (g *Glutton) NewTelnetProxy(destinationURL string) error

NewTelnetProxy Create a new Telnet Proxy Session

func (*Glutton) Produce

func (g *Glutton) Produce(handler string, conn net.Conn, md *connection.Metadata, payload []byte, decoded interface{}) error

func (*Glutton) ProduceUDP

func (g *Glutton) ProduceUDP(handler string, srcAddr, dstAddr *net.UDPAddr, md *connection.Metadata, payload []byte, decoded interface{}) error

func (*Glutton) Shutdown

func (g *Glutton) Shutdown() error

Shutdown the packet processor

func (*Glutton) Start

func (g *Glutton) Start() error

Start the listener, this blocks for new connections

func (*Glutton) UpdateConnectionTimeout

func (g *Glutton) UpdateConnectionTimeout(ctx context.Context, conn net.Conn)

UpdateConnectionTimeout increase connection timeout limit on connection I/O operation

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(tcpPort, udpPort uint) *Server

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Start

func (s *Server) Start() error

Directories

Path Synopsis
rdp
smb

Jump to

Keyboard shortcuts

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