server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 28 Imported by: 42 modules, 64 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func URLReflection

func URLReflection(URL string) string

URLReflection returns a reversed part of the URL payload which is checked in the response.

Types

type DNSServer

type DNSServer struct {
	TxtRecord string // used for ACME verification
	// contains filtered or unexported fields
}

DNSServer is a DNS server instance that listens on port 53.

func NewDNSServer

func NewDNSServer(network string, options *Options) *DNSServer

NewDNSServer returns a new DNS server.

func (*DNSServer) ListenAndServe

func (h *DNSServer) ListenAndServe(dnsAlive chan bool)

ListenAndServe listens on dns ports for the server.

func (*DNSServer) ServeDNS

func (h *DNSServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS is the default handler for DNS queries.

type DeregisterRequest

type DeregisterRequest struct {
	// CorrelationID is an ID for correlation with requests.
	CorrelationID string `json:"correlation-id"`
	// SecretKey is the secretKey for the interactsh client.
	SecretKey string `json:"secret-key"`
}

DeregisterRequest is a request for client deregistration to interactsh server.

type FTPServer added in v1.0.0

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

FTPServer is a ftp server instance

func NewFTPServer added in v1.0.0

func NewFTPServer(options *Options) (*FTPServer, error)

NewFTPServer returns a new TLS & Non-TLS FTP server.

func (*FTPServer) AfterCurDirChanged added in v1.0.0

func (h *FTPServer) AfterCurDirChanged(ctx *ftpserver.Context, oldCurDir, newCurDir string, err error)

func (*FTPServer) AfterDirCreated added in v1.0.0

func (h *FTPServer) AfterDirCreated(ctx *ftpserver.Context, dstPath string, err error)

func (*FTPServer) AfterDirDeleted added in v1.0.0

func (h *FTPServer) AfterDirDeleted(ctx *ftpserver.Context, dstPath string, err error)

func (*FTPServer) AfterFileDeleted added in v1.0.0

func (h *FTPServer) AfterFileDeleted(ctx *ftpserver.Context, dstPath string, err error)

func (*FTPServer) AfterFileDownloaded added in v1.0.0

func (h *FTPServer) AfterFileDownloaded(ctx *ftpserver.Context, dstPath string, size int64, err error)

func (*FTPServer) AfterFilePut added in v1.0.0

func (h *FTPServer) AfterFilePut(ctx *ftpserver.Context, dstPath string, size int64, err error)

func (*FTPServer) AfterUserLogin added in v1.0.0

func (h *FTPServer) AfterUserLogin(ctx *ftpserver.Context, userName, password string, passMatched bool, err error)

func (*FTPServer) BeforeChangeCurDir added in v1.0.0

func (h *FTPServer) BeforeChangeCurDir(ctx *ftpserver.Context, oldCurDir, newCurDir string)

func (*FTPServer) BeforeCreateDir added in v1.0.0

func (h *FTPServer) BeforeCreateDir(ctx *ftpserver.Context, dstPath string)

func (*FTPServer) BeforeDeleteDir added in v1.0.0

func (h *FTPServer) BeforeDeleteDir(ctx *ftpserver.Context, dstPath string)

func (*FTPServer) BeforeDeleteFile added in v1.0.0

func (h *FTPServer) BeforeDeleteFile(ctx *ftpserver.Context, dstPath string)

func (*FTPServer) BeforeDownloadFile added in v1.0.0

func (h *FTPServer) BeforeDownloadFile(ctx *ftpserver.Context, dstPath string)

func (*FTPServer) BeforeLoginUser added in v1.0.0

func (h *FTPServer) BeforeLoginUser(ctx *ftpserver.Context, userName string)

func (*FTPServer) BeforePutFile added in v1.0.0

func (h *FTPServer) BeforePutFile(ctx *ftpserver.Context, dstPath string)

func (*FTPServer) Close added in v1.0.0

func (h *FTPServer) Close()

func (*FTPServer) ListenAndServe added in v1.0.0

func (h *FTPServer) ListenAndServe(tlsConfig *tls.Config, ftpAlive chan bool)

ListenAndServe listens on smtp and/or smtps ports for the server.

func (*FTPServer) Print added in v1.0.0

func (h *FTPServer) Print(sessionID string, message interface{})

func (*FTPServer) PrintCommand added in v1.0.0

func (h *FTPServer) PrintCommand(sessionID string, command string, params string)

func (*FTPServer) PrintResponse added in v1.0.0

func (h *FTPServer) PrintResponse(sessionID string, code int, message string)

func (*FTPServer) Printf added in v1.0.0

func (h *FTPServer) Printf(sessionID string, format string, v ...interface{})

type HTTPServer

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

HTTPServer is a http server instance that listens both TLS and Non-TLS based servers.

func NewHTTPServer

func NewHTTPServer(options *Options) (*HTTPServer, error)

NewHTTPServer returns a new TLS & Non-TLS HTTP server.

func (*HTTPServer) ListenAndServe

func (h *HTTPServer) ListenAndServe(tlsConfig *tls.Config, httpAlive, httpsAlive chan bool)

ListenAndServe listens on http and/or https ports for the server.

type Interaction

type Interaction struct {
	// Protocol for interaction, can contains HTTP/DNS/SMTP,etc.
	Protocol string `json:"protocol"`
	// UniqueID is the uniqueID for the subdomain receiving the interaction.
	UniqueID string `json:"unique-id"`
	// FullId is the full path for the subdomain receiving the interaction.
	FullId string `json:"full-id"`
	// QType is the question type for the interaction
	QType string `json:"q-type,omitempty"`
	// RawRequest is the raw request received by the interactsh server.
	RawRequest string `json:"raw-request,omitempty"`
	// RawResponse is the raw response sent by the interactsh server.
	RawResponse string `json:"raw-response,omitempty"`
	// SMTPFrom is the mail form field
	SMTPFrom string `json:"smtp-from,omitempty"`
	// RemoteAddress is the remote address for interaction
	RemoteAddress string `json:"remote-address"`
	// Timestamp is the timestamp for the interaction
	Timestamp time.Time `json:"timestamp"`
}

Interaction is an interaction received to the server.

type LDAPServer added in v1.0.0

type LDAPServer struct {
	WithLogger bool
	// contains filtered or unexported fields
}

LDAPServer is a ldap server instance

func NewLDAPServer added in v1.0.0

func NewLDAPServer(options *Options, withLogger bool) (*LDAPServer, error)

NewLDAPServer returns a new LDAP server.

func (*LDAPServer) Close added in v1.0.0

func (ldapServer *LDAPServer) Close() error

func (*LDAPServer) Fatal added in v1.0.0

func (ldapServer *LDAPServer) Fatal(v ...interface{})

func (*LDAPServer) Fatalf added in v1.0.0

func (ldapServer *LDAPServer) Fatalf(format string, v ...interface{})

func (*LDAPServer) Fatalln added in v1.0.0

func (ldapServer *LDAPServer) Fatalln(v ...interface{})

func (*LDAPServer) ListenAndServe added in v1.0.0

func (ldapServer *LDAPServer) ListenAndServe(tlsConfig *tls.Config, ldapAlive chan bool)

ListenAndServe listens on ldap ports for the server.

func (*LDAPServer) Panic added in v1.0.0

func (ldapServer *LDAPServer) Panic(v ...interface{})

func (*LDAPServer) Panicf added in v1.0.0

func (ldapServer *LDAPServer) Panicf(format string, v ...interface{})

func (*LDAPServer) Panicln added in v1.0.0

func (ldapServer *LDAPServer) Panicln(v ...interface{})

func (*LDAPServer) Print added in v1.0.0

func (ldapServer *LDAPServer) Print(v ...interface{})

func (*LDAPServer) Printf added in v1.0.0

func (ldapServer *LDAPServer) Printf(format string, v ...interface{})

func (*LDAPServer) Println added in v1.0.0

func (ldapServer *LDAPServer) Println(v ...interface{})

type NopAuth added in v1.0.0

type NopAuth struct{}

func (*NopAuth) CheckPasswd added in v1.0.0

func (a *NopAuth) CheckPasswd(ctx *ftpserver.Context, name, pass string) (bool, error)

type NopDriver added in v1.0.0

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

func NewNopDriver added in v1.0.0

func NewNopDriver(driver ftpserver.Driver) *NopDriver

func (*NopDriver) DeleteDir added in v1.0.0

func (n *NopDriver) DeleteDir(c *ftpserver.Context, s string) error

func (*NopDriver) DeleteFile added in v1.0.0

func (n *NopDriver) DeleteFile(c *ftpserver.Context, s string) error

func (*NopDriver) GetFile added in v1.0.0

func (n *NopDriver) GetFile(c *ftpserver.Context, s1 string, k int64) (int64, io.ReadCloser, error)

func (*NopDriver) ListDir added in v1.0.0

func (n *NopDriver) ListDir(c *ftpserver.Context, s string, f func(os.FileInfo) error) error

func (*NopDriver) MakeDir added in v1.0.0

func (n *NopDriver) MakeDir(c *ftpserver.Context, s string) error

func (*NopDriver) PutFile added in v1.0.0

func (n *NopDriver) PutFile(c *ftpserver.Context, s string, r io.Reader, k int64) (int64, error)

func (*NopDriver) Rename added in v1.0.0

func (n *NopDriver) Rename(c *ftpserver.Context, s1 string, s2 string) error

func (*NopDriver) Stat added in v1.0.0

func (n *NopDriver) Stat(c *ftpserver.Context, s string) (os.FileInfo, error)

type Options

type Options struct {
	// Domain is the domain for the instance.
	Domain string
	// IPAddress is the IP address of the current server.
	IPAddress string
	// ListenIP is the IP address to listen servers on
	ListenIP string
	// DomainPort is the port to listen DNS servers on
	DnsPort int
	// HttpPort is the port to listen HTTP server on
	HttpPort int
	// HttpsPort is the port to listen HTTPS server on
	HttpsPort int
	// SmbPort is the port to listen Smb server on
	SmbPort int
	// SmtpPort is the port to listen Smtp server on
	SmtpPort int
	// SmtpsPort is the port to listen Smtps server on
	SmtpsPort int
	// SmtpAutoTLSPort is the port to listen Smtp autoTLS server on
	SmtpAutoTLSPort int
	// FtpPort is the port to listen Ftp server on
	FtpPort int
	// FtpPort is the port to listen Ftp server on
	LdapPort int
	// Hostmaster is the hostmaster email for the server.
	Hostmaster string
	// Storage is a storage for interaction data storage
	Storage *storage.Storage
	// Auth requires client to authenticate
	Auth bool
	// Token required to retrieve interactions
	Token string
	// Enable root tld interactions
	RootTLD bool
	// OriginURL for the HTTP Server
	OriginURL string
	// FTPDirectory or temporary one
	FTPDirectory string

	ACMEStore *acme.Provider
}

Options contains configuration options for the servers

type PollResponse

type PollResponse struct {
	Data    []string `json:"data"`
	Extra   []string `json:"extra"`
	AESKey  string   `json:"aes_key"`
	TLDData []string `json:"tlddata,omitempty"`
}

PollResponse is the response for a polling request

type RegisterRequest

type RegisterRequest struct {
	// PublicKey is the public RSA Key of the client.
	PublicKey string `json:"public-key"`
	// SecretKey is the secret-key for correlation ID registered for the client.
	SecretKey string `json:"secret-key"`
	// CorrelationID is an ID for correlation with requests.
	CorrelationID string `json:"correlation-id"`
}

RegisterRequest is a request for client registration to interactsh server.

type ResponderServer added in v0.0.5

type ResponderServer struct {
	LogFile string
	// contains filtered or unexported fields
}

ResponderServer is a Responder wrapper server instance

func NewResponderServer added in v0.0.5

func NewResponderServer(options *Options) (*ResponderServer, error)

NewResponderServer returns a new SMB server.

func (*ResponderServer) Close added in v0.0.5

func (h *ResponderServer) Close()

func (*ResponderServer) ListenAndServe added in v0.0.5

func (h *ResponderServer) ListenAndServe(responderAlive chan bool) error

ListenAndServe listens on various responder ports

type SMBServer added in v0.0.5

type SMBServer struct {
	LogFile string
	// contains filtered or unexported fields
}

SMBServer is a smb wrapper server instance

func NewSMBServer added in v0.0.5

func NewSMBServer(options *Options) (*SMBServer, error)

NewSMBServer returns a new SMB server.

func (*SMBServer) Close added in v0.0.5

func (h *SMBServer) Close()

func (*SMBServer) ListenAndServe added in v0.0.5

func (h *SMBServer) ListenAndServe(smbAlive chan bool) error

ListenAndServe listens on smb port

type SMTPServer

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

SMTPServer is a smtp server instance that listens both TLS and Non-TLS based servers.

func NewSMTPServer

func NewSMTPServer(options *Options) (*SMTPServer, error)

NewSMTPServer returns a new TLS & Non-TLS SMTP server.

func (*SMTPServer) ListenAndServe

func (h *SMTPServer) ListenAndServe(tlsConfig *tls.Config, smtpAlive, smtpsAlive chan bool)

ListenAndServe listens on smtp and/or smtps ports for the server.

Directories

Path Synopsis
Taken from https://github.com/chinzhiweiblank/coredns-acme/blob/e0cdfbdd78adfcc6c2d098255902f64ec60daecb/provider.go Copyright @chinzhiweiblank under Apache License 2.0
Taken from https://github.com/chinzhiweiblank/coredns-acme/blob/e0cdfbdd78adfcc6c2d098255902f64ec60daecb/provider.go Copyright @chinzhiweiblank under Apache License 2.0

Jump to

Keyboard shortcuts

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