probe

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DangerousMethods = map[string]bool{
	"DELETE":     true,
	"COPY":       true,
	"PUT":        true,
	"PATCH":      true,
	"UNCHECKOUT": true,
}

DangerousMethods lists methods that could be harmful to test

View Source
var DefaultMethods = []string{
	"CHECKIN", "CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "INDEX",
	"LINK", "LOCK", "MKCOL", "MOVE", "NOEXISTE", "OPTIONS", "ORDERPATCH",
	"PATCH", "POST", "PROPFIND", "PROPPATCH", "PUT", "REPORT", "SEARCH",
	"SHOWMETHOD", "SPACEJUMP", "TEXTSEARCH", "TRACE", "TRACK", "UNCHECKOUT",
	"UNLINK", "UNLOCK", "VERSION-CONTROL", "BAMBOOZLE",
}

DefaultMethods is the built-in list of HTTP methods to test

Functions

func Run

func Run(config Config) error

Run executes the HTTP methods probe with the given configuration

Types

type Config

type Config struct {
	URL         string
	Verbose     bool
	Quiet       bool
	Insecure    bool
	FollowRedir bool
	SafeOnly    bool
	Wordlist    string
	Threads     int
	JSONFile    string
	Proxy       string
	Cookies     string
	Headers     []string
	InputFile   string
	CookieJar   string
	Timeout     int // in seconds
}

Config holds the configuration options for the HTTP probe

type LogLevel

type LogLevel string

LogLevel represents different logging levels

const (
	LevelDebug   LogLevel = "DEBUG"
	LevelInfo    LogLevel = "*"
	LevelSuccess LogLevel = "+"
	LevelWarning LogLevel = "-"
	LevelError   LogLevel = "!"
)

type Logger

type Logger struct {
	Verbose bool
	Quiet   bool
}

Logger structure with configuration options

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...any)

Debug logs debug information (when verbose is true)

func (*Logger) Error

func (l *Logger) Error(format string, args ...any)

Error logs error information (unless quiet is true)

func (*Logger) Info

func (l *Logger) Info(format string, args ...any)

Info logs general information (unless quiet is true)

func (*Logger) Success

func (l *Logger) Success(format string, args ...any)

Success logs success information (unless quiet is true)

func (*Logger) Warning

func (l *Logger) Warning(format string, args ...any)

Warning logs warning information (unless quiet is true)

type Result

type Result struct {
	StatusCode int    `json:"status_code"`
	Length     int    `json:"length"`
	Reason     string `json:"reason"`
}

Result represents the result of an HTTP method test

Jump to

Keyboard shortcuts

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