bruteforce

package
v0.0.0-...-4673371 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: EUPL-1.2 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_PASSWORDS_PER_BATCH = 10000

Variables

This section is empty.

Functions

func ImportFromReader

func ImportFromReader(ctx context.Context, reader io.Reader, database db.TransactionQuerier) error

func NewBruteforcer

func NewBruteforcer(passwordProvider PasswordProvider, sc scanner.Scanner, statusFunc StatusFunc) *bruteforcer

func NewDatabaseBruteforceProvider

func NewDatabaseBruteforceProvider(queries DatabasePasswordProviderInterface) *databaseBruteforceProvider

func NewDatabasePasswordProvider

func NewDatabasePasswordProvider(ctx context.Context, database DatabasePasswordProviderInterface, projectID int64) (*databasePasswordProvider, error)

func NewPasswordListIterator

func NewPasswordListIterator(passwords []string) *passwordListProvider

Types

type BruteforceProvider

type BruteforceProvider interface {
	NewBruteforcer(ctx context.Context, sc scanner.Scanner, statusFunc StatusFunc, projectID int64) (Bruteforcer, error)
}

type BruteforceUserStatus

type BruteforceUserStatus struct {
	Total             int64
	Tried             int64
	FoundPassword     string
	MaximumInternalID int64
}

type Bruteforcer

type Bruteforcer interface {
	BruteforcePasswordAllUsers(ctx context.Context) ([]scanner.ScanResult, error)
}

type DatabasePasswordProviderInterface

type DatabasePasswordProviderInterface interface {
	GetBruteforcePasswordsPaginated(ctx context.Context, arg queries.GetBruteforcePasswordsPaginatedParams) ([]*queries.DefaultBruteforcePassword, error)
	GetSpecificBruteforcePasswordID(ctx context.Context, arg queries.GetSpecificBruteforcePasswordIDParams) (int64, error)
	CreateBruteforcedPassword(ctx context.Context, arg queries.CreateBruteforcedPasswordParams) (*queries.BruteforcedPassword, error)
	GetBruteforcedPasswords(ctx context.Context, arg queries.GetBruteforcedPasswordsParams) (*queries.BruteforcedPassword, error)
	GetBruteforcePasswordsForProjectCount(ctx context.Context, projectID int64) (int64, error)
	UpdateBruteforcedPassword(ctx context.Context, arg queries.UpdateBruteforcedPasswordParams) (*queries.BruteforcedPassword, error)
}

type PasswordProvider

type PasswordProvider interface {
	GetCount() (int64, error)
	GetSpecificPassword(password string) (int64, bool, error)
	Next() bool
	Error() error
	Current() (int64, string, error)
	Start(index int64) error
	Close()

	SavePasswordHash(username, hash, password string, maxInternalID int64) error
	GetPasswordByHash(username, hash string) (string, int64, error)
}

type StatusFunc

type StatusFunc = func(map[scanner.User]BruteforceUserStatus) error

Jump to

Keyboard shortcuts

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