shared

package
v0.0.0-...-bd43069 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedHashcatModes = []HModeInfo{}/* 270 elements not displayed */

SupportedHashcatModes is a list of all the supported hashcat cracking SupportedHashcatModes This is manually generated and is up-to-date as of v3.40

Functions

func GetBoolPtr

func GetBoolPtr(b bool) *bool

GetBoolPtr returns the address of b

func GetIntPtr

func GetIntPtr(i int) *int

GetIntPtr returns the address of i

func GetStrPtr

func GetStrPtr(s string) *string

GetStrPtr returns the address of s

func GetTLSConfig

func GetTLSConfig(certificatePem, privateKeyPem string, caCertPem *string) (*tls.Config, error)

GetTLSConfig is a helper function to return a TLS configuration that can be used in TLS servers

func IntSliceToString

func IntSliceToString(ints []int) string

IntSliceToString converts a list of integers to a comma separated list

func LoadConfigFile

func LoadConfigFile(configPath string, cfg interface{}) (err error)

LoadConfigFile reads configPath into cfg

func RecordAPIMetrics

func RecordAPIMetrics(duration prometheus.Summary, counter *prometheus.CounterVec) gin.HandlerFunc

RecordAPIMetrics logs the duration of an API request, minus websockets as well as a summary of request partitioned by their status code and method

Types

type Beacon

type Beacon struct {
	WorkerVersion  string
	Hostname       string
	RequestNewTask bool
	Devices        DeviceMap
	Processes      map[string]TaskProcess // map[taskid]TaskProcess
	Engines        EngineVersion
}

Beacon describes the payload sent by a worker

type Device

type Device struct {
	ID     int
	Name   string
	Type   opencl.DeviceType
	IsBusy bool
}

Device describes an OpenCL device on a worker

type DeviceMap

type DeviceMap map[int]*Device

DeviceMap stores OpenCL Device information by the device's unique ID. The methods attached to this are not safe for concurrent use

func (DeviceMap) HasFreeDevices

func (s DeviceMap) HasFreeDevices() bool

HasFreeDevices indicates if we have at least one device that can accept a task

func (DeviceMap) MarkAsBusy

func (s DeviceMap) MarkAsBusy(devices []int)

MarkAsBusy marks devices as busy

func (DeviceMap) MarkAsFree

func (s DeviceMap) MarkAsFree(devices []int)

MarkAsFree marks devices as free

func (DeviceMap) PickFreeDevices

func (s DeviceMap) PickFreeDevices(deviceType opencl.DeviceType, maxNumber int) []int

PickFreeDevices returns a list of device ID's that are not marked as Busy

type EngineVersion

type EngineVersion map[string]string // map[engine_name]engine_version

EngineVersion is a map of the engines contained within the worker along with their engine version

type HModeInfo

type HModeInfo struct {
	Number   int    `json:"mode"`
	Name     string `json:"name"`
	Category string `json:"category"`
	Example  string `json:"example,omitempty"`
}

HModeInfo describes the hashcat mode

func LookupHashcatHashType

func LookupHashcatHashType(hashtype int) *HModeInfo

LookupHashcatHashType takes a hash type integer and returns info about it if it exists

type HashcatAttackMode

type HashcatAttackMode uint32

HashcatAttackMode describes the various supported password cracking attacks available in hashcat

const (
	// AttackModeStraight is a dictionary attack with optional mangling rules applied
	AttackModeStraight HashcatAttackMode = 0
	// AttackModeBruteForce is a brute force attack using a list of masks to guess the password(s)
	AttackModeBruteForce HashcatAttackMode = 3
)

type HashcatUserOptions

type HashcatUserOptions struct {
	AttackMode       HashcatAttackMode `json:"attack_mode"`
	HashType         int               `json:"hash_type"`
	Masks            *string           `json:"masks,omitempty"`
	DictionaryFile   *string           `json:"dictionary_file,omitempty"`
	ManglingRuleFile *string           `json:"mangling_file,omitempty"`
}

HashcatUserOptions defines the user settable options of a hashcat task

type HumanDuration

type HumanDuration struct {
	time.Duration
}

HumanDuration is YAML encodable duration for configuration objects

func (HumanDuration) MarshalYAML

func (s HumanDuration) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML encoder to save the human duration within a YAML file

func (*HumanDuration) UnmarshalYAML

func (s *HumanDuration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML decoder to load the duration into a time.Duration

type ServerCfg

type ServerCfg struct {
	Address       string  `yaml:"address"`
	Certificate   string  `yaml:"ssl_certificate"`
	PrivateKey    string  `yaml:"ssl_private_key"`
	CACertificate *string `yaml:"ssl_ca_certificate,omitempty"`
	UseSSL        bool    `yaml:"ssl_enabled"`
}

type TaskProcess

type TaskProcess struct {
	Pid          int
	MemoryUsage  uint64
	RunningFor   time.Duration
	UsingDevices []int
}

TaskProcess is information returned by a worker about a given child process it's managing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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