Documentation
¶
Index ¶
- Variables
- func Bare(hello *tlsx.ClientHelloBasic) []byte
- func BareJa3s(hello *tlsx.ServerHelloBasic) []byte
- func BarePacket(p gopacket.Packet) []byte
- func BarePacketJa3s(p gopacket.Packet) []byte
- func BareToDigestHex(bare []byte) string
- func BareToDigestHexJa3s(bare []byte) string
- func Digest(hello *tlsx.ClientHelloBasic) [md5.Size]byte
- func DigestHex(hello *tlsx.ClientHelloBasic) string
- func DigestHexJa3s(hello *tlsx.ServerHelloBasic) string
- func DigestHexPacket(p gopacket.Packet) string
- func DigestHexPacketJa3s(p gopacket.Packet) string
- func DigestJa3s(hello *tlsx.ServerHelloBasic) [md5.Size]byte
- func DigestPacket(p gopacket.Packet) [md5.Size]byte
- func DigestPacketJa3s(p gopacket.Packet) [md5.Size]byte
- func ReadFileCSV(file string, out io.Writer, separator string, doJA3s bool)
- func ReadFileJSON(file string, out io.Writer, doJA3s bool)
- func ReadFileJa3s(file string, out io.Writer)
- func ReadInterface(iface, bpfFilter, dumpPkg string, out io.Writer, separator string, ja3s bool, ...)
- type PacketSource
- type Record
Constants ¶
This section is empty.
Variables ¶
var ( // Debug indicates whether we run in debug mode. Debug = false )
Functions ¶
func Bare ¶
func Bare(hello *tlsx.ClientHelloBasic) []byte
Bare returns the JA3 bare string for a given tlsx.ClientHelloBasic instance JA3 is a technique developed by Salesforce, to fingerprint TLS Client Hellos. the official python implementation can be found here: https://github.com/salesforce/ja3 JA3 gathers the decimal values of the bytes for the following fields; SSL Version, Accepted Ciphers, List of Extensions, Elliptic Curves, and Elliptic Curve Formats. It then concatenates those values together in order, using a “,” to delimit each field and a “-” to delimit each value in each field. The field order is as follows: SSLVersion,Ciphers,Extensions,EllipticCurves,EllipticCurvePointFormats Example: 769,47–53–5–10–49161–49162–49171–49172–50–56–19–4,0–10–11,23–24–25,0 If there are no SSL Extensions in the Client Hello, the fields are left empty. Example: 769,4–5–10–9–100–98–3–6–19–18–99,,, These strings are then MD5 hashed to produce an easily consumable and shareable 32 character fingerprint. This is the JA3 SSL Client Fingerprint returned by this function.
func BareJa3s ¶
func BareJa3s(hello *tlsx.ServerHelloBasic) []byte
BareJa3s returns the JA3S bare string for a given tlsx.ServerHelloBasic instance JA3S is JA3 for the Server side of the SSL/TLS communication and fingerprints how servers respond to particular clients. JA3S uses the following field order: SSLVersion,Cipher,SSLExtension
func BarePacket ¶
BarePacket returns the Ja3 digest if the supplied packet contains a TLS client hello otherwise returns an empty string
func BarePacketJa3s ¶
BarePacket returns the Ja3 digest if the supplied packet contains a TLS client hello otherwise returns an empty string
func BareToDigestHex ¶
BareToDigestHex converts a bare []byte to a hex string.
func BareToDigestHexJa3s ¶
BareToDigestHex converts a bare []byte to a hex string.
func Digest ¶
func Digest(hello *tlsx.ClientHelloBasic) [md5.Size]byte
Digest returns only the digest md5.
func DigestHex ¶
func DigestHex(hello *tlsx.ClientHelloBasic) string
DigestHex produce md5 hash from bare string.
func DigestHexJa3s ¶
func DigestHexJa3s(hello *tlsx.ServerHelloBasic) string
DigestHex produce md5 hash from bare string.
func DigestHexPacket ¶
DigestHexPacket returns the hex string for the packet for a packet carrying a TLS Client Hello
func DigestHexPacketJa3s ¶
DigestHexPacket returns the hex string for the packet for a packet carrying a TLS Client Hello
func DigestJa3s ¶
func DigestJa3s(hello *tlsx.ServerHelloBasic) [md5.Size]byte
Digest returns only the digest md5.
func DigestPacket ¶
DigestPacket returns the Ja3 digest for a packet carrying a TLS Client Hello or an empty byte slice
func DigestPacketJa3s ¶
DigestPacket returns the Ja3s digest for a packet carrying a TLS Server Hello or an empty byte slice
func ReadFileCSV ¶
ReadFileCSV reads the PCAP file at the given path and prints out all packets containing JA3 digests to the supplied io.Writer
func ReadFileJSON ¶
ReadFileJSON reads the PCAP file at the given path and prints out all packets containing JA3 digests formatted as JSON to the supplied io.Writer
func ReadFileJa3s ¶
ReadFileJa3s reads the PCAP file at the given path and prints out all packets containing JA3S digests to the supplied io.Writer
func ReadInterface ¶ added in v1.0.2
func ReadInterface(iface, bpfFilter, dumpPkg string, out io.Writer, separator string, ja3s bool, asJSON bool, snaplen int, promisc bool, timeout time.Duration)
ReadInterface reads packets from the named interface if asJSON is true the results will be dumped as newline separated JSON objects otherwise CSV will be printed to the supplied io.Writer.
Types ¶
type PacketSource ¶
type PacketSource interface {
ReadPacketData() ([]byte, gopacket.CaptureInfo, error)
}
PacketSource means we can read Packets.
type Record ¶
type Record struct { DestinationIP string `json:"destination_ip"` DestinationPort int `json:"destination_port"` JA3 string `json:"ja3"` JA3Digest string `json:"ja3_digest"` JA3S string `json:"ja3s"` JA3SDigest string `json:"ja3s_digest"` SourceIP string `json:"source_ip"` SourcePort int `json:"source_port"` Timestamp float64 `json:"timestamp"` }
Record contains all information for a calculated JA3