connector

package
v0.0.0-...-1d0e1de Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveConnections map[string]Connection

ActiveConnections Active Connections

View Source
var ActiveTunnels map[string]Tunnel

ActiveTunnels ActiveTunnels

Functions

func CloseAllConnections

func CloseAllConnections(obj Connection)

CloseAllConnections CloseAllConnections

func CreateTunnel

func CreateTunnel(remoteHost string, remotePort string, username string, password string) int

CreateTunnel CreateTunnel

func GetFileSFTP

func GetFileSFTP(conn *sftp.Client, localPath string, remotePath string) bool

GetFileSFTP Send file

func GetFileSMB

func GetFileSMB(session *smb2.Session, localPath string, remotePath string, remoteDisk string) bool

GetFileSMB GetFileSMB

func InitInsecureWinRMShell

func InitInsecureWinRMShell(username string, password string, ipAddress string, port string) (*winrm.Client, error)

InitInsecureWinRMShell InitInsecureWinRMShell

func InitShellWithCertificate

func InitShellWithCertificate(username string, certificate string, hostname string, port string) (*ssh.Client, error)

InitShellWithCertificate Initialize shell with certificate

func InitShellWithPassword

func InitShellWithPassword(username string, password string, hostname string, port string) (*ssh.Client, error)

InitShellWithPassword Initialize shell

func InitWinRMShell

func InitWinRMShell(username string, password string, ipAddress string, port string) (*winrm.Client, error)

InitWinRMShell InitWinRMShell

func OpenSFTPConnection

func OpenSFTPConnection(conn *ssh.Client) *sftp.Client

OpenSFTPConnection Open SFTP connection through active shell

func OpenSMBConnection

func OpenSMBConnection(ipAddress string, username string, password string) (*smb2.Session, error)

OpenSMBConnection OpenSMBConnection

func PutFileSFTP

func PutFileSFTP(conn *sftp.Client, localPath string, remotePath string) bool

PutFileSFTP Send file

func PutFileSMB

func PutFileSMB(session *smb2.Session, localPath string, remotePath string, remoteDisk string) bool

PutFileSMB PutFileSMB

func VerifyAuth

func VerifyAuth(username string, password string, ipAddress string, port string, keyType string) bool

VerifyAuth VerifyAuth

func VerifyInsecureWinRM

func VerifyInsecureWinRM(username string, password string, ipAddress string, port string) bool

VerifyInsecureWinRM VerifyInsecureWinRM

func VerifySSH

func VerifySSH(username string, password string, ipAddress string, port string) bool

VerifySSH VerifySSH

func VerifySSHCertificate

func VerifySSHCertificate(username string, certificate string, ipAddress string, port string) bool

VerifySSHCertificate VerifySSHCertificate

func VerifyWinRM

func VerifyWinRM(username string, password string, ipAddress string, port string) bool

VerifyWinRM VerifyWinRM

Types

type Connection

type Connection struct {
	SSH            *ssh.Client
	SSHSession     *ssh.Client
	SFTP           *sftp.Client
	SMB            *smb2.Session
	WinRM          *winrm.Client
	LastConnection time.Time
	WindowsLetter  string
	WindowsPath    string
	IpAddr         string
	Port           string
	// contains filtered or unexported fields
}

Connection Connection Struct

func GetConnection

func GetConnection(userID string, serverID string, IPAddress string) (*Connection, error)

GetConnection GetConnection

func (*Connection) CreateFileConnection

func (val *Connection) CreateFileConnection(userID string, serverID string, IPAddress string) bool

CreateFileConnection CreateFileConnection

func (*Connection) CreateShell

func (val *Connection) CreateShell(userID string, serverID string, IPAddress string) bool

CreateShell CreateShell

func (*Connection) CreateShellRaw

func (val *Connection) CreateShellRaw(connectionType string, username string, password string, IPAddress string, keyPort string) bool

CreateShellRaw CreateShellRaw

func (Connection) Get

func (val Connection) Get(localPath string, remotePath string) bool

Get Get

func (Connection) Put

func (val Connection) Put(localPath string, remotePath string) bool

Put Put

func (Connection) Run

func (val Connection) Run(command string) string

Run Run through ssh

type Tunnel

type Tunnel struct {
	Tunnel         *tunnel
	Port           int
	LastConnection time.Time
}

Tunnel Tunnel Struct

Jump to

Keyboard shortcuts

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