session

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles multiple sessions from a single listener.

func NewManager

func NewManager(listener net.Listener) *Manager

NewManager creates a session manager for the given listener.

func (*Manager) Accept

func (m *Manager) Accept(timeout time.Duration) (*Session, error)

Accept blocks until a new session arrives or the timeout expires. A zero timeout blocks indefinitely.

func (*Manager) Close

func (m *Manager) Close()

Close shuts down the manager and all sessions.

func (*Manager) Get

func (m *Manager) Get(id int) (*Session, error)

Get returns a session by ID.

func (*Manager) Interact

func (m *Manager) Interact(id int) error

Interact enters interactive mode for a session.

func (*Manager) Kill

func (m *Manager) Kill(id int) error

Kill terminates a session by ID.

func (*Manager) List

func (m *Manager) List() []*Session

List returns all alive sessions sorted by ID.

func (*Manager) Start

func (m *Manager) Start()

Start spawns the background accept loop.

type Session

type Session struct {
	ID         int
	Conn       net.Conn
	RemoteAddr string
	CreatedAt  time.Time
	// contains filtered or unexported fields
}

Session wraps a single reverse shell connection.

func (*Session) Alive

func (s *Session) Alive() bool

Alive reports whether the session is still open.

func (*Session) Close

func (s *Session) Close()

Close terminates the session.

func (*Session) Interact

func (s *Session) Interact()

Interact takes over stdin/stdout for interactive shell access. Ctrl+Z (SIGTSTP) backgrounds the session and returns.

func (*Session) InteractTUI added in v0.3.0

func (s *Session) InteractTUI()

Interact takes over stdin/stdout for interactive shell access. Ctrl+Z (SIGTSTP) backgrounds the session and returns. InteractTUI is like Interact but clears the screen first (used when resuming from TUI).

func (*Session) SetAlive

func (s *Session) SetAlive(v bool)

SetAlive sets the alive state. Used by backends that don't use net.Conn.

Jump to

Keyboard shortcuts

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