fuzz

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Banner()

BAnner: Print the banner as it is trendy for this kind of tool. thanks to: https://patorjk.com/software/taag

func Exec

func Exec(cfg Config, wg *sync.WaitGroup, substitutesStr []string)

Exec: exec the new command and send result to print function Thanks to https://medium.com/@vCabbage/go-timeout-commands-with-os-exec-commandcontext-ba0c861ed738 for execution timeout

func PerformFuzzing

func PerformFuzzing(cfg Config)

PerformFuzzing: Exec specific crafted command for each wordlist file line read

func PrintConfig

func PrintConfig(cfg Config)

PrintConfig: print configuration of cfuzz running

func PrintExec

func PrintExec(cfg Config, result ExecResult)

PrintExec: Print execution result according to configuration and filter

func PrintLine

func PrintLine(value string, element ...string)

Nice printing of a line containing 2 or more elements

Types

type CodeDisplay

type CodeDisplay struct {
}

CodeDisplay: display mode that displays field concerning exit code of command exectuion

func (CodeDisplay) DisplayString

func (code CodeDisplay) DisplayString(result ExecResult) string

DisplayString: return exit code

func (CodeDisplay) Name

func (code CodeDisplay) Name() string

type CodeSuccessFilter

type CodeSuccessFilter struct {
	Zero bool
}

CodeSuccessFilter: filter wether result regarding the exit code

func (CodeSuccessFilter) IsOk

func (filter CodeSuccessFilter) IsOk(result ExecResult) bool

IsOk: return true if the exit code is 0 and the filter is parametrize with Zero set at true. return true if the exit code is != 0 and the filter is parametrize with Zero set at false. return false otherwise

func (CodeSuccessFilter) Name

func (filter CodeSuccessFilter) Name() string

type Config

type Config struct {
	WordlistFilename string
	Wordlists        wordlists
	Keyword          string
	Command          string
	RoutineDelay     int64
	Shell            string
	Timeout          int64
	Input            string
	StdinFuzzing     bool
	Multiple         bool
	DisplayModes     []DisplayMode
	Hide             bool
	Filters          []Filter
}

func NewConfig

func NewConfig() Config

NewConfig create Config instance

func (*Config) CheckConfig

func (c *Config) CheckConfig() error

CheckConfig: assert that all required fields are present in config, and are adequate to cfuzz run

type DisplayMode

type DisplayMode interface {
	DisplayString(result ExecResult) string
	Name() string
}

DisplayMode: interface used to determine field to display in cfuzz output

type ExecResult

type ExecResult struct {
	Substitute string
	Stdout     string
	Stderr     string
	Time       time.Duration
	Code       string
	Error      error
	Timeout    bool
}

type Filter

type Filter interface {
	//IsOk: filter logic. Return true if the result pass the filter conditon
	IsOk(result ExecResult) bool
	//Name: return filter name
	Name() string
}

Filter: interface used to determine which results will be displayed

type StderrDisplay

type StderrDisplay struct {
}

StderrDisplay: display mode that displays field concerning stderr

func (StderrDisplay) DisplayString

func (stderr StderrDisplay) DisplayString(result ExecResult) string

DisplayString: return number of character in stderr

func (StderrDisplay) Name

func (stderr StderrDisplay) Name() string

type StderrEqFilter

type StderrEqFilter struct {
	Eq int
}

func (StderrEqFilter) IsOk

func (filter StderrEqFilter) IsOk(result ExecResult) bool

func (StderrEqFilter) Name

func (filter StderrEqFilter) Name() string

type StderrMaxFilter

type StderrMaxFilter struct {
	Max int
}

StderrMaxFilter: Filter that accept only result with less characters than a specific number

func (StderrMaxFilter) IsOk

func (maxFilter StderrMaxFilter) IsOk(result ExecResult) bool

IsOk: return true if the lenght of stderr errput is smaller or equal than max

func (StderrMaxFilter) Name

func (filter StderrMaxFilter) Name() string

type StderrMinFilter

type StderrMinFilter struct {
	Min int
}

StderrMaxFilter: Filter that accept only result with more characters than a specific number

func (StderrMinFilter) IsOk

func (filter StderrMinFilter) IsOk(result ExecResult) bool

IsOk: return true if the lenght of stderr errput is greater or equal than min

func (StderrMinFilter) Name

func (filter StderrMinFilter) Name() string

type StdoutDisplay

type StdoutDisplay struct {
}

StdoutDisplay: display mode that displays field concerning stdout

func (StdoutDisplay) DisplayString

func (stdout StdoutDisplay) DisplayString(result ExecResult) string

DisplayString: return number of character in stdout

func (StdoutDisplay) Name

func (stdout StdoutDisplay) Name() string

type StdoutEqFilter

type StdoutEqFilter struct {
	Eq int
}

StdoutEqFilter: filter struct that accept only result with exact amoun of characters

func (StdoutEqFilter) IsOk

func (filter StdoutEqFilter) IsOk(result ExecResult) bool

IsOK: return true if the number of characters is eqal

func (StdoutEqFilter) Name

func (filter StdoutEqFilter) Name() string

type StdoutMaxFilter

type StdoutMaxFilter struct {
	Max int
}

StdoutMaxFilter: Filter that accept only result with less characters than a specific number

func (StdoutMaxFilter) IsOk

func (maxFilter StdoutMaxFilter) IsOk(result ExecResult) bool

IsOk: return true if the lenght of stdout output is smaller or equal than max

func (StdoutMaxFilter) Name

func (filter StdoutMaxFilter) Name() string

type StdoutMinFilter

type StdoutMinFilter struct {
	Min int
}

StdoutMaxFilter: Filter that accept only result with more characters than a specific number

func (StdoutMinFilter) IsOk

func (filter StdoutMinFilter) IsOk(result ExecResult) bool

IsOk: return true if the lenght of stdout output is greater or equal than min

func (StdoutMinFilter) Name

func (filter StdoutMinFilter) Name() string

type StdoutWordFilter

type StdoutWordFilter struct {
	TargetWord string
}

StdoutWordFilter: filter struct that accept only result containing specific word

func (StdoutWordFilter) IsOk

func (filter StdoutWordFilter) IsOk(result ExecResult) bool

IsOK: return true a specific word is found in result stdout. Note that this is equivalent to grep: the word could be surrounded by non-space characters

func (StdoutWordFilter) Name

func (filter StdoutWordFilter) Name() string

Name: return StdoutWordFilter name

type TimeDisplay

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

TimeDisplay: display mode that displays field concerning stderr

func (TimeDisplay) DisplayString

func (time TimeDisplay) DisplayString(result ExecResult) string

DisplayString: return command execution time in second

func (TimeDisplay) Name

func (time TimeDisplay) Name() string

type TimeEqFilter

type TimeEqFilter struct {
	Eq int
}

func (TimeEqFilter) IsOk

func (filter TimeEqFilter) IsOk(result ExecResult) bool

func (TimeEqFilter) Name

func (filter TimeEqFilter) Name() string

type TimeMaxFilter

type TimeMaxFilter struct {
	Max int
}

func (TimeMaxFilter) IsOk

func (maxFilter TimeMaxFilter) IsOk(result ExecResult) bool

func (TimeMaxFilter) Name

func (filter TimeMaxFilter) Name() string

type TimeMinFilter

type TimeMinFilter struct {
	Min int
}

func (TimeMinFilter) IsOk

func (filter TimeMinFilter) IsOk(result ExecResult) bool

func (TimeMinFilter) Name

func (filter TimeMinFilter) Name() string

Jump to

Keyboard shortcuts

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