Documentation ¶
Overview ¶
Package packets contains structure declarations for network packets and the main packets queue.
Index ¶
- Constants
- Variables
- func DHCP6EncodeList(elements []string) (encoded []byte)
- func DHCP6For(what dhcp6.MessageType, to dhcp6.Packet, duid []byte) (err error, p dhcp6.Packet)
- func Dot11Info(id layers.Dot11InformationElementID, info []byte) *layers.Dot11InformationElement
- func Dot11InformationElementIDDSSetDecode(buf []byte) (channel int, err error)
- func Dot11IsDataFor(dot11 *layers.Dot11, station net.HardwareAddr) bool
- func Dot11Parse(packet gopacket.Packet) (ok bool, radiotap *layers.RadioTap, dot11 *layers.Dot11)
- func Dot11ParseDSSet(packet gopacket.Packet) (bool, int)
- func Dot11ParseEncryption(packet gopacket.Packet, dot11 *layers.Dot11) (bool, string, string, string)
- func Dot11ParseIDSSID(packet gopacket.Packet) (bool, string)
- func NewARP(from net.IP, from_hw net.HardwareAddr, to net.IP, req uint16) (layers.Ethernet, layers.ARP)
- func NewARPReply(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr) (error, []byte)
- func NewARPRequest(from net.IP, from_hw net.HardwareAddr, to net.IP) (error, []byte)
- func NewARPTo(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr, ...) (layers.Ethernet, layers.ARP)
- func NewDot11Beacon(conf Dot11ApConfig, seq uint16) (error, []byte)
- func NewDot11Deauth(a1 net.HardwareAddr, a2 net.HardwareAddr, a3 net.HardwareAddr, seq uint16) (error, []byte)
- func NewTCPSyn(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr, ...) (error, []byte)
- func NewUDPProbe(from net.IP, from_hw net.HardwareAddr, to net.IP, port int) (error, []byte)
- func Serialize(layers ...gopacket.SerializableLayer) (error, []byte)
- type Activity
- type AuthSuite
- type AuthSuiteSelector
- type CipherSuite
- type CipherSuiteSelector
- type DHCPv6Layer
- type Dot11ApConfig
- type Dot11AuthType
- type Dot11CipherType
- type Krb5Address
- type Krb5EncryptedData
- type Krb5PnData
- type Krb5PrincipalName
- type Krb5ReqBody
- type Krb5Request
- type Krb5Ticket
- type NTLMChallengeResponse
- type NTLMChallengeResponseParsed
- type NTLMResponseHeader
- type NTLMState
- type PacketCallback
- type Queue
- type RSNInfo
- type Stats
- type Traffic
- type VendorInfo
Constants ¶
View Source
const ( Krb5AsRequestType = 10 Krb5Krb5PrincipalNameType = 1 Krb5CryptDesCbcMd4 = 2 Krb5CryptDescCbcMd5 = 3 Krb5CryptRc4Hmac = 23 )
View Source
const ( NTLM_SIG_OFFSET = 0 NTLM_TYPE_OFFSET = 8 NTLM_TYPE1_FLAGS_OFFSET = 12 NTLM_TYPE1_DOMAIN_OFFSET = 16 NTLM_TYPE1_WORKSTN_OFFSET = 24 NTLM_TYPE1_DATA_OFFSET = 32 NTLM_TYPE1_MINSIZE = 16 NTLM_TYPE2_TARGET_OFFSET = 12 NTLM_TYPE2_FLAGS_OFFSET = 20 NTLM_TYPE2_CHALLENGE_OFFSET = 24 NTLM_TYPE2_CONTEXT_OFFSET = 32 NTLM_TYPE2_TARGETINFO_OFFSET = 40 NTLM_TYPE2_DATA_OFFSET = 48 NTLM_TYPE2_MINSIZE = 32 NTLM_TYPE3_LMRESP_OFFSET = 12 NTLM_TYPE3_NTRESP_OFFSET = 20 NTLM_TYPE3_DOMAIN_OFFSET = 28 NTLM_TYPE3_USER_OFFSET = 36 NTLM_TYPE3_WORKSTN_OFFSET = 44 NTLM_TYPE3_SESSIONKEY_OFFSET = 52 NTLM_TYPE3_FLAGS_OFFSET = 60 NTLM_TYPE3_DATA_OFFSET = 64 NTLM_TYPE3_MINSIZE = 52 NTLM_BUFFER_LEN_OFFSET = 0 NTLM_BUFFER_MAXLEN_OFFSET = 2 NTLM_BUFFER_OFFSET_OFFSET = 4 NTLM_BUFFER_SIZE = 8 NtlmV1 = 1 NtlmV2 = 2 )
View Source
const DHCP6OptClientFQDN = 39
View Source
const DHCP6OptDNSDomains = 24
View Source
const DHCP6OptDNSServers = 23
View Source
const IPv6Prefix = "fe80::"
link-local
Variables ¶
View Source
var ( ErrNoCrypt = errors.New("No crypt alg found") ErrReqData = errors.New("Failed to extract pnData from as-req") ErrNoCipher = errors.New("No encryption type or cipher found") Krb5AsReqParam = "application,explicit,tag:10" )
View Source
var (
ErrNoCID = errors.New("Unexpected DHCPv6 packet, could not find client id.")
)
View Source
var SerializationOptions = gopacket.SerializeOptions{ FixLengths: true, ComputeChecksums: true, }
Functions ¶
func DHCP6EncodeList ¶
func Dot11Info ¶
func Dot11Info(id layers.Dot11InformationElementID, info []byte) *layers.Dot11InformationElement
func Dot11IsDataFor ¶
func Dot11IsDataFor(dot11 *layers.Dot11, station net.HardwareAddr) bool
func Dot11Parse ¶
func Dot11ParseEncryption ¶
func NewARPReply ¶
func NewARPReply(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr) (error, []byte)
func NewARPRequest ¶
func NewDot11Beacon ¶
func NewDot11Beacon(conf Dot11ApConfig, seq uint16) (error, []byte)
func NewDot11Deauth ¶
func NewDot11Deauth(a1 net.HardwareAddr, a2 net.HardwareAddr, a3 net.HardwareAddr, seq uint16) (error, []byte)
func NewUDPProbe ¶
Types ¶
type AuthSuite ¶
type AuthSuite struct { OUI []byte // 3 bytes Type Dot11AuthType }
type AuthSuiteSelector ¶
type CipherSuite ¶
type CipherSuite struct { OUI []byte // 3 bytes Type Dot11CipherType }
type CipherSuiteSelector ¶
type CipherSuiteSelector struct { Count uint16 Suites []CipherSuite }
type DHCPv6Layer ¶
type DHCPv6Layer struct {
Raw []byte
}
func (DHCPv6Layer) SerializeTo ¶
func (l DHCPv6Layer) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
type Dot11ApConfig ¶
type Dot11ApConfig struct { SSID string BSSID net.HardwareAddr Channel int Encryption bool }
type Dot11AuthType ¶
type Dot11AuthType uint8
const ( Dot11AuthMgt Dot11AuthType = 1 Dot11AuthPsk Dot11AuthType = 2 )
func (Dot11AuthType) String ¶
func (a Dot11AuthType) String() string
type Dot11CipherType ¶
type Dot11CipherType uint8
const ( Dot11CipherWep Dot11CipherType = 1 Dot11CipherTkip Dot11CipherType = 2 Dot11CipherWrap Dot11CipherType = 3 Dot11CipherCcmp Dot11CipherType = 4 Dot11CipherWep104 Dot11CipherType = 5 )
func (Dot11CipherType) String ¶
func (a Dot11CipherType) String() string
type Krb5Address ¶
type Krb5EncryptedData ¶
type Krb5PnData ¶
type Krb5PrincipalName ¶
type Krb5ReqBody ¶
type Krb5ReqBody struct { KDCOptions asn1.BitString `asn1:"explicit,tag:0"` Cname Krb5PrincipalName `asn1:"optional,explicit,tag:1"` Realm string `asn1:"general,explicit,tag:2"` Sname Krb5PrincipalName `asn1:"optional,explicit,tag:3"` From time.Time `asn1:"generalized,optional,explicit,tag:4"` Till time.Time `asn1:"generalized,optional,explicit,tag:5"` Rtime time.Time `asn1:"generalized,optional,explicit,tag:6"` Nonce int `asn1:"explicit,tag:7"` Etype []int `asn1:"explicit,tag:8"` Krb5Addresses []Krb5Address `asn1:"optional,explicit,tag:9"` EncAuthData Krb5EncryptedData `asn1:"optional,explicit,tag:10"` AdditionalKrb5Tickets []Krb5Ticket `asn1:"optional,explicit,tag:11"` }
type Krb5Request ¶
type Krb5Request struct { Pvno int `asn1:"explicit,tag:1"` MsgType int `asn1:"explicit,tag:2"` Krb5PnData []Krb5PnData `asn1:"optional,explicit,tag:3"` ReqBody Krb5ReqBody `asn1:"explicit,tag:4"` }
func (Krb5Request) String ¶
func (kdc Krb5Request) String() (string, error)
type Krb5Ticket ¶
type Krb5Ticket struct { TktVno int `asn1:"explicit,tag:0"` Realm string `asn1:"general,explicit,tag:1"` Sname Krb5PrincipalName `asn1:"explicit,tag:2"` EncPart Krb5EncryptedData `asn1:"explicit,tag:3"` }
type NTLMChallengeResponse ¶
func (*NTLMChallengeResponse) Parsed ¶
func (sr *NTLMChallengeResponse) Parsed() (NTLMChallengeResponseParsed, error)
func (NTLMChallengeResponse) ParsedNtLMv1 ¶
func (sr NTLMChallengeResponse) ParsedNtLMv1() (NTLMChallengeResponseParsed, error)
func (*NTLMChallengeResponse) ParsedNtLMv2 ¶
func (sr *NTLMChallengeResponse) ParsedNtLMv2() (NTLMChallengeResponseParsed, error)
type NTLMChallengeResponseParsed ¶
type NTLMChallengeResponseParsed struct { Type int ServerChallenge string User string Domain string LmHash string NtHashOne string NtHashTwo string }
func (NTLMChallengeResponseParsed) LcString ¶
func (data NTLMChallengeResponseParsed) LcString() string
type NTLMResponseHeader ¶
type NTLMState ¶
type NTLMState struct { sync.Mutex Responses map[uint32]string Pairs []NTLMChallengeResponse }
func NewNTLMState ¶
func NewNTLMState() *NTLMState
func (*NTLMState) AddClientResponse ¶
func (s *NTLMState) AddClientResponse(seq uint32, value string, cb func(data NTLMChallengeResponseParsed))
func (*NTLMState) AddServerResponse ¶
type PacketCallback ¶
type Queue ¶
type Queue struct { sync.RWMutex Activities chan Activity `json:"-"` Stats Stats Protos map[string]uint64 Traffic map[string]*Traffic // contains filtered or unexported fields }
func (*Queue) OnPacket ¶
func (q *Queue) OnPacket(cb PacketCallback)
func (*Queue) TrackError ¶
func (q *Queue) TrackError()
func (*Queue) TrackPacket ¶
type RSNInfo ¶
type RSNInfo struct { Version uint16 Group CipherSuite Pairwise CipherSuiteSelector AuthKey AuthSuiteSelector }
type VendorInfo ¶
type VendorInfo struct { WPAVersion uint16 Multicast CipherSuite Unicast CipherSuiteSelector AuthKey AuthSuiteSelector }
func Dot11InformationElementVendorInfoDecode ¶
func Dot11InformationElementVendorInfoDecode(buf []byte) (v VendorInfo, err error)
Click to show internal directories.
Click to hide internal directories.