oldschema

package
v0.0.0-...-c68951b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskFileEngineAll indicates that this file should work on all engines
	TaskFileEngineAll = 0
	// TaskFileEngineHashcat indicates that this task file only works on the hashcat engine
	TaskFileEngineHashcat = TaskFileEngine(WorkerHashcatEngine)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityLogEntry

type ActivityLogEntry struct {
	OccuredAt  time.Time
	UserUUID   string
	Username   string
	EntityID   string
	StatusCode int
	Type       ActivityType
	Path       string
	IPAddress  string
}

ActivityLogEntry describes a change in the system to an entity by a user

type ActivityType

type ActivityType uint8

ActivityType describes an action taken within the system

const (
	// ActivtyLogin indicates a logon activity to the system
	ActivtyLogin ActivityType = iota
	// ActivityCreatedTask indicates a task was created to the system
	ActivityCreatedTask
	// ActivityModifiedTask indicates a task was modified in the system
	ActivityModifiedTask
	// ActivityDeletedTask indicates a task was deleted in the system
	ActivityDeletedTask
	// ActivityViewTask indicates a task was viewed in the system
	ActivityViewTask
	// ActivityViewPasswords indicates passwords were viewed
	ActivityViewPasswords
	// ActivityEntitlementRequest indicates an entitled request was requsted in the system
	ActivityEntitlementRequest
	// ActivityEntitlementModification indicates a user attempted to modify an entitled entity in the system
	ActivityEntitlementModification
)

type CLDevices

type CLDevices []int

CLDevices is a list of OpenCL device ID's that a task will use on a specific host Note: One might ask "Schmitt, why is the type saving the integer array as a json array and not a postgres integer[]?" The main reason behind this is time. While the pg driver does have a type for an []int64, the support for it in DBR as well as the overall sql interface in go doesn't play well with it.

func (*CLDevices) Scan

func (s *CLDevices) Scan(src interface{}) (err error)

Scan implements the sql.Scanner interface,

func (CLDevices) String

func (s CLDevices) String() string

func (CLDevices) Value

func (s CLDevices) Value() (driver.Value, error)

Value implements driver.Value

type CheckpointFile

type CheckpointFile struct {
	TaskID string
	Data   []byte
}

CheckpointFile is a file used to restore a task's state within the engine. Note: We may need to revisit this if the files grow in size but as of now, they are only a few hundred bytes.

type CrackedHash

type CrackedHash struct {
	Hash      string `storm:"unique"`
	Value     string
	CrackedAt time.Time
}

CrackedHash is a cracked password from a task

type EngineFile

type EngineFile struct {
	FileID          string
	FileName        string
	FileSize        int64
	Description     *string
	UploadedBy      string
	UploadedByUUID  string // UUID of the user who initially uploaded the file
	UploadedAt      time.Time
	LastUpdatedAt   time.Time
	FileType        EngineFileType
	NumberOfEntries int64
	IsShared        bool
	SHA1Hash        string
	SavedAt         string // The physical location on the server where the file is located
}

EngineFile describes a file that is either a dictionary, list of masks, or a rule file for GoCrack

type EngineFileType

type EngineFileType uint8

EngineFileType indicates the type of engine file

const (
	// EngineFileDictionary indicates the shared file is a list of dictionary words
	EngineFileDictionary EngineFileType = iota
	// EngineFileMasks indicates the file is a list of passwords masks (combinations to try)
	EngineFileMasks
	// EngineFileRules indicates the file is a mangling rule set and is used to modify dictionary words
	EngineFileRules
)

type EntitlementEntry

type EntitlementEntry struct {
	UserUUID        string
	EntitledID      string
	GrantedAccessAt time.Time
}

EntitlementEntry is created when a user is granted access to a task, file, etc.

type EntitlementType

type EntitlementType uint8

EntitlementType indicates the document type for the entitlement record

const (
	EntitlementTask EntitlementType = iota
	EntitlementTaskFile
	EntitlementEngineFile
)

type PendingTaskPayloadType

type PendingTaskPayloadType uint8

PendingTaskPayloadType describes the payload structure & contents

const (
	// PendingTaskNewRequest indicates a new task
	PendingTaskNewRequest PendingTaskPayloadType = 1 << iota
	// PendingTaskStatusChange indicates a change in task status
	PendingTaskStatusChange
)

type Task

type Task struct {
	TaskID            string `storm:"id,unique"`
	TaskName          string
	Status            TaskStatus
	Engine            WorkerCrackEngine
	EnginePayload     interface{} // As of now, this can only be shared.HashcatUserOptions
	Priority          WorkerPriority
	FileID            string // FileID is a reference to TaskFile via TaskFile.FileID
	CreatedBy         string
	CreatedByUUID     string // CreatedBy is a reference to User via User.UserUUID
	CreatedAt         time.Time
	TaskDuration      int
	LastUpdatedAt     time.Time
	AssignedToHost    string
	AssignedToDevices *CLDevices
	Comment           *string
	CaseCode          *string
	NumberCracked     int
	NumberPasswords   int
	Error             *string
}

Task describes all the properties of a GoCrack cracking task

type TaskFile

type TaskFile struct {
	FileID            string `storm:"unique"`
	SavedAt           string // The physical location on the server where the file is located
	UploadedAt        time.Time
	UploadedBy        string
	UploadedByUUID    string // UUID of the user who initially uploaded the file
	FileSize          int64
	FileName          string
	SHA1Hash          string
	ForEngine         TaskFileEngine
	NumberOfPasswords int
	NumberOfSalts     int
}

TaskFile describes all the properties of a task file which is a file that contains one or more hashes that can be cracked by a GoCrack engine

type TaskFileEngine

type TaskFileEngine uint8

TaskFileEngine indicates the engine that this task file is for

type TaskStatus

type TaskStatus string

TaskStatus indicates the processing status of a Task

const (
	TaskStatusQueued    TaskStatus = "Queued"
	TaskStatusDequeued  TaskStatus = "Dequeued"
	TaskStatusRunning   TaskStatus = "Running"
	TaskStatusStopping  TaskStatus = "Stopping"
	TaskStatusStopped   TaskStatus = "Stopped"
	TaskStatusError     TaskStatus = "Error"
	TaskStatusExhausted TaskStatus = "Exhausted"
	TaskStatusFinished  TaskStatus = "Finished"
)

func (*TaskStatus) UnmarshalJSON

func (s *TaskStatus) UnmarshalJSON(data []byte) error

func (TaskStatus) Values

func (TaskStatus) Values() (kinds []string)

type User

type User struct {
	UserUUID     string `storm:"unique"`
	Username     string `storm:"unique"`
	Password     string
	Enabled      *bool
	EmailAddress string
	IsSuperUser  bool
	CreatedAt    time.Time
}

User describes all the properties of a GoCrack user

type WorkerCrackEngine

type WorkerCrackEngine uint8

WorkerCrackEngine defines the engine the worker uses to crack the password(s)

const (
	// WorkerHashcatEngine indicates the task should use the hashcat engine
	WorkerHashcatEngine WorkerCrackEngine = 1 << iota
)

type WorkerPriority

type WorkerPriority int

WorkerPriority describes the priority of the task in relative to the position in queue

const (
	WorkerPriorityHigh WorkerPriority = iota
	WorkerPriorityNormal
	WorkerPriorityLow
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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