domfinder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ErrUpgradedError = 1 << iota
	ErrNoWebservers
	ErrApacheFetchVhosts
	ErrApacheInvalidVhosts
	ErrApacheParseVhosts
	ErrApacheNoEntries
	ErrNotImplemented
	ErrInvalidURL
)

map each error name to a unique id

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	IP   string
	Port string
	URL  *url.URL
}

Domain represents a domain we should be checking, including the necessary data to fetch it, with the included host/port proxiable op, and public ip

func (*Domain) String

func (d *Domain) String() string

type DomainFilter

type DomainFilter struct {
	IgnoreHTTP  bool   // ignore ^http urls
	IgnoreHTTPS bool   // ignore ^https urls
	IgnoreMatch string // ignore urls matching glob
	MatchOnly   string // ignore urls not matching glob
}

DomainFilter filters Finder.Domains based on query input

type Err

type Err interface {
	error
	GetCode() int
}

Err represents the custom error methods

type Finder

type Finder struct {
	// Procs is a list of procs that should match up to a running webserver. these
	// should all have bound tcp (4) sockets.
	Procs []*procfinder.Process
	// MainProc represents the main process which we are pulling information from.
	MainProc *procfinder.Process
	// Domains represents the list of domains that are valid and should be crawled.
	Domains []*Domain
	// Log is a logger which we should dump debugging info to.
	Log *log.Logger
}

Finder represents the entire domain crawl process to find domains that the server is actually hosting.

func (*Finder) Filter

func (f *Finder) Filter(cnf DomainFilter)

Filter allows end users to filter out domains from the automated domain search functionality

func (*Finder) GetDomains

func (f *Finder) GetDomains() Err

GetDomains represents all of the domains that the current webserver has virtual hosts for.

func (*Finder) GetMainWebserver

func (f *Finder) GetMainWebserver()

GetMainWebserver returns only one webserver which we should be pulling data from.

func (*Finder) GetWebservers

func (f *Finder) GetWebservers() (err error)

GetWebservers pulls only the web server processes from the process list on the server.

func (*Finder) ReadApacheVhosts

func (f *Finder) ReadApacheVhosts(raw string) error

ReadApacheVhosts interprets and parses the "httpd -S" directive entries. docs: http://httpd.apache.org/docs/current/vhosts/#directives

func (*Finder) ReadCpanelVars

func (f *Finder) ReadCpanelVars() error

ReadCpanelVars crawls through /var/cpanel/userdata/ and returns all valid domains/ports that the cPanel server is hosting

type NewErr

type NewErr struct {
	Code int
	// contains filtered or unexported fields
}

NewErr is a custom error struct representing the error with additional information

func UpgradeErr

func UpgradeErr(e error) *NewErr

UpgradeErr takes a standard error interface and upgrades it to our custom error types

func (NewErr) Error

func (e NewErr) Error() string

Error replaces the default Error method

func (NewErr) GetCode

func (e NewErr) GetCode() int

GetCode returns the code of the error, useful to reference errMsg

Jump to

Keyboard shortcuts

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