lib

package
v0.0.0-...-a9bca5b Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortsSmall  = "80,443,8080,8443"
	PortsMedium = PortsSmall + ",81,90,591,3000,3128,8000,8008,8081,8082,8834,8888,7015,8800,8990,10000"
	PortsLarge  = PortsMedium + ",300,2082,2087,2095,4243,4993,5000,7000,7171,7396,7474,8090,8280,8880,9443"
)

Contains port collections for scanning

Variables

This section is empty.

Functions

func HostsInCIDR

func HostsInCIDR(cidr string) (ips []string, err error)

HostsInCIDR returns the IP's from a provided CIDR

func PortsFromString

func PortsFromString(ports string) ([]int, error)

PortsFromString returns a slice of ports parsed from a string

func SafeFileName

func SafeFileName(str string) string

SafeFileName return a safe string that can be used in file names

func ScreenshotPath

func ScreenshotPath(destination string, url *url.URL, path string) string

ScreenshotPath determines a full path and file name for a screenshot image

func SliceContainsInt

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

SliceContainsInt checks if a slice has an int

func SliceContainsString

func SliceContainsString(s []string, e string) bool

SliceContainsString checks if a slice has a string

func TruncateString

func TruncateString(s string, l int) string

TruncateString truncates a string for l characters

Types

type Options

type Options struct {
	// Logging
	Logger         *zerolog.Logger
	Debug          bool
	DisableLogging bool

	// Screenshots
	ScreenshotPath string

	// Generic options
	Threads    int
	NoHTTPS    bool
	NoHTTP     bool
	ServerAddr string
	BasePath   string

	// Server command
	AllowInsecureURIs bool

	// File command
	File string

	// Scan command
	ScanCidr     []string
	ScanCidrFile string
	ScanRandom   bool
	ScanPorts    string
	PortsSmall   bool
	PortsMedium  bool
	PortsLarge   bool

	// Single
	ScreenshotFileName string

	// Nessus
	NessusPluginContains []string
	NessusServiceNames   []string
	NessusPluginOutput   []string
	NessusPorts          []int

	// Nmap
	NmapFile            string
	NmapService         []string
	NmapServiceContains string
	NmapPorts           []int
	NmapScanHostnames   bool
	NmapOpenPortsOnly   bool

	// Report List
	ReportJSON     bool
	ReportCSV      bool
	PerceptionSort bool

	// Merge
	MergeDBs        []string
	MergeSourcePath string
	MergeOutputDB   string
}

Options contains all of the gowitness options

func NewOptions

func NewOptions() *Options

NewOptions returns a new options struct

func (*Options) PrepareScreenshotPath

func (opt *Options) PrepareScreenshotPath() error

PrepareScreenshotPath prepares the path to save screenshots in

type Pagination

type Pagination struct {
	DB       *gorm.DB
	CurrPage int
	Limit    int
	OrderBy  []string
}

Pagination has options for a Page

func (*Pagination) Page

func (p *Pagination) Page(data interface{}) (*PaginationPage, error)

Page pages a dataset

type PaginationPage

type PaginationPage struct {
	Count         int64
	Pages         int
	Records       interface{}
	Offset        int
	Range         int
	Limit         int
	Page          int
	PrevPage      int
	PrevPageRange []int
	NextPage      int
	NextPageRange []int
	Ordered       bool
}

PaginationPage is a sinlge, paginated page

type Processor

type Processor struct {
	Logger *zerolog.Logger

	Db                 *gorm.DB
	Chrome             *chrome.Chrome
	URL                *url.URL
	ScreenshotPath     string
	ScreenshotFileName string
	// contains filtered or unexported fields
}

Processor is a URL processing helper

func (*Processor) Gowitness

func (p *Processor) Gowitness() (err error)

Gowitness processes a URL by:

  • preflighting
  • storing
  • screenshotting
  • calculating a perception hash
  • writing a screenshot to disk

Jump to

Keyboard shortcuts

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