apitypes

package
v0.0.0-...-6a915cc Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AttackTemplateSetType = "attack-template-set"
View Source
const AttackTemplateType = "attack-template"
View Source
const UserRoleAdmin = "admin"
View Source
const UserRoleMFAExempt = "mfa_exempt"
View Source
const UserRoleRequiresPasswordChange = "requires_password_change"
View Source
const UserRoleServiceAccount = "service_account"
View Source
const UserRoleStandard = "standard"

Variables

Functions

This section is empty.

Types

type AccountChangePasswordRequestDTO

type AccountChangePasswordRequestDTO struct {
	NewPassword     string `json:"new_password" validate:"required,min=16,max=128"`
	CurrentPassword string `json:"current_password" validate:"required"`
}

type AdminAgentCreateRequestDTO

type AdminAgentCreateRequestDTO struct {
	Name      string `json:"name" validate:"required,min=4,max=64,username"`
	Ephemeral bool   `json:"ephemeral"`
}

type AdminAgentCreateResponseDTO

type AdminAgentCreateResponseDTO struct {
	Ephemeral bool   `json:"ephemeral"`
	Name      string `json:"name"`
	ID        string `json:"id"`
	Key       string `json:"key"`
}

type AdminAgentRegistrationKeyCreateRequestDTO

type AdminAgentRegistrationKeyCreateRequestDTO struct {
	Name              string `json:"name" validate:"max=64,username"`
	ForEphemeralAgent bool   `json:"for_ephemeral_agent"`
}

type AdminAgentRegistrationKeyCreateResponseDTO

type AdminAgentRegistrationKeyCreateResponseDTO struct {
	Name              string `json:"name"`
	ID                string `json:"id"`
	Key               string `json:"key"`
	ForEphemeralAgent bool   `json:"for_ephemeral_agent"`
}

type AdminAgentSetMaintanceRequestDTO

type AdminAgentSetMaintanceRequestDTO struct {
	IsMaintenanceMode bool `json:"is_maintenance_mode"`
}

type AdminConfigRequestDTO

type AdminConfigRequestDTO struct {
	Auth    *AuthConfigDTO    `json:"auth"`
	Agent   *AgentConfigDTO   `json:"agent"`
	General *GeneralConfigDTO `json:"general"`
}

type AdminConfigResponseDTO

type AdminConfigResponseDTO struct {
	Auth    AuthConfigDTO    `json:"auth"`
	Agent   AgentConfigDTO   `json:"agent"`
	General GeneralConfigDTO `json:"general"`
}

type AdminGetAgentRegistrationKeyDTO

type AdminGetAgentRegistrationKeyDTO struct {
	ID                string `json:"id"`
	Name              string `json:"name"`
	KeyHint           string `json:"key_hint"`
	ForEphemeralAgent bool   `json:"for_ephemeral_agent"`
}

type AdminGetAllAgentRegistrationKeysResponseDTO

type AdminGetAllAgentRegistrationKeysResponseDTO struct {
	AgentRegistrationKeys []AdminGetAgentRegistrationKeyDTO `json:"agent_registration_keys"`
}

type AdminGetAllUsersResponseDTO

type AdminGetAllUsersResponseDTO struct {
	Users []AdminGetUserDTO `json:"users"`
}

type AdminGetUserDTO

type AdminGetUserDTO struct {
	ID               string   `json:"id"`
	Username         string   `json:"username"`
	Roles            []string `json:"roles"`
	IsPasswordLocked bool     `json:"is_password_locked"`
}

type AdminServiceAccountCreateRequestDTO

type AdminServiceAccountCreateRequestDTO struct {
	Username string   `json:"username" validate:"required,min=4,max=64,username"`
	Roles    []string `json:"roles" validate:"required,userroles"`
}

type AdminServiceAccountCreateResponseDTO

type AdminServiceAccountCreateResponseDTO struct {
	Username string   `json:"username"`
	ID       string   `json:"id"`
	Roles    []string `json:"roles"`
	APIKey   string   `json:"api_key"`
}

type AdminUserCreateRequestDTO

type AdminUserCreateRequestDTO struct {
	Username     string   `json:"username" validate:"required,min=4,max=64,username"`
	Password     string   `json:"password" validate:"max=128"`
	GenPassword  bool     `json:"gen_password"`
	LockPassword bool     `json:"lock_password"`
	Roles        []string `json:"roles" validate:"required,userroles"`
}

type AdminUserCreateResponseDTO

type AdminUserCreateResponseDTO struct {
	Username          string   `json:"username"`
	ID                string   `json:"id"`
	Roles             []string `json:"roles"`
	GeneratedPassword string   `json:"generated_password"`
}

type AdminUserUpdatePasswordRequestDTO

type AdminUserUpdatePasswordRequestDTO struct {
	Action string `json:"action"`
}

type AdminUserUpdatePasswordResponseDTO

type AdminUserUpdatePasswordResponseDTO struct {
	GeneratedPassword string `json:"generated_password"`
}

type AdminUserUpdateRequestDTO

type AdminUserUpdateRequestDTO struct {
	Username string   `json:"username" validate:"required,min=4,max=64,username"`
	Roles    []string `json:"roles" validate:"required,userroles"`
}

type AgentConfigDTO

type AgentConfigDTO struct {
	AutomaticallySyncListfiles bool `json:"auto_sync_listfiles"`
	SplitJobsPerAgent          int  `json:"split_jobs_per_agent"`
}

type AgentDTO

type AgentDTO struct {
	ID                string                             `json:"id"`
	Name              string                             `json:"name"`
	IsMaintenanceMode bool                               `json:"is_maintenance_mode"`
	AgentInfo         AgentInfoDTO                       `json:"agent_info"`
	AgentDevices      []hashcattypes.HashcatStatusDevice `json:"agent_devices"`
}

type AgentFileDTO

type AgentFileDTO struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

type AgentGetAllResponseDTO

type AgentGetAllResponseDTO struct {
	Agents []AgentDTO `json:"agents"`
}

type AgentInfoDTO

type AgentInfoDTO struct {
	Status             string         `json:"status"`
	Version            string         `json:"version"`
	LastCheckInTime    int64          `json:"last_checkin,omitempty"`
	AvailableListfiles []AgentFileDTO `json:"available_listfiles,omitempty"`
	ActiveJobIDs       []string       `json:"active_job_ids,omitempty"`
}

type AgentRegisterRequestDTO

type AgentRegisterRequestDTO struct {
	Name string `json:"name" validate:"max=64"`
}

type AgentRegisterResponseDTO

type AgentRegisterResponseDTO struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	Key  string `json:"key"`
}

type AttackCreateRequestDTO

type AttackCreateRequestDTO struct {
	HashlistID    string                     `json:"hashlist_id" validate:"required,uuid"`
	HashcatParams hashcattypes.HashcatParams `json:"hashcat_params" validate:"required"`
	IsDistributed bool                       `json:"is_distributed"`
}

type AttackDTO

type AttackDTO struct {
	ID             string                     `json:"id"`
	HashlistID     string                     `json:"hashlist_id"`
	HashcatParams  hashcattypes.HashcatParams `json:"hashcat_params"`
	IsDistributed  bool                       `json:"is_distributed"`
	ProgressString string                     `json:"progress_string"`
}

type AttackIDTreeDTO

type AttackIDTreeDTO struct {
	ProjectID  string `json:"project_id"`
	HashlistID string `json:"hashlist_id"`
	AttackID   string `json:"attack_id"`
}

type AttackIDTreeMultipleDTO

type AttackIDTreeMultipleDTO struct {
	Attacks []AttackIDTreeDTO `json:"attacks"`
}

type AttackMultipleDTO

type AttackMultipleDTO struct {
	Attacks []AttackDTO `json:"attacks"`
}

type AttackStartResponseDTO

type AttackStartResponseDTO struct {
	JobIDs          []string `json:"new_job_ids"`
	StillProcessing bool     `json:"still_processing"`
}

type AttackTemplateCreateRequestDTO

type AttackTemplateCreateRequestDTO struct {
	Name          string                     `json:"name" validate:"required,standardname,min=3,max=64"`
	HashcatParams hashcattypes.HashcatParams `json:"hashcat_params" validate:"required"`
}

type AttackTemplateCreateSetRequestDTO

type AttackTemplateCreateSetRequestDTO struct {
	Name              string   `json:"name" validate:"required,standardname,min=3,max=64"`
	AttackTemplateIDs []string `json:"attack_template_ids" validate:"min=1,max=32,dive,uuid4"`
}

type AttackTemplateDTO

type AttackTemplateDTO struct {
	ID string `json:"id"`

	Type          string                      `json:"type"`
	Name          string                      `json:"name"`
	HashcatParams *hashcattypes.HashcatParams `json:"hashcat_params,omitempty"`

	CreatedByUserID string `json:"created_by_user_id"`

	AttackTemplateIDs []string `json:"attack_template_ids,omitempty"`
}

type AttackTemplateGetAllResponseDTO

type AttackTemplateGetAllResponseDTO struct {
	AttackTemplates []AttackTemplateDTO `json:"attack_templates"`
}

type AttackTemplateUpdateRequestDTO

type AttackTemplateUpdateRequestDTO struct {
	Type string `json:"type"`
	Name string `json:"name"`

	HashcatParams     *hashcattypes.HashcatParams `json:"hashcat_params,omitempty"`
	AttackTemplateIDs []string                    `json:"attack_template_ids,omitempty"`
}

type AttackWithJobsDTO

type AttackWithJobsDTO struct {
	AttackDTO
	Jobs []JobDTO `json:"jobs"`
}

type AttackWithJobsMultipleDTO

type AttackWithJobsMultipleDTO struct {
	Attacks []AttackWithJobsDTO `json:"attacks"`
}

type AuthChangePasswordRequestDTO

type AuthChangePasswordRequestDTO struct {
	OldPassword string `json:"old_password" validate:"required"`
	NewPassword string `json:"new_password" validate:"required,min=16,max=128"`
}

type AuthConfigDTO

type AuthConfigDTO struct {
	General *GeneralAuthConfigDTO `json:"general"`
	OIDC    *AuthOIDCConfigDTO    `json:"oidc"`
}

type AuthCurrentUserDTO

type AuthCurrentUserDTO struct {
	ID               string   `json:"id"`
	Username         string   `json:"username"`
	Roles            []string `json:"roles"`
	IsPasswordLocked bool     `json:"is_password_locked"`
}

type AuthLoginRequestDTO

type AuthLoginRequestDTO struct {
	Username string `json:"username" validate:"required,min=4,max=64,username"`
	Password string `json:"password" validate:"required"`
}

type AuthLoginResponseDTO

type AuthLoginResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type AuthOIDCConfigDTO

type AuthOIDCConfigDTO struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`

	IssuerURL   string `json:"issuer_url"`
	RedirectURL string `json:"redirect_url"`

	Prompt string `json:"prompt"`

	AutomaticUserCreation bool   `json:"automatic_user_creation"`
	UsernameClaim         string `json:"username_claim"`

	RolesClaim   string `json:"role_field"`
	RequiredRole string `json:"required_role"`

	AdditionalScopes []string `json:"scopes"`
}

type AuthRefreshResponseDTO

type AuthRefreshResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type AuthWebAuthnStartChallengeResponseDTO

type AuthWebAuthnStartChallengeResponseDTO struct {
	protocol.CredentialAssertion
}

type AuthWebAuthnStartEnrollmentResponseDTO

type AuthWebAuthnStartEnrollmentResponseDTO struct {
	protocol.CredentialCreation
}

type AuthWhoamiResponseDTO

type AuthWhoamiResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type DetectHashTypeRequestDTO

type DetectHashTypeRequestDTO struct {
	TestHash    string `json:"test_hash" validate:"required,min=4"`
	HasUsername bool   `json:"has_username"`
}

type DetectHashTypeResponseDTO

type DetectHashTypeResponseDTO struct {
	PossibleTypes []int `json:"possible_types"`
}

type GeneralAuthConfigDTO

type GeneralAuthConfigDTO struct {
	EnabledMethods []string `json:"enabled_methods"`

	IsMFARequired                     bool `json:"is_mfa_required"`
	RequirePasswordChangeOnFirstLogin bool `json:"require_password_change_on_first_login"`
}

type GeneralConfigDTO

type GeneralConfigDTO struct {
	IsMaintenanceMode               bool  `json:"is_maintenance_mode"`
	MaximumUploadedFileSize         int64 `json:"maximum_uploaded_file_size"`
	MaximumUploadedFileLineScanSize int64 `json:"maximum_uploaded_file_line_scan_size"`
}

type GetAllListfilesDTO

type GetAllListfilesDTO struct {
	Listfiles []ListfileDTO `json:"listfiles"`
}

type GetAllRuleFilesDTO

type GetAllRuleFilesDTO struct {
	RuleFiles []ListfileDTO `json:"rulefiles"`
}

type GetAllWordlistsDTO

type GetAllWordlistsDTO struct {
	Wordlists []ListfileDTO `json:"wordlists"`
}

type HashTypesDTO

type HashTypesDTO struct {
	HashTypes hashcattypes.HashTypeMap `json:"hashtypes"`
}

type HashlistAppendRequestDTO

type HashlistAppendRequestDTO struct {
	Hashes []string `json:"input_hashes" validate:"required,min=1,dive,required,min=4"`
}

type HashlistAppendResponseDTO

type HashlistAppendResponseDTO struct {
	NumNewHashes            int64 `json:"num_new_hashes"`
	NumPopulatedFromPotfile int64 `json:"num_populated_from_potfile"`
}

type HashlistCreateRequestDTO

type HashlistCreateRequestDTO struct {
	ProjectID    string   `json:"project_id" validate:"required,uuid"`
	Name         string   `json:"name" validate:"required,standardname,min=3,max=64"`
	HashType     int      `json:"hash_type" validate:"hashtype"`
	InputHashes  []string `json:"input_hashes" validate:"required,min=1,dive,required,min=4"`
	HasUsernames bool     `json:"has_usernames"`
}

type HashlistCreateResponseDTO

type HashlistCreateResponseDTO struct {
	ID                      string `json:"id"`
	NumPopulatedFromPotfile int64  `json:"num_populated_from_potfile"`
}

type HashlistDTO

type HashlistDTO struct {
	ID           string            `json:"id"`
	ProjectID    string            `json:"project_id"`
	Name         string            `json:"name"`
	TimeCreated  int64             `json:"time_created"`
	HashType     int               `json:"hash_type"`
	Hashes       []HashlistHashDTO `json:"hashes"`
	Version      uint              `json:"version"`
	HasUsernames bool              `json:"has_usernames"`
}

type HashlistHashDTO

type HashlistHashDTO struct {
	ID             string `json:"id"`
	Username       string `json:"username"`
	InputHash      string `json:"input_hash"`
	NormalizedHash string `json:"normalized_hash"`
	IsCracked      bool   `json:"is_cracked"`
	IsUnexpected   bool   `json:"is_unexpected"`
	PlaintextHex   string `json:"plaintext_hex"`
}

type HashlistResponseMultipleDTO

type HashlistResponseMultipleDTO struct {
	Hashlists []HashlistDTO `json:"hashlists"`
}

type JobCreateRequestDTO

type JobCreateRequestDTO struct {
	HashcatParams    hashcattypes.HashcatParams `json:"hashcat_params" validate:"required"`
	Hashes           []string                   `json:"hashes" validate:"required,min=1,dive,min=4,required"`
	StartImmediately bool                       `json:"start_immediately"`
	Name             string                     `json:"name" validate:"required,standardname,min=5,max=30"`
	Description      string                     `json:"description" validate:"printascii,max=1000"`
}

type JobCreateResponseDTO

type JobCreateResponseDTO struct {
	ID string `json:"id"`
}

type JobDTO

type JobDTO struct {
	ID              string                     `json:"id"`
	HashlistVersion uint                       `json:"hashlist_version"`
	AttackID        string                     `json:"attack_id"`
	HashcatParams   hashcattypes.HashcatParams `json:"hashcat_params"`
	TargetHashes    []string                   `json:"target_hashes"`
	HashType        int                        `json:"hash_type"`
	RuntimeData     JobRuntimeDataDTO          `json:"runtime_data"`
	RuntimeSummary  JobRuntimeSummaryDTO       `json:"runtime_summary"`
	AssignedAgentID string                     `json:"assigned_agent_id"`
}

type JobMultipleDTO

type JobMultipleDTO struct {
	Jobs []JobSimpleDTO `json:"jobs"`
}

type JobRuntimeDataDTO

type JobRuntimeDataDTO struct {
	StartRequestTime time.Time `json:"start_request_time"`
	StartedTime      time.Time `json:"started_time"`
	StoppedTime      time.Time `json:"stopped_time"`
	Status           string    `json:"status"`
	StopReason       string    `json:"stop_reason"`
	ErrorString      string    `json:"error_string"`
	CmdLine          string    `json:"cmd_line"`

	OutputLines   []JobRuntimeOutputLineDTO    `json:"output_lines"`
	StatusUpdates []hashcattypes.HashcatStatus `json:"status_updates"`
}

type JobRuntimeOutputLineDTO

type JobRuntimeOutputLineDTO struct {
	Stream string `json:"stream"`
	Line   string `json:"line"`
}

type JobRuntimeSummaryDTO

type JobRuntimeSummaryDTO struct {
	Hashrate               int     `json:"hashrate"`
	EstimatedTimeRemaining int64   `json:"estimated_time_remaining"`
	PercentComplete        float32 `json:"percent_complete"`
	StartedTime            int64   `json:"started_time"`
	StoppedTime            int64   `json:"stopped_time"`
	CmdLine                string  `json:"cmd_line"`
}

type JobSimpleDTO

type JobSimpleDTO struct {
	ID              string `json:"id"`
	HashlistVersion uint   `json:"hashlist_version"`
	AttackID        string `json:"attack_id"`
	HashType        int    `json:"hash_type"`
	AssignedAgentID string `json:"assigned_agent_id"`
}

type JobStartResponseDTO

type JobStartResponseDTO struct {
	AgentID string `json:"agent_id"`
}

type ListfileDTO

type ListfileDTO struct {
	ID                string `json:"id"`
	FileType          string `json:"file_type"`
	Name              string `json:"name"`
	SizeInBytes       uint64 `json:"size_in_bytes"`
	Lines             uint64 `json:"lines"`
	AvailableForUse   bool   `json:"available_for_use"`
	PendingDelete     bool   `json:"pending_delete"`
	CreatedByUserID   string `json:"created_by_user_id"`
	AttachedProjectID string `json:"associated_project_id"`
}

type ListfileUploadResponseDTO

type ListfileUploadResponseDTO struct {
	Listfile ListfileDTO `json:"listfile"`
}

type NormalizeHashesRequestDTO

type NormalizeHashesRequestDTO = VerifyHashesRequestDTO

type NormalizeHashesResponseDTO

type NormalizeHashesResponseDTO struct {
	Valid            bool     `json:"valid"`
	NormalizedHashes []string `json:"normalized_hashes"`
}

type PotfileSearchRequestDTO

type PotfileSearchRequestDTO struct {
	Hashes []string `json:"hashes"`
}

type PotfileSearchResponseDTO

type PotfileSearchResponseDTO struct {
	Results []PotfileSearchResultDTO `json:"results"`
}

type PotfileSearchResultDTO

type PotfileSearchResultDTO struct {
	Hash         string `json:"hash"`
	HashType     uint   `json:"hash_type"`
	PlaintextHex string `json:"plaintext_hex"`
	Found        bool   `json:"found"`
}

type ProjectAddShareRequestDTO

type ProjectAddShareRequestDTO struct {
	UserID string `json:"user_id" validate:"required,uuid"`
}

type ProjectCreateRequestDTO

type ProjectCreateRequestDTO struct {
	Name        string `json:"name" validate:"required,standardname,min=3,max=64"`
	Description string `json:"description" validate:"printascii,max=1000"`
}

type ProjectCreateResponseDTO

type ProjectCreateResponseDTO = ProjectDTO

type ProjectDTO

type ProjectDTO struct {
	ID          string `json:"id"`
	TimeCreated int64  `json:"time_created"`
	Name        string `json:"name"`
	Description string `json:"description"`
	OwnerUserID string `json:"owner_user_id"`
}

type ProjectResponseMultipleDTO

type ProjectResponseMultipleDTO struct {
	Projects []ProjectDTO `json:"projects"`
}

type ProjectSharesDTO

type ProjectSharesDTO struct {
	UserIDs []string `json:"user_ids"`
}

type PublicAuthConfigDTO

type PublicAuthConfigDTO struct {
	EnabledMethods []string            `json:"enabled_methods"`
	OIDC           PublicOIDCConfigDTO `json:"oidc"`
}

type PublicConfigDTO

type PublicConfigDTO struct {
	Auth    PublicAuthConfigDTO    `json:"auth"`
	General PublicGeneralConfigDTO `json:"general"`
}

type PublicGeneralConfigDTO

type PublicGeneralConfigDTO struct {
	IsMaintenanceMode               bool  `json:"is_maintenance_mode"`
	MaximumUploadedFileSize         int64 `json:"maximum_uploaded_file_size"`
	MaximumUploadedFileLineScanSize int64 `json:"maximum_uploaded_file_line_scan_size"`
}

type PublicOIDCConfigDTO

type PublicOIDCConfigDTO struct {
	Prompt string `json:"prompt"`
}

type RunningJobCountForUserDTO

type RunningJobCountForUserDTO struct {
	Username string `json:"username"`
	JobCount uint   `json:"job_count"`
}

type RunningJobCountPerUsersDTO

type RunningJobCountPerUsersDTO struct {
	Result []RunningJobCountForUserDTO `json:"result"`
}

type RunningJobForUserDTO

type RunningJobForUserDTO struct {
	ProjectID  string `json:"project_id"`
	HashlistID string `json:"hashlist_id"`
	AttackID   string `json:"attack_id"`
	JobID      string `json:"job_id"`
}

type RunningJobsForUserResponseDTO

type RunningJobsForUserResponseDTO struct {
	Jobs []RunningJobForUserDTO `json:"jobs"`
}

type UserDTO

type UserDTO struct {
	ID       string   `json:"id"`
	Username string   `json:"username"`
	Roles    []string `json:"roles"`
}

type UserMinimalDTO

type UserMinimalDTO struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

type UsersGetAllResponseDTO

type UsersGetAllResponseDTO struct {
	Users []UserMinimalDTO `json:"users"`
}

type VerifyHashesRequestDTO

type VerifyHashesRequestDTO struct {
	Hashes       []string `json:"hashes" validate:"required,min=1,dive,required,min=4"`
	HashType     int      `json:"hash_type" validate:"hashtype"`
	HasUsernames bool     `json:"has_usernames"`
}

type VerifyHashesResponseDTO

type VerifyHashesResponseDTO struct {
	Valid bool `json:"valid"`
}

Jump to

Keyboard shortcuts

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