wordlist

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemoteWordlistBase = "https://wordlists.assetnote.io/data/"
)

Variables

View Source
var (
	ErrInvalidFormat = fmt.Errorf("unknown format")
)
View Source
var (
	ErrNotFound = fmt.Errorf("wordlist not found")
)

Functions

func CreateLocalCache

func CreateLocalCache() error

func GetLocalDir

func GetLocalDir() (string, error)

func GetLocalDirPanic

func GetLocalDirPanic() string

func List

func List(ctx context.Context, opts ...ListOption) error

func TabString

func TabString(fields ...string) string

Types

type Format

type Format int
const (
	Unknown Format = iota
	Pretty
	Plain
	JSON
)

func FormatFromString

func FormatFromString(in string) (Format, error)

type ListOption

type ListOption func(o *ListOptions)

func OutputFormat

func OutputFormat(v Format) ListOption

type ListOptions

type ListOptions struct {
	Output Format
}

func NewListOptions

func NewListOptions(opts ...ListOption) *ListOptions

type WordlistMetadata

type WordlistMetadata struct {
	Shortname string  `json:"Shortname,omitempty"`
	Filename  string  `json:"Filename,omitempty"`
	LineCount int     `json:"Line Count,omitempty"`
	FileSize  string  `json:"File Size,omitempty"`
	Date      float64 `json:"Date,omitempty"`
	Download  string  `json:"Download,omitempty"`
	Source    string  `json:"Source,omitempty"`
	Cached    bool    `json:"Cached"`
}

func CheckAllCached

func CheckAllCached(in []WordlistMetadata) ([]WordlistMetadata, error)

func Get

func Get(ctx context.Context, names ...string) (ret []WordlistMetadata, err error)

Get will retrieve all the names from remote or local sources

func GetLocalDirListing

func GetLocalDirListing() ([]WordlistMetadata, error)

func GetRemoteWordlists

func GetRemoteWordlists() ([]WordlistMetadata, error)

func Save

func Save(ctx context.Context, nocache bool, names ...string) (ret []WordlistMetadata, err error)

Save will save the specified names to the local cache. TODO: implement special case for "all"

func (WordlistMetadata) APIS

func (w WordlistMetadata) APIS() (ret proute.APIS, err error)

API will atttempt to load a compiled kite API from disk. If this doesnt exist, then we attempt to compile a local file to disk. If this local file doesnt exist, then we download it first and cache it

func (*WordlistMetadata) Cache

func (w *WordlistMetadata) Cache() error

Cache will downlad the file and save it to disk

func (*WordlistMetadata) IsCached

func (w *WordlistMetadata) IsCached() bool

Cached performs a single stat operation against the local directory to see if the file exists on disk. This is not efficient, but a few dozen stat calls never hurt anyone. If you want to go fast, use CheckAllCached

func (WordlistMetadata) LocalFilename

func (w WordlistMetadata) LocalFilename() (string, error)

func (WordlistMetadata) LocalFilenamePanic

func (w WordlistMetadata) LocalFilenamePanic() string

func (WordlistMetadata) LocalKiteFilename

func (w WordlistMetadata) LocalKiteFilename() (string, error)

func (WordlistMetadata) Words

func (w WordlistMetadata) Words() ([]string, error)

words will attempt to retrieve the words from the cache. If it fails, it will

Jump to

Keyboard shortcuts

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