openssl

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 22 Imported by: 15

Documentation

Overview

Package openssl implements a tls grabbing implementation using openssl

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParse          = errorutils.NewWithTag("openssl", "failed to parse openssl response")
	ErrCertParse      = errorutils.NewWithTag("openssl", "failed to parse server certificate")
	ErrNotImplemented = errorutils.NewWithTag("openssl", "feature not implemented")
	ErrNotAvailable   = errorutils.NewWithTag("openssl", "executable not installed or in PATH")
	ErrNoSession      = errorutils.NewWithTag("openssl", "session not created/found")
)
View Source
var (
	BinaryPath   = ""
	OPENSSL_CONF = ""
	IsLibreSSL   = false
	PkgTag       = "" // Header or Tag value that will be reflected in all errors (include openssl(libressl) and version)
)
View Source
var AllCiphersNames []string = []string{}

AllCipherNames contains all ciphers supported by openssl

View Source
var SupportedTLSVersions = []string{
	"tls10",
	"tls11",
	"tls12",
}

SupportedTLSVersion of OpenSSL Mode

Functions

func IsAvailable added in v1.0.3

func IsAvailable() bool

check if openssl if available for use

func UseOpenSSLBinary added in v1.0.3

func UseOpenSSLBinary(binpath string)

UseOpenSSLBinary From Path

func Wrap added in v1.0.3

func Wrap(err1 errorutil.Error, err2 errorutil.Error) errorutil.Error

Wraps err2 over err1 even if err is nil

Types

type CMDOUT added in v1.0.3

type CMDOUT struct {
	Command string
	Stdout  string
	Stderr  string
}

type Client

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

Client is a TLS grabbing client using crypto/tls

func New

func New(options *clients.Options) (*Client, error)

New creates a new grabbing client using crypto/tls

func (*Client) ConnectWithOptions

func (c *Client) ConnectWithOptions(hostname, ip, port string, options clients.ConnectOptions) (*clients.Response, error)

Connect connects to a host and grabs the response data

func (*Client) EnumerateCiphers added in v1.0.6

func (c *Client) EnumerateCiphers(hostname, ip, port string, options clients.ConnectOptions) ([]string, error)

EnumerateCiphers enumerates all supported ciphers of openssl on target

func (*Client) SupportedTLSCiphers

func (c *Client) SupportedTLSCiphers() ([]string, error)

SupportedTLSVersions is meaningless here but necessary due to the interface system implemented

func (*Client) SupportedTLSVersions

func (c *Client) SupportedTLSVersions() ([]string, error)

SupportedTLSVersions is meaningless here but necessary due to the interface system implemented

type Options added in v1.0.3

type Options struct {
	Address       string    // host:port address to connect
	Cipher        []string  // Cipher to use while connecting
	ServerName    string    // Set TLS extension servername in ClientHello (SNI)
	CertChain     bool      // Show Certificate Chain
	Protocol      Protocols // protocol to use
	CAFile        string    // CA Certificate File
	SkipCertParse bool      // SkipCertParse skips parsing and validating certs
}

OpenSSL Command Line Options

func (*Options) Args added in v1.0.3

func (o *Options) Args() ([]string, error)

generate command Args using given options

type Protocols added in v1.0.3

type Protocols int
const (
	TLSv1 Protocols = iota
	TLSv1_1
	TLSv1_2
	TLSv1_3
	DTLSv1
	DTLSv1_2
	TLSUnsupported
)

func (*Protocols) String added in v1.0.3

func (p *Protocols) String() string

type Response added in v1.0.3

type Response struct {
	AllCerts           []*x509.Certificate
	Session            *Session
	ClientCertRequired bool
}

Openssl response

type Session added in v1.0.3

type Session struct {
	Protocol  string
	Cipher    string
	SessionID string
	MasterKey string
}

Session Details returned by openssl

Jump to

Keyboard shortcuts

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