Documentation ¶
Index ¶
- Constants
- func Close(closable io.Closer)
- func DecryptContent(rawContent []byte) ([]byte, error)
- func GetICMPData(conn net.PacketConn) ([]byte, icmp.Type, net.Addr, error)
- func ICMPDataReceived(conn net.PacketConn, target net.IP, sentData []byte) error
- func ListenICMP(listenAddress string) (net.PacketConn, error)
- func SendICMPData(conn net.PacketConn, target net.Addr, data []byte) (time.Time, error)
- func ValidateICMPPacket(srcAddr net.Addr, dstIP net.IP) error
- func XorEncryptDecryptBytes(input, key []byte) (output []byte)
- type IncompleteSendError
- type NoMagicError
- type WrongICMPTypeError
- type WrongReplyCommandError
- type WrongReplyIPError
Constants ¶
View Source
const ( ProtocolICMP = 1 // from golang.org/x/net/internal/iana, can't import Golang internal packages ErrNoMagic = NoMagicError("packet does not contain magic") ErrWrongICMPType = WrongICMPTypeError("packet has unexpected ICMP type") )
Variables ¶
This section is empty.
Functions ¶
func Close ¶
Utiliy to close an object that implements the `io.Closer` interface. Used over `object.Close()` for automatic error checking.
func DecryptContent ¶
func GetICMPData ¶
Returns the decrypted message (C2 command) contained in the ICMP request.
func ICMPDataReceived ¶
Ensure we receive an Echo Reply to confirm that the data has been received on the other end.
Returns an error if data could not be received or if an error occurred while processing the Echo Reply. Otherwise, nil.
func ListenICMP ¶
func ListenICMP(listenAddress string) (net.PacketConn, error)
Creates and returns an ICMP connection to read from and write to.
func SendICMPData ¶
Send a command to the target.
Resource: Simple utility package to send ICMP pings with Go - https://gist.github.com/lmas/c13d1c9de3b2224f9c26435eb56e6ef3
func XorEncryptDecryptBytes ¶
Types ¶
type IncompleteSendError ¶
func (IncompleteSendError) Error ¶
func (e IncompleteSendError) Error() string
type NoMagicError ¶
type NoMagicError string
func (NoMagicError) Error ¶
func (e NoMagicError) Error() string
type WrongICMPTypeError ¶
type WrongICMPTypeError string
func (WrongICMPTypeError) Error ¶
func (e WrongICMPTypeError) Error() string
type WrongReplyCommandError ¶
func (WrongReplyCommandError) Error ¶
func (e WrongReplyCommandError) Error() string
type WrongReplyIPError ¶
func (WrongReplyIPError) Error ¶
func (e WrongReplyIPError) Error() string
Click to show internal directories.
Click to hide internal directories.