librecursebuster

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: Unlicense Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(
	good2Handle io.Writer,
	good3Handle io.Writer,
	good4Handle io.Writer,
	good5Handle io.Writer,
	goodxHandle io.Writer,
	infoHandle io.Writer,
	debugHandle io.Writer,
	warningHandle io.Writer,
	statusHandle io.Writer,
	errorHandle io.Writer)

InitLogger initialises the output writer stuff

func LoadWords

func LoadWords(filePath string, destChan chan string)

LoadWords asynchronously loads in words to a channel. Expects the channel to either be big enough to load the whole file, or that it will be streamed from as the file is opened and read from.

func RandString

func RandString() string

RandString will return a UUID

func RedirectHandler

func RedirectHandler(req *http.Request, via []*http.Request) error

RedirectHandler dictates the way to handle redirects.

Types

type ArrayStringFlag

type ArrayStringFlag []string

ArrayStringFlag is used to be able to supply more than one flag at the command line (for the -header option)

func (*ArrayStringFlag) Get

func (i *ArrayStringFlag) Get() []string

Get the Values stored (required for the interface)

func (*ArrayStringFlag) Set

func (i *ArrayStringFlag) Set(value string) error

Set the value. Appends to the current state. (required for the interface)

func (*ArrayStringFlag) String

func (i *ArrayStringFlag) String() string

type Config

type Config struct {
	Agent             string
	Ajax              bool
	AppendDir         bool
	Auth              string
	BadResponses      string
	GoodResponses     string
	BadHeader         ArrayStringFlag
	BodyContent       string
	BlacklistLocation string
	BurpMode          bool
	Canary            string
	CleanOutput       bool
	Cookies           string
	Debug             bool
	Extensions        string
	FollowRedirects   bool
	Headers           ArrayStringFlag
	HTTPS             bool
	InputList         string
	Localpath         string
	//MaxDirs           int
	Methods           string
	NoBase            bool
	NoGet             bool
	NoEncode          bool
	NoHead            bool
	NoRecursion       bool
	NoRobots          bool
	NoSpider          bool
	NoStatus          bool
	NoStartStop       bool
	NoUI              bool
	NoWildcardChecks  bool
	ProxyAddr         string
	Ratio404          float64
	ShowAll           bool
	ShowLen           bool
	ShowVersion       bool
	SSLIgnore         bool
	Threads           int
	Timeout           int
	URL               string
	VerboseLevel      int
	Version           string
	Vhost             string
	WhitelistLocation string
	Wordlist          string
}

Config represents the configuration supplied at runtime. Different to program State which can change, this is set once, and only queried during program operation.

type ConsoleWriter

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

ConsoleWriter is pretty much a straight rip from the go project's log writer, but modified as needed https://golang.org/src/log/log.go

var (
	Good2 *ConsoleWriter //*log.Logger
	Good3 *ConsoleWriter //*log.Logger
	Good4 *ConsoleWriter //*log.Logger
	Good5 *ConsoleWriter //*log.Logger
	Goodx *ConsoleWriter //*log.Logger

	Info   *ConsoleWriter
	Debug  *ConsoleWriter
	Error  *ConsoleWriter
	Status *ConsoleWriter
)

All the ConsoleWriter stuff can probably be abstracted into an interface :thinkingemoji:

func (*ConsoleWriter) Fprintf added in v1.5.0

func (c *ConsoleWriter) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)

Fprintf is a helper function, will write the format (time etc) using the the supplied writer

func (ConsoleWriter) GetPrefix added in v1.5.0

func (c ConsoleWriter) GetPrefix() string

GetPrefix returns the prefix unfiltered

func (ConsoleWriter) New

func (ConsoleWriter) New(w io.Writer, prefix string) *ConsoleWriter

New creates a new Console writer. The prefix appears at the beginning of each generated log line.

func (*ConsoleWriter) Output

func (c *ConsoleWriter) Output(calldepth int, s string) error

Output writes the output for an event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2.

func (*ConsoleWriter) Printf

func (c *ConsoleWriter) Printf(format string, v ...interface{})

Printf calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.

func (*ConsoleWriter) Println

func (c *ConsoleWriter) Println(v ...interface{})

Println calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Println.

type HostState

type HostState struct {
	ParsedURL           *url.URL
	Response404         *http.Response
	Soft404ResponseBody []byte
}

HostState is the actual state of each host (wow this is confusing and should be broken into different state files imo)

type HostStates

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

HostStates represents the interface to the Host States..? (all this smells of bad hacks)

func (*HostStates) AddHost

func (hs *HostStates) AddHost(u *url.URL)

AddHost adds a host to the hosts lol

func (*HostStates) AddSoft404Content

func (hs *HostStates) AddSoft404Content(host string, content []byte, h *http.Response)

AddSoft404Content sets the soft404 content retreived using the canary request to be compared against during the hacking phase

func (*HostStates) Get404 added in v1.5.3

func (hs *HostStates) Get404(host string) *http.Response

Get404 returns the stored known-not-good response

func (*HostStates) Get404Body

func (hs *HostStates) Get404Body(host string) []byte

Get404Body returns the stored known-not-good body from a response

func (HostStates) HostExists

func (hs HostStates) HostExists(hval string) bool

HostExists checks to see if the host string specified exists within the hosts states??

func (*HostStates) Init

func (hs *HostStates) Init()

Init initialises the map because apparently OO is hard to do

type OutLine

type OutLine struct {
	Content string
	Level   int //Define the log/verbosity level. 0 is normal, 1 is higher verbosity etc
	Type    *ConsoleWriter
}

OutLine represents some form of console output. Should consist of the content to output, the type of output and the verbosity level.

type SpiderPage

type SpiderPage struct {
	URL       string
	Result    *http.Response
	Reference *url.URL //where did we get this URL from? (for the logic portion)
}

SpiderPage represents a 'working' page object, represented by an URL and it's (optional)result.

type State

type State struct {

	//global State values
	Client         *http.Client
	BurpClient     *http.Client
	Cfg            *Config
	TotalTested    *uint64
	PerSecondShort *uint64 //how many tested over 2 seconds or so
	PerSecondLong  *uint64

	StartTime     time.Time
	Blacklist     map[string]bool
	Whitelist     map[string]bool
	BadResponses  map[int]bool //response codes to consider *dont care* (this might be worth putting in per host state, but idk how)
	GoodResponses map[int]bool //response codes to consider *only care*
	Extensions    []string
	Methods       []string
	//	WordlistLen    *uint32
	WordList     []string
	DirbProgress *uint32

	StopDir chan struct{} //should probably have all the chans in here

	Checked map[string]bool
	CMut    *sync.RWMutex

	StartWG *sync.WaitGroup

	//per host States
	Hosts HostStates
	Chans *chans
	//ParsedURL           *url.URL
	//Soft404ResponseBody []byte
	Version string
	// contains filtered or unexported fields
}

State represents the current state of the program. Options are not configured here, those are found in Config.

func (*State) AddWG added in v1.5.7

func (s *State) AddWG()

AddWG adds a single value to the state waitgroup

func (*State) ConfigureHTTPClient added in v1.5.14

func (gState *State) ConfigureHTTPClient(sendToBurpOnly bool) *http.Client

ConfigureHTTPClient configures and returns a HTTP Client (mostly useful to be able to send to burp)

func (*State) HTTPReq added in v1.5.14

func (gState *State) HTTPReq(method, path string, client *http.Client) (resp *http.Response, err error)

HTTPReq sends the HTTP request based on the given settings, returns the response and the body todo: This can probably be optimized to exit once the head has been retreived and discard the body

func (State) Init added in v1.5.7

func (State) Init() *State

Init returns a new state value with initialised attributes

func (*State) ManageNewURLs added in v1.5.14

func (gState *State) ManageNewURLs()

ManageNewURLs will take in any URL, and decide if it should be added to the queue for bustin', or if we discovered something new

func (*State) ManageRequests added in v1.5.14

func (gState *State) ManageRequests()

ManageRequests handles the request workers

func (*State) OutputWriter added in v1.5.14

func (gState *State) OutputWriter(localPath string)

OutputWriter will write to a file and the screen

func (*State) PrintBanner added in v1.5.14

func (gState *State) PrintBanner()

PrintBanner prints the banner and in debug mode will also print all set options

func (*State) PrintOutput added in v1.5.14

func (gState *State) PrintOutput(message string, writer *ConsoleWriter, verboseLevel int)

PrintOutput used to send output to the screen

func (*State) SetupState added in v1.5.14

func (s *State) SetupState()

SetupState will perform all the basic state setup functions (adding URL's to the blacklist etc)

func (*State) StartBusting added in v1.5.14

func (gState *State) StartBusting(randURL string, u url.URL)

StartBusting will add a suppllied url to the queue to be tested

func (*State) StartManagers added in v1.6.0

func (gState *State) StartManagers()

StartManagers is the function that starts all the management goroutines

func (*State) StartUI added in v1.5.0

func (s *State) StartUI(uiWG *sync.WaitGroup, quitChan chan struct{})

StartUI is called to begin the UI... stuff

func (*State) StatsTracker added in v1.5.14

func (gState *State) StatsTracker()

StatsTracker updates the stats every so often

func (*State) StatusPrinter added in v1.5.14

func (gState *State) StatusPrinter()

StatusPrinter is the function that performs all the status printing logic

func (*State) StopUI added in v1.5.14

func (s *State) StopUI()

StopUI should be called when closing the program. It prints out the lines in the main view buffer to stdout, and closes the ui object

func (*State) UIPrinter added in v1.5.14

func (gState *State) UIPrinter()

UIPrinter is called to write a pretty UI

func (*State) Wait added in v1.5.7

func (s *State) Wait()

Wait will wait until all the relevant waitgroups have completed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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