Documentation
¶
Overview ¶
Package sebel provides functionality for checking SSL/TLS certificates against a malicious connections, by identifying and blacklisting certificates used by botnet command and control (C&C) servers.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrSSLBlacklist = errors.New("certificate blacklisted") ErrNoSSLBLData = errors.New("no SSLBL data") )
Functions ¶
func IsBlacklist ¶
IsBlacklist checks if the given error is an ErrSSLBlacklist.
Types ¶
type Options ¶
type Options struct { // DisableSSLBlacklist, when set to true, disables SSL/TLS certificate // blacklist checks. DisableSSLBlacklist bool }
Options holds configuration settings for the Sebel package.
type Sebel ¶
type Sebel struct {
// contains filtered or unexported fields
}
Sebel holds information and Options.
func New ¶
New creates a new instance of Sebel with the provided options.
Example ¶
package main import ( "net/http" "github.com/teler-sh/sebel" ) func main() { client := &http.Client{ Transport: sebel.New().RoundTripper(http.DefaultTransport), } resp, err := client.Get("https://c2.host") if err != nil && sebel.IsBlacklist(err) { // certificate blacklisted panic(err) } defer resp.Body.Close() println("OK") }
Output:
func (*Sebel) CheckTLS ¶
CheckTLS checks the TLS connection against the SSLBL (SSL Blacklist) and returns the SSLBL record.
It returns ErrSSLBlacklist error if the certificate is blacklisted.
Example ¶
package main import ( "net/http" "github.com/teler-sh/sebel" ) func main() { r, err := http.Get("https://c2.host") if err != nil { panic(err) } defer r.Body.Close() s := sebel.New() _, err = s.CheckTLS(r.TLS) if err != nil && sebel.IsBlacklist(err) { // certificate blacklisted panic(err) } }
Output:
func (*Sebel) RoundTripper ¶
func (s *Sebel) RoundTripper(rt http.RoundTripper) http.RoundTripper
RoundTripper creates a new RoundTripper using the provided http.RoundTripper and Sebel instance.
Example ¶
To seamlessly integrate it without need to configure a new client, you can simply replace your current http.DefaultClient with sebel's RoundTripper.
package main import ( "net/http" "github.com/teler-sh/sebel" ) func main() { http.DefaultClient.Transport = sebel.New().RoundTripper(http.DefaultTransport) }
Output:
Directories
¶
Path | Synopsis |
---|---|
pkg
|
|
cert
Package cert provides utilities for working with SSL/TLS certificates, including fingerprint generation.
|
Package cert provides utilities for working with SSL/TLS certificates, including fingerprint generation. |
sslbl
Package sslbl provides a simple SSL Blacklist (SSLBL) implementation for checking certificates.
|
Package sslbl provides a simple SSL Blacklist (SSLBL) implementation for checking certificates. |