agent

package
v0.0.0-...-05965fc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	TypeHello             int = 0x00
	TypeReadWriteTCP      int = 0x01
	TypeHandshake         int = 0x02
	TypeHandshakeResponse int = 0x03
	TypeEOF               int = 0x04
	TypePing              int = 0x05
	TypeReadWriteUDP      int = 0x06
)

Variables

View Source
var ErrTimeout = &errorTimeout{}

Functions

func Conn2

func Conn2(c net.Conn) *conn2

func New

func New(options ...func(listener.Listener) error) (listener.Listener, error)

New will initialize the agent listener

func Storage

func Storage() (*agentListenerStorage, error)

Types

type Connections

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

func (*Connections) Add

func (c *Connections) Add(ac *agentConnection)

func (*Connections) Delete

func (c *Connections) Delete(ac *agentConnection)

func (*Connections) Each

func (c *Connections) Each(fn func(ac *agentConnection))

func (*Connections) Get

func (c *Connections) Get(laddr net.Addr, raddr net.Addr) *agentConnection

type Decoder

type Decoder struct {
	*protocol.Decoder
}

func NewDecoder

func NewDecoder(data []byte) *Decoder

func (*Decoder) ReadAddr

func (d *Decoder) ReadAddr() net.Addr

func (*Decoder) ReadData

func (d *Decoder) ReadData() []byte

func (*Decoder) ReadString

func (d *Decoder) ReadString() string

type EOF

type EOF struct {
	Laddr net.Addr
	Raddr net.Addr
}

func (EOF) MarshalBinary

func (e EOF) MarshalBinary() ([]byte, error)

func (*EOF) UnmarshalBinary

func (e *EOF) UnmarshalBinary(data []byte) error

type Encoder

type Encoder struct {
	*protocol.Encoder
}

func NewEncoder

func NewEncoder(w io.Writer, bo binary.ByteOrder) *Encoder

func (*Encoder) WriteAddr

func (e *Encoder) WriteAddr(address net.Addr)

func (*Encoder) WriteData

func (e *Encoder) WriteData(data []byte)

func (*Encoder) WriteString

func (e *Encoder) WriteString(s string)

type Handshake

type Handshake struct {
	ProtocolVersion int

	CommitID      string
	ShortCommitID string

	Version string

	Token string
}

func (Handshake) MarshalBinary

func (hs Handshake) MarshalBinary() ([]byte, error)

func (*Handshake) UnmarshalBinary

func (hs *Handshake) UnmarshalBinary(data []byte) error

type HandshakeResponse

type HandshakeResponse struct {
	Addresses []net.Addr
}

func (HandshakeResponse) MarshalBinary

func (h HandshakeResponse) MarshalBinary() ([]byte, error)

func (*HandshakeResponse) UnmarshalBinary

func (h *HandshakeResponse) UnmarshalBinary(data []byte) error

type Hello

type Hello struct {
	Laddr net.Addr
	Raddr net.Addr
}

func (Hello) MarshalBinary

func (h Hello) MarshalBinary() ([]byte, error)

func (*Hello) UnmarshalBinary

func (h *Hello) UnmarshalBinary(data []byte) error

type Ping

type Ping struct {
}

func (Ping) MarshalBinary

func (h Ping) MarshalBinary() ([]byte, error)

func (*Ping) UnmarshalBinary

func (h *Ping) UnmarshalBinary(data []byte) error

type ReadWriteTCP

type ReadWriteTCP struct {
	Laddr net.Addr
	Raddr net.Addr

	Payload []byte
}

func (ReadWriteTCP) MarshalBinary

func (rw ReadWriteTCP) MarshalBinary() ([]byte, error)

func (*ReadWriteTCP) UnmarshalBinary

func (rw *ReadWriteTCP) UnmarshalBinary(data []byte) error

type ReadWriteUDP

type ReadWriteUDP struct {
	Laddr net.Addr
	Raddr net.Addr

	Payload []byte
}

func (ReadWriteUDP) MarshalBinary

func (rwu ReadWriteUDP) MarshalBinary() ([]byte, error)

func (*ReadWriteUDP) UnmarshalBinary

func (rwu *ReadWriteUDP) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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