lib

package
v0.0.0-...-04cccb0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Protocol = "http://"

	BodyType = "application/json"

	TasksCreatePath = "/tasks/create"
	JobsKillPath    = "/jobs/kill"
	JobsCreatePath  = "/jobs/create"
	HeartbeatPath   = "/heartbeat"
	StatusPath      = "/cong"

	SlaveARN   = "arn:aws:iam::415077340068:instance-profile/SlaveTheRipper"
	SlaveRole  = "SlaveTheRipper"
	SlaveImage = "ami-dd713aae" // ami-7abd0209: CentOS 7 (x86_64) - with Updates HVM for EU (Ireland)
	SlaveType  = "t2.micro"

	MasterARN  = "arn:aws:iam::415077340068:instance-profile/MasterTheRipper"
	MasterRole = "MasterTheRipper"

	AWSRegion = "eu-west-1"

	// TODO consider removing this constraint so that our system can be used in heterogeneous clusters
	MaxSlotsPerInstance = 2

	RequestTimeout    = 5 * time.Second
	HeartbeatInterval = 5 * time.Second
)

Global configuration

Variables

View Source
var Alphabets [][]byte

Alphabets contains the set of all candidate characters for every alphabet

Functions

func AddToIntSlice

func AddToIntSlice(base, v int, inp []int) ([]int, int)

AddToIntSlice is DEPRECATED

func BigIntToBytes

func BigIntToBytes(alph Alphabet, bigInt *big.Int, l int) ([]byte, bool)

note that the input is consumed

func BytesToBigInt

func BytesToBigInt(alph Alphabet, inp []byte) *big.Int

func BytesToIntSlice

func BytesToIntSlice(alph Alphabet, inp []byte) []int

BytesToIntSlice is DEPRECATED

func EmptyChan

func EmptyChan(c chan int)

func IntSliceToBytes

func IntSliceToBytes(alph Alphabet, inp []int) []byte

IntSliceToBytes is DEPRECATED

func Min

func Min(a, b int) int

func ReverseArray

func ReverseArray(arr []byte) []byte

func TestEqBytes

func TestEqBytes(a, b []byte) bool

func TestEqInts

func TestEqInts(a, b []int) bool

TestEqInts tests the equality between two int slices

Types

type Algorithm

type Algorithm int

Algorithm is an enum for the supported key derivation functions

const (
	PBKDF2 Algorithm = iota
	BCRYPT
	SCRYPT
	ARGON2
)

type Alphabet

type Alphabet int

Alphabet

const (
	Numerical Alphabet = iota
	AlphaLower
	AlphaMixed
	AlphaNumLower
	AlphaNumMixed
)

func (Alphabet) FinalCandidate

func (alph Alphabet) FinalCandidate(l int) []byte

func (Alphabet) InitialCandidate

func (alph Alphabet) InitialCandidate(l int) []byte

type Heartbeat

type Heartbeat struct {
	TaskStatus []TaskStatus
}

func (*Heartbeat) ToJSON

func (h *Heartbeat) ToJSON() ([]byte, error)

ToJSON serializes a Heartbeat to JSON.

type Job

type Job struct {
	Salt      []byte
	Digest    []byte
	KeyLen    int
	Iter      int
	Alphabet  Alphabet
	Algorithm Algorithm
}

Job is the customer facing resource representing a single password cracking job we focus on PBKDF2 first with SHA256 first

func (*Job) ToJSON

func (j *Job) ToJSON() ([]byte, error)

type Status

type Status int

Status

const (
	Running Status = iota
	PasswordFound
	PasswordNotFound
)

type Task

type Task struct {
	Job
	JobID    int
	ID       int
	Start    []byte
	TaskLen  int
	Progress []byte
}

A Task defines the computational domain for string permutations. This way, the slave knows from which string permutation to start and at which string permutation to stop.

func (*Task) ToJSON

func (t *Task) ToJSON() ([]byte, error)

ToJSON serializes a Task to JSON.

type TaskStatus

type TaskStatus struct {
	Id       int
	JobId    int
	Status   Status
	Password string
	Progress []byte // State of permutation
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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