Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteFacadeServer(token string)
- func MockDNSServer(ctx context.Context, rootDomain string, port int, ...) string
- func MockDNSServerDefault(domain string, h func(record string, domain string) string) string
- func MockDNSServerEx(ctx context.Context, noTcp, noUdp bool, rootDomain string, port int, ...) string
- func MockTCPDNSServerDefault(domain string, h func(record string, domain string) string) string
- func RegisterFacadeServer(ctx context.Context, token string, server *FacadeServer)
- func Serve(host string, port int, configs ...FacadeServerConfig) error
- type DNSServer
- type FacadeCallback
- type FacadeConnectionHandler
- type FacadeResourceType
- type FacadeServer
- func (f *FacadeServer) CancelServe()
- func (f *FacadeServer) Config(configs ...FacadeServerConfig)
- func (F *FacadeServer) ConvertRemoteAddr(addr string) string
- func (f *FacadeServer) GetAddr() string
- func (f *FacadeServer) GetAllResourcesInfo() []*ResourcesInfo
- func (f *FacadeServer) OnHandle(h func(n *Notification))
- func (f *FacadeServer) RemoveHTTPResource(pattern string)
- func (f *FacadeServer) SaveHttpRoute(pattern string, resource *HttpResource)
- func (f *FacadeServer) Serve() error
- func (f *FacadeServer) ServeWithContext(ctx context.Context) error
- func (f *FacadeServer) SetHttpRawResource(pattern string, resource []byte)
- func (f *FacadeServer) SetRawResourceEx(pattern string, resource []byte, disableNotify bool)
- func (f *FacadeServer) SetResource(protocol string, name string, token string, resource any) error
- type FacadeServerConfig
- func SetHttpResource(name string, resource []byte) FacadeServerConfig
- func SetJavaClassName(name string) FacadeServerConfig
- func SetJavaCodeBase(codeBase string) FacadeServerConfig
- func SetLdapResourceAddr(name string, addr string) FacadeServerConfig
- func SetLdapResponseEntry(token string, data map[string]any, verbose string) FacadeServerConfig
- func SetObjectClass(obj string) FacadeServerConfig
- func SetReverseAddress(address string) FacadeServerConfig
- func SetRmiResource(name string, resource []byte, verbose string) FacadeServerConfig
- func SetRmiResourceAddr(name string, rmiResourceAddr string) FacadeServerConfig
- func SetjavaFactory(factory string) FacadeServerConfig
- type FacadeServerResource
- func (f *FacadeServerResource[T]) DeleteResource(token string)
- func (f *FacadeServerResource[T]) ForEachResource(fun func(token string, resource T, verbose string) error) error
- func (f *FacadeServerResource[T]) GetResource(token string) (T, string, bool)
- func (f *FacadeServerResource[T]) SetResource(token string, data T, verbose string)
- type FactoryFun
- type HttpResource
- type HttpResourceType
- type Notification
- type PortListener
- type ResourcesInfo
- type VisitorLog
Constants ¶
View Source
const ( LDAPMsgFlag = "ldap_flag" RMIMsgFlag = "rmi" RMIHandshakeMsgFlag = "rmi-handshake" )
View Source
const ( FileResponseHeader = `` /* 140-byte string literal not displayed */ BodyResponseHeader = `HTTP/1.1 200 OK Connection: close Accept-Ranges: bytes Content-Encoding: identity Content-Length: 0 ` )
Variables ¶
View Source
var FacadesExports = map[string]interface{}{ "NewFacadeServer": NewFacadeServer, "Serve": Serve, "javaClassName": SetJavaClassName, "javaCodeBase": SetJavaCodeBase, "objectClass": SetObjectClass, "javaFactory": SetjavaFactory, "httpResource": SetHttpResource, "ldapResourceAddr": SetLdapResourceAddr, "rmiResourceAddr": SetRmiResourceAddr, "evilClassResource": SetRmiResourceAddr, }
Functions ¶
func DeleteFacadeServer ¶ added in v1.3.2
func DeleteFacadeServer(token string)
func MockDNSServer ¶ added in v1.2.4
func MockDNSServerDefault ¶ added in v1.2.4
func MockDNSServerEx ¶ added in v1.2.4
func MockTCPDNSServerDefault ¶ added in v1.2.4
func RegisterFacadeServer ¶ added in v1.3.2
func RegisterFacadeServer(ctx context.Context, token string, server *FacadeServer)
Types ¶
type DNSServer ¶
type DNSServer struct {
// contains filtered or unexported fields
}
func NewDNSServer ¶
func (*DNSServer) SetAddrConvertor ¶
func (*DNSServer) SetCallback ¶
func (d *DNSServer) SetCallback(f FacadeCallback)
type FacadeCallback ¶
type FacadeCallback func(i *VisitorLog)
type FacadeConnectionHandler ¶
type FacadeConnectionHandler func(conn *utils.BufferedPeekableConn) error
type FacadeResourceType ¶ added in v1.3.2
type FacadeResourceType interface { []byte | map[string]any | *HttpResource }
type FacadeServer ¶
type FacadeServer struct { Host string Port int ExternalHost string //反连地址 ReverseAddr string RemoteAddrConvertorHandler func(string) string // contains filtered or unexported fields }
func GetFacadeServer ¶ added in v1.3.2
func GetFacadeServer(token string) *FacadeServer
func NewFacadeServer ¶
func NewFacadeServer(host string, port int, configs ...FacadeServerConfig) *FacadeServer
func (*FacadeServer) CancelServe ¶ added in v1.3.2
func (f *FacadeServer) CancelServe()
func (*FacadeServer) Config ¶
func (f *FacadeServer) Config(configs ...FacadeServerConfig)
func (*FacadeServer) ConvertRemoteAddr ¶
func (F *FacadeServer) ConvertRemoteAddr(addr string) string
func (*FacadeServer) GetAddr ¶
func (f *FacadeServer) GetAddr() string
func (*FacadeServer) GetAllResourcesInfo ¶ added in v1.3.2
func (f *FacadeServer) GetAllResourcesInfo() []*ResourcesInfo
func (*FacadeServer) OnHandle ¶
func (f *FacadeServer) OnHandle(h func(n *Notification))
func (*FacadeServer) RemoveHTTPResource ¶
func (f *FacadeServer) RemoveHTTPResource(pattern string)
func (*FacadeServer) SaveHttpRoute ¶
func (f *FacadeServer) SaveHttpRoute(pattern string, resource *HttpResource)
如果路由已经存在,则覆盖原有的路由
func (*FacadeServer) Serve ¶
func (f *FacadeServer) Serve() error
func (*FacadeServer) ServeWithContext ¶
func (f *FacadeServer) ServeWithContext(ctx context.Context) error
func (*FacadeServer) SetHttpRawResource ¶ added in v1.3.2
func (f *FacadeServer) SetHttpRawResource(pattern string, resource []byte)
func (*FacadeServer) SetRawResourceEx ¶
func (f *FacadeServer) SetRawResourceEx(pattern string, resource []byte, disableNotify bool)
func (*FacadeServer) SetResource ¶ added in v1.3.2
type FacadeServerConfig ¶
type FacadeServerConfig func(f *FacadeServer)
func SetHttpResource ¶
func SetHttpResource(name string, resource []byte) FacadeServerConfig
func SetJavaClassName ¶
func SetJavaClassName(name string) FacadeServerConfig
func SetJavaCodeBase ¶
func SetJavaCodeBase(codeBase string) FacadeServerConfig
func SetLdapResourceAddr ¶
func SetLdapResourceAddr(name string, addr string) FacadeServerConfig
func SetLdapResponseEntry ¶ added in v1.3.2
func SetLdapResponseEntry(token string, data map[string]any, verbose string) FacadeServerConfig
func SetObjectClass ¶
func SetObjectClass(obj string) FacadeServerConfig
func SetReverseAddress ¶
func SetReverseAddress(address string) FacadeServerConfig
func SetRmiResource ¶ added in v1.3.2
func SetRmiResource(name string, resource []byte, verbose string) FacadeServerConfig
func SetRmiResourceAddr ¶
func SetRmiResourceAddr(name string, rmiResourceAddr string) FacadeServerConfig
func SetjavaFactory ¶
func SetjavaFactory(factory string) FacadeServerConfig
type FacadeServerResource ¶ added in v1.3.2
type FacadeServerResource[T FacadeResourceType] struct { Resources map[string]*resourceAndVerbose[T] // contains filtered or unexported fields }
func NewFacadeServerResource ¶ added in v1.3.2
func NewFacadeServerResource[T FacadeResourceType]() *FacadeServerResource[T]
func (*FacadeServerResource[T]) DeleteResource ¶ added in v1.3.2
func (f *FacadeServerResource[T]) DeleteResource(token string)
func (*FacadeServerResource[T]) ForEachResource ¶ added in v1.3.2
func (f *FacadeServerResource[T]) ForEachResource(fun func(token string, resource T, verbose string) error) error
func (*FacadeServerResource[T]) GetResource ¶ added in v1.3.2
func (f *FacadeServerResource[T]) GetResource(token string) (T, string, bool)
func (*FacadeServerResource[T]) SetResource ¶ added in v1.3.2
func (f *FacadeServerResource[T]) SetResource(token string, data T, verbose string)
type FactoryFun ¶
type FactoryFun func() string
type HttpResource ¶
type HttpResource struct {
// contains filtered or unexported fields
}
func NewHttpFileResource ¶ added in v1.3.2
func NewHttpFileResource(data []byte) *HttpResource
func NewHttpRawResource ¶ added in v1.3.2
func NewHttpRawResource(data []byte) *HttpResource
type HttpResourceType ¶
type HttpResourceType string
var HttpRoutes sync.Map
const ( HttpResourceType_File HttpResourceType = "file" HttpResourceType_Body HttpResourceType = "body" HttpResourceType_Raw HttpResourceType = "raw" )
type Notification ¶
type Notification struct { // dns // http/s // rmi Type string `json:"type"` RemoteAddr string `json:"remote_addr"` Raw []byte `json:"raw"` Token string `json:"token"` Uuid string `json:"uuid"` ResponseInfo string `json:"response_info"` ConnectHash string `json:"connect_hash"` }
func NewNotification ¶
func NewNotification(t string, remoteAddr string, raw []byte, token string) *Notification
func (*Notification) String ¶
func (n *Notification) String() string
type PortListener ¶ added in v1.2.5
type PortListener struct {
AvailablePorts string
}
type ResourcesInfo ¶ added in v1.3.2
type VisitorLog ¶
func NewVisitorLog ¶
func NewVisitorLog(t string) *VisitorLog
func (*VisitorLog) GetDomain ¶
func (v *VisitorLog) GetDomain() string
func (*VisitorLog) Set ¶
func (v *VisitorLog) Set(k string, val interface{})
func (*VisitorLog) SetDNSType ¶
func (v *VisitorLog) SetDNSType(dnsType string)
func (*VisitorLog) SetDomain ¶
func (v *VisitorLog) SetDomain(domain string)
func (*VisitorLog) SetRemoteIP ¶
func (v *VisitorLog) SetRemoteIP(remoteAddr string)
func (*VisitorLog) SetTimestampNow ¶
func (v *VisitorLog) SetTimestampNow()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.