libgobuster

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const PATTERN = "{GOBUSTER}"

PATTERN is the pattern for wordlist replacements in pattern file

View Source
const (
	// VERSION contains the current gobuster version
	VERSION = "3.6"
)

Variables

This section is empty.

Functions

func DefaultUserAgent

func DefaultUserAgent() string

DefaultUserAgent returns the default user agent to use in HTTP requests

func GetRandomUserAgent added in v3.6.0

func GetRandomUserAgent() (string, error)

GetRandomUserAgent picks a random user agent from a predefined list

func JoinIntSlice added in v3.6.0

func JoinIntSlice(s []int) string

JoinIntSlice joins an int slice by ,

func ParseExtensionsFile added in v3.6.0

func ParseExtensionsFile(file string) ([]string, error)

func SliceContains added in v3.6.0

func SliceContains(s []int, e int) bool

SliceContains checks if an integer slice contains a specific value

Types

type BasicHTTPOptions added in v3.1.0

type BasicHTTPOptions struct {
	UserAgent       string
	Proxy           string
	NoTLSValidation bool
	Timeout         time.Duration
	RetryOnTimeout  bool
	RetryAttempts   int
	TLSCertificate  *tls.Certificate
}

BasicHTTPOptions defines only core http options

type Gobuster

type Gobuster struct {
	Opts   *Options
	Logger Logger

	Progress *Progress
	// contains filtered or unexported fields
}

Gobuster is the main object when creating a new run

func NewGobuster

func NewGobuster(opts *Options, plugin GobusterPlugin, logger Logger) (*Gobuster, error)

NewGobuster returns a new Gobuster object

func (*Gobuster) GetConfigString

func (g *Gobuster) GetConfigString() (string, error)

GetConfigString returns the current config as a printable string

func (*Gobuster) Run added in v3.2.0

func (g *Gobuster) Run(ctx context.Context) error

Run the busting of the website with the given set of settings from the command line.

type GobusterPlugin

type GobusterPlugin interface {
	Name() string
	PreRun(context.Context, *Progress) error
	ProcessWord(context.Context, string, *Progress) error
	AdditionalWords(string) []string
	GetConfigString() (string, error)
}

GobusterPlugin is an interface which plugins must implement

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient represents a http object

func NewHTTPClient

func NewHTTPClient(opt *HTTPOptions) (*HTTPClient, error)

NewHTTPClient returns a new HTTPClient

func (*HTTPClient) Request added in v3.1.0

func (client *HTTPClient) Request(ctx context.Context, fullURL string, opts RequestOptions) (int, int64, http.Header, []byte, error)

Request makes an http request and returns the status, the content length, the headers, the body and an error if you want the body returned set the corresponding property inside RequestOptions

type HTTPHeader

type HTTPHeader struct {
	Name  string
	Value string
}

HTTPHeader holds a single key value pair of a HTTP header

type HTTPOptions

type HTTPOptions struct {
	BasicHTTPOptions
	Password              string
	URL                   string
	Username              string
	Cookies               string
	Headers               []HTTPHeader
	NoCanonicalizeHeaders bool
	FollowRedirect        bool
	Method                string
}

HTTPOptions is the struct to pass in all http options to Gobuster

type Logger added in v3.6.0

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger added in v3.6.0

func NewLogger(debug bool) Logger

func (Logger) Debug added in v3.6.0

func (l Logger) Debug(v ...any)

func (Logger) Debugf added in v3.6.0

func (l Logger) Debugf(format string, v ...any)

func (Logger) Error added in v3.6.0

func (l Logger) Error(v ...any)

func (Logger) Errorf added in v3.6.0

func (l Logger) Errorf(format string, v ...any)

func (Logger) Fatal added in v3.6.0

func (l Logger) Fatal(v ...any)

func (Logger) Fatalf added in v3.6.0

func (l Logger) Fatalf(format string, v ...any)

func (Logger) Fatalln added in v3.6.0

func (l Logger) Fatalln(v ...any)

func (Logger) Info added in v3.6.0

func (l Logger) Info(v ...any)

func (Logger) Infof added in v3.6.0

func (l Logger) Infof(format string, v ...any)

func (Logger) Print added in v3.6.0

func (l Logger) Print(v ...any)

func (Logger) Printf added in v3.6.0

func (l Logger) Printf(format string, v ...any)

func (Logger) Println added in v3.6.0

func (l Logger) Println(v ...any)

type Message added in v3.6.0

type Message struct {
	Level   MessageLevel
	Message string
}

type MessageLevel added in v3.6.0

type MessageLevel int
const (
	LevelDebug MessageLevel = iota
	LevelInfo
	LevelError
)

type Options

type Options struct {
	Threads        int
	Debug          bool
	Wordlist       string
	WordlistOffset int
	PatternFile    string
	Patterns       []string
	OutputFilename string
	NoStatus       bool
	NoProgress     bool
	NoError        bool
	Quiet          bool
	Verbose        bool
	Delay          time.Duration
}

Options holds all options that can be passed to libgobuster

func NewOptions

func NewOptions() *Options

NewOptions returns a new initialized Options object

type ProcessFunc

type ProcessFunc func(*Gobuster, string) ([]Result, error)

ProcessFunc is the "process" function prototype for implementations

type Progress added in v3.2.0

type Progress struct {
	ResultChan  chan Result
	ErrorChan   chan error
	MessageChan chan Message
	// contains filtered or unexported fields
}

func NewProgress added in v3.2.0

func NewProgress() *Progress

func (*Progress) IncrementTotalRequests added in v3.2.0

func (p *Progress) IncrementTotalRequests(by int)

func (*Progress) RequestsExpected added in v3.2.0

func (p *Progress) RequestsExpected() int

func (*Progress) RequestsIssued added in v3.2.0

func (p *Progress) RequestsIssued() int

type RequestOptions added in v3.1.0

type RequestOptions struct {
	Host                     string
	Body                     io.Reader
	ReturnBody               bool
	ModifiedHeaders          []HTTPHeader
	UpdatedBasicAuthUsername string
	UpdatedBasicAuthPassword string
}

RequestOptions is used to pass options to a single individual request

type Result

type Result interface {
	ResultToString() (string, error)
}

Result is an interface for the Result object

type ResultToStringFunc

type ResultToStringFunc func(*Gobuster, *Result) (*string, error)

ResultToStringFunc is the "to string" function prototype for implementations

type Set added in v3.2.0

type Set[T comparable] struct {
	Set map[T]bool
}

Set is a set of Ts

func NewSet added in v3.2.0

func NewSet[T comparable]() Set[T]

NewSSet creates a new initialized Set

func ParseCommaSeparatedInt added in v3.6.0

func ParseCommaSeparatedInt(inputString string) (Set[int], error)

ParseCommaSeparatedInt parses the status codes provided as a comma separated list

func ParseExtensions added in v3.6.0

func ParseExtensions(extensions string) (Set[string], error)

ParseExtensions parses the extensions provided as a comma separated list

func (*Set[T]) Add added in v3.2.0

func (set *Set[T]) Add(s T) bool

Add an element to a set

func (*Set[T]) AddRange added in v3.2.0

func (set *Set[T]) AddRange(ss []T)

AddRange adds a list of elements to a set

func (*Set[T]) Contains added in v3.2.0

func (set *Set[T]) Contains(s T) bool

Contains tests if an element is in a set

func (*Set[T]) ContainsAny added in v3.2.0

func (set *Set[T]) ContainsAny(ss []T) bool

ContainsAny checks if any of the elements exist

func (*Set[T]) Length added in v3.2.0

func (set *Set[T]) Length() int

Length returns the length of the Set

func (*Set[T]) Stringify added in v3.2.0

func (set *Set[T]) Stringify() string

Stringify the set

type SetupFunc

type SetupFunc func(*Gobuster) error

SetupFunc is the "setup" function prototype for implementations

Jump to

Keyboard shortcuts

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