libgograbber

package
v0.0.0-...-1991406 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Good    *log.Logger
	Info    *log.Logger
	Warning *log.Logger
	Debug   *log.Logger
	Error   *log.Logger
)

Functions

func ApplyJitter

func ApplyJitter(Jitter int)

func ChunkString

func ChunkString(s string, chunkSize int) []string

func ConnectHost

func ConnectHost(wg *sync.WaitGroup, timeout time.Duration, Jitter int, debug bool, host Host, results chan Host, threads chan struct{}, writeChan chan []byte)

connectHost does the actual TCP connection

func GenerateURLs

func GenerateURLs(targetList StringSet, Ports IntSet, Paths *StringSet, targets chan Host)

func GetDataFromFile

func GetDataFromFile(fileName string) (data []string, err error)

func GetTimeString

func GetTimeString() (currTime string)

func HTTPGetter

func HTTPGetter(wg *sync.WaitGroup, host Host, debug bool, Jitter int, soft404Detection bool, statusCodesIgn IntSet, Ratio float64, path string, results chan Host, threads chan struct{}, ProjectName string, responseDirectory string, writeChan chan []byte, followRedirects bool)

func Hosts

func Hosts(cidr string) ([]string, error)

func InitColours

func InitColours()

func InitLogger

func InitLogger(
	goodHandle io.Writer,
	infoHandle io.Writer,
	debugHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

func Initialise

func Initialise(s *State, ports string, wordlist string, statusCodesIgn string, protocols string, timeout int, AdvancedUsage bool, easy bool, HostHeaderFile string)

Initialise sets up the program's state

func LeftPad2Len

func LeftPad2Len(s string, padStr string, overallLen int) string

LeftPad2Len https://github.com/DaddyOh/golang-samples/blob/master/pad.go

func LineSep

func LineSep() string

func MarkdownReport

func MarkdownReport(s *State, targets chan Host) string

func ParseURLToHost

func ParseURLToHost(URL string, targets chan Host)

func PrintBanner

func PrintBanner(s *State)

PrintBanner prints the banner... HOW GOOD IS THE BANNER?

func PrintOpts

func PrintOpts(s *State)

func RandString

func RandString() string

func RightPad2Len

func RightPad2Len(s string, padStr string, overallLen int) string

RightPad2Len https://github.com/DaddyOh/golang-samples/blob/master/pad.go

func RoutineManager

func RoutineManager(s *State, ScanChan chan Host, DirbustChan chan Host, ScreenshotChan chan Host, wg *sync.WaitGroup)

func SanitiseFilename

func SanitiseFilename(UnsanitisedFilename string) string

func ScreenshotAURL

func ScreenshotAURL(wg *sync.WaitGroup, s *State, cnt int, host Host, results chan Host, threads chan struct{}) (err error)

Screenshots a url derived from a Host{} object

func Start

func Start(s State)

Start does the thing

func StrArrToInt

func StrArrToInt(t []string) (t2 []int)

Taken from gobuster - THANKS! /**/ StrArrToInt takes an array of strings and *hopefully* returns an array of ints?

func StringWithCharset

func StringWithCharset(length int, charset string) string

Types

type Host

type Host struct {
	Path                      string
	HostAddr                  string
	Port                      int
	Protocol                  string
	ScreenshotFilename        string
	ResponseBodyFilename      string
	Soft404RandomURL          string
	Soft404RandomPageContents []string
	PrefetchDone              bool
	Soft404Done               bool
	HTTPResp                  *http.Response
	HTTPReq                   *http.Request
	HostHeader                string
	UserAgent                 string
	Cookies                   string
}

func (*Host) PrefetchDoneCheck

func (host *Host) PrefetchDoneCheck(hashes map[string]bool) bool

func (*Host) PrefetchHash

func (host *Host) PrefetchHash() (h string)

func (*Host) Soft404DoneCheck

func (host *Host) Soft404DoneCheck(hashes map[string]bool) bool

func (*Host) Soft404Hash

func (host *Host) Soft404Hash() (h string)

type IntSet

type IntSet struct {
	Set map[int]bool
}

Shim type for "set" containing ints

func UnpackPortString

func UnpackPortString(ports string) (ProcessedPorts IntSet)

func (*IntSet) Add

func (set *IntSet) Add(i int) bool

Add an element to a set

func (*IntSet) Contains

func (set *IntSet) Contains(i int) bool

Test if an element is in a set

func (*IntSet) Stringify

func (set *IntSet) Stringify() string

Stringify the set

type State

type State struct {
	Canary                 string
	Cookies                string
	Expanded               bool
	Extensions             []string
	FollowRedirect         bool
	PhantomProcesses       []phantomjs.Process
	ScreenshotQuality      int
	ScreenshotDirectory    string
	ScreenshotFileType     string
	FollowRedirects        bool
	ReportDirectory        string
	HostHeaders            StringSet
	ScanOutputDirectory    string
	ProjectName            string
	DirbustOutputDirectory string
	IncludeLength          bool
	NumPhantomProcs        int
	HttpClient             *http.Client
	HTTPResponseDirectory  string
	Ratio                  float64
	Soft404Detection       bool
	Soft404Method          int
	PrefetchedHosts        map[string]bool
	Soft404edHosts         map[string]bool
	NoStatus               bool
	Hosts                  StringSet
	InputFile              string
	Debug                  bool
	ExcludeList            []string
	Password               string
	Ports                  IntSet
	Jitter                 int
	Sleep                  float64
	Timeout                time.Duration
	VerbosityLevel         int
	ShowIPs                bool
	Protocols              StringSet
	StatusCodes            IntSet
	IgnoreSSLErrors        bool
	StatusCodesIgn         IntSet
	ImgX                   int
	ImgY                   int
	Screenshot             bool
	Threads                int
	URLFile                string
	URLProvided            bool
	Dirbust                bool
	SingleURL              string
	PhantomJSPath          string
	URLComponents          []Host
	Targets                chan Host
	Paths                  StringSet
	UseSlash               bool
	Scan                   bool
	UserAgent              string
	Username               string
	OutputChan             chan string
	Verbose                bool
	Wordlist               string
	Version                string
	OutputDirectory        string
	StartTime              time.Time
}

type StringSet

type StringSet struct {
	Set map[string]bool
}

Shim type for "set" containing strings

func ExpandHosts

func ExpandHosts(targets []string) (allHosts StringSet)

ExpandHosts takes a string array of IP addresses/CIDR masks and converts into a string array of pure IP addresses

func (*StringSet) Add

func (set *StringSet) Add(s string) bool

Add an element to a set

func (*StringSet) AddRange

func (set *StringSet) AddRange(ss []string)

Add a list of elements to a set

func (*StringSet) Contains

func (set *StringSet) Contains(s string) bool

Test if an element is in a set

func (*StringSet) ContainsAny

func (set *StringSet) ContainsAny(ss []string) bool

Check if any of the elements exist

func (*StringSet) Stringify

func (set *StringSet) Stringify() string

Stringify the set

type TargetHost

type TargetHost chan struct{}

Jump to

Keyboard shortcuts

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