Documentation ¶
Index ¶
- func InitLogger(good2Handle io.Writer, good3Handle io.Writer, good4Handle io.Writer, ...)
- func LoadWords(filePath string, destChan chan string)
- func RandString() string
- func RedirectHandler(req *http.Request, via []*http.Request) error
- type ArrayStringFlag
- type Config
- type ConsoleWriter
- func (c *ConsoleWriter) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
- func (c ConsoleWriter) GetPrefix() string
- func (ConsoleWriter) New(w io.Writer, prefix string) *ConsoleWriter
- func (c *ConsoleWriter) Output(calldepth int, s string) error
- func (c *ConsoleWriter) Printf(format string, v ...interface{})
- func (c *ConsoleWriter) Println(v ...interface{})
- type HostState
- type HostStates
- func (hs *HostStates) AddHost(u *url.URL)
- func (hs *HostStates) AddSoft404Content(host string, content []byte, h *http.Response)
- func (hs *HostStates) Get404(host string) *http.Response
- func (hs *HostStates) Get404Body(host string) []byte
- func (hs HostStates) HostExists(hval string) bool
- func (hs *HostStates) Init()
- type OutLine
- type SpiderPage
- type State
- func (s *State) AddWG()
- func (gState *State) ConfigureHTTPClient(sendToBurpOnly bool) *http.Client
- func (gState *State) HTTPReq(method, path string, client *http.Client) (resp *http.Response, err error)
- func (State) Init() *State
- func (gState *State) ManageNewURLs()
- func (gState *State) ManageRequests()
- func (gState *State) OutputWriter(localPath string)
- func (gState *State) PrintBanner()
- func (gState *State) PrintOutput(message string, writer *ConsoleWriter, verboseLevel int)
- func (s *State) SetupState()
- func (gState *State) StartBusting(randURL string, u url.URL)
- func (gState *State) StartManagers()
- func (s *State) StartUI(uiWG *sync.WaitGroup, quitChan chan struct{})
- func (gState *State) StatsTracker()
- func (gState *State) StatusPrinter()
- func (s *State) StopUI()
- func (gState *State) UIPrinter()
- func (s *State) Wait()
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
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 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 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 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
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 ¶
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) 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
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) 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
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
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) 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