Documentation ¶
Index ¶
- Constants
- Variables
- 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 Serve(host string, port int, configs ...FacadeServerConfig) error
- type DNSServer
- type FacadeCallback
- type FacadeConnectionHandler
- type FacadeServer
- func (f *FacadeServer) AddFileResource(pattern string, resource []byte)
- func (f *FacadeServer) AddHttpRoute(pattern string, rsc *HttpResource)
- func (f *FacadeServer) Config(configs ...FacadeServerConfig)
- func (F *FacadeServer) ConvertRemoteAddr(addr string) string
- func (f *FacadeServer) GetAddr() string
- func (f *FacadeServer) GetHTTPHandler(isHttps bool) FacadeConnectionHandler
- func (f *FacadeServer) OnHandle(h func(n *Notification))
- func (f *FacadeServer) OverwriteFileResource(pattern string, resource []byte)
- 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) SetRawResource(pattern string, resource []byte)
- func (f *FacadeServer) SetRawResourceEx(pattern string, resource []byte, disableNotify bool)
- 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 SetObjectClass(obj string) FacadeServerConfig
- func SetReverseAddress(address string) FacadeServerConfig
- func SetRmiResourceAddr(name string, rmiResourceAddr string) FacadeServerConfig
- func SetjavaFactory(factory string) FacadeServerConfig
- type FactoryFun
- type HttpResource
- type HttpResourceType
- type Notification
- type PortListener
- type VisitorLog
Constants ¶
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 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
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 FacadeServer ¶
type FacadeServer struct { Host string Port int ExternalHost string //反连地址 ReverseAddr string RemoteAddrConvertorHandler func(string) string // contains filtered or unexported fields }
func NewFacadeServer ¶
func NewFacadeServer(host string, port int, configs ...FacadeServerConfig) *FacadeServer
func (*FacadeServer) AddFileResource ¶
func (f *FacadeServer) AddFileResource(pattern string, resource []byte)
func (*FacadeServer) AddHttpRoute ¶
func (f *FacadeServer) AddHttpRoute(pattern string, rsc *HttpResource)
如果路由已存在,则跳过
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) GetHTTPHandler ¶
func (f *FacadeServer) GetHTTPHandler(isHttps bool) FacadeConnectionHandler
func (*FacadeServer) OnHandle ¶
func (f *FacadeServer) OnHandle(h func(n *Notification))
func (*FacadeServer) OverwriteFileResource ¶
func (f *FacadeServer) OverwriteFileResource(pattern string, resource []byte)
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) SetRawResource ¶
func (f *FacadeServer) SetRawResource(pattern string, resource []byte)
func (*FacadeServer) SetRawResourceEx ¶
func (f *FacadeServer) SetRawResourceEx(pattern string, resource []byte, disableNotify bool)
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 SetObjectClass ¶
func SetObjectClass(obj string) FacadeServerConfig
func SetReverseAddress ¶
func SetReverseAddress(address string) FacadeServerConfig
func SetRmiResourceAddr ¶
func SetRmiResourceAddr(name string, rmiResourceAddr string) FacadeServerConfig
func SetjavaFactory ¶
func SetjavaFactory(factory string) FacadeServerConfig
type FactoryFun ¶
type FactoryFun func() string
type HttpResource ¶
type HttpResource struct {
// contains filtered or unexported fields
}
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 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.