Documentation ¶
Index ¶
- Constants
- Variables
- func Base64Decode(text string) ([]byte, error)
- func Base64Encode(text string) string
- func Build404URL(original string) (string, error)
- func BuildURLWithParam(original string, param string, payload string, urlEncode bool) (string, error)
- func BytesCountToHumanReadable(b int64) string
- func CalculateURLDepth(rawURL string) int
- func CapitalizeFirstLetter(input string) string
- func CloneMultipartFileHeader(fh *multipart.FileHeader) *multipart.FileHeader
- func CloneMultipartForm(f *multipart.Form) *multipart.Form
- func CloneURL(u *url.URL) *url.URL
- func CloneURLValues(v url.Values) url.Values
- func Colorize(text, color string) string
- func ComputeSimilarity(aBody, bBody []byte) float64
- func Contains(slice []string, item string) bool
- func ContainsAnySubstring(original string, substrings []string) bool
- func ContainsAnySubstringIgnoreCase(original string, substrings []string) bool
- func DecodeBase36(s string) (int64, error)
- func DeepCopy(src, dest interface{}) error
- func DoWorkWithTimeout(fn interface{}, params []interface{}, timeout time.Duration) (interface{}, error)
- func EnsureCertificatesExist(certPath, keyPath, caCertPath, caKeyPath string) (*tls.Config, *tls.Config, error)
- func EscapeDots(input string) string
- func FilterOutString(slice []string, target string) []string
- func FormatOutput[T Formattable](data []T, format FormatType) (string, error)
- func FormatOutputToFile[T Formattable](data []T, format FormatType, filepath string) error
- func FormatSingleOutput[T Formattable](data T, format FormatType) (string, error)
- func GenerateCertificates(...) (*tls.Config, *tls.Config, error)
- func GenerateRandInt(min, max int) int
- func GenerateRandomLowercaseString(length int) string
- func GenerateRandomString(length int) string
- func GetBaseURL(urlStr string) (string, error)
- func GetHostFromURL(u string) (string, error)
- func GetIPFromURL(urlStr string) ([]net.IP, error)
- func GetLastPathSegment(rawurl string) (string, error)
- func GetParametersToTest(path string, params []string, testAllParams bool) (parametersToTest []string)
- func GetParentURL(urlStr string) (string, bool, error)
- func GetURLWithoutQueryString(urlStr string) (string, error)
- func GetUniqueBaseURLs(urls []string) ([]string, error)
- func GetUniqueItems(items []string) []string
- func HashBytes(data []byte) string
- func IsRootURL(urlStr string) (bool, error)
- func JoinURLPath(baseURL, urlPath string) string
- func LocalFileExists(path string) bool
- func NormalizeURL(urlStr string) (string, error)
- func NormalizeURLParams(rawURL string) (string, error)
- func NormalizeURLPath(urlStr string) (string, error)
- func NormalizeURLPathWithProvidedString(urlStr string, providedString string) (string, error)
- func ParseHeadersStringToMap(headersStr string) map[string][]string
- func ProcessString(input string, processors []StringProcessor) (string, error)
- func ReadFileByLines(filename string) ([]string, error)
- func ResolveDomain(domain string) ([]net.IP, error)
- func SetupCloseHandler()
- func SliceContains(slice []string, item string) bool
- func SliceContainsInt(slice []int, item int) bool
- func SliceContainsUint(slice []uint, item uint) bool
- func SlicesIntersect(slice1, slice2 []string) bool
- func Slugify(text string) string
- func StringsSliceToText(items []string) string
- func ZeroConsoleAndFileLog() zerolog.Logger
- func ZeroConsoleLog() zerolog.Logger
- type ActionLogger
- type DataType
- type Fingerprint
- type FormatType
- type Formattable
- type LogEntry
- type LogLevel
- type ParameterAuditItem
- type ParameterValidValue
- type ProcessError
- type StringOperation
- type StringProcessor
Constants ¶
const ( ResetColor = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Purple = "\033[35m" Cyan = "\033[36m" White = "\033[37m" )
ANSI color codes
const DefaultRandomStringsCharset = "abcdedfghijklmnopqrstABCDEFGHIJKLMNOP"
DefaultRandomStringsCharset Default charset used for random string generation
const (
LogTimeFormat = "2006-01-02T15:04:05.000"
)
Variables ¶
var TimeoutError = errors.New("operation timed out")
TimeoutError is returned when the operation times out
Functions ¶
func Base64Decode ¶
Helper function to base64 decode a string
func Base64Encode ¶
Base64Encode just returns a text encoded to base 64
func Build404URL ¶
Build404URL Adds a randomly generated path to the URL to fingerprint 404 errors
func BuildURLWithParam ¶
func BuildURLWithParam(original string, param string, payload string, urlEncode bool) (string, error)
BuildURLWithParam builds a URL with the provided parameter and payload
func BytesCountToHumanReadable ¶
BytesCountToHumanReadable converts bytes to a human-readable string format.
func CalculateURLDepth ¶
CalculateURLDepth calculates the depth of a URL. Returns -1 if the URL is invalid.
func CapitalizeFirstLetter ¶
CapitalizeFirstLetter capitalizes the first letter of a string
func CloneMultipartFileHeader ¶
func CloneMultipartFileHeader(fh *multipart.FileHeader) *multipart.FileHeader
func ComputeSimilarity ¶
func ContainsAnySubstring ¶
ContainsAnySubstring checks if any string from the list appears as a substring in the original string
func ContainsAnySubstringIgnoreCase ¶
ContainsAnySubstringIgnoreCase checks if any string from the list appears as a substring in the original string, ignoring case differences
func DecodeBase36 ¶
DecodeBase36 decodes a Base36 string to an integer
func DoWorkWithTimeout ¶
func EnsureCertificatesExist ¶
func FilterOutString ¶
FilterOutString removes all instances of target from the slice.
func FormatOutput ¶
func FormatOutput[T Formattable](data []T, format FormatType) (string, error)
func FormatOutputToFile ¶
func FormatOutputToFile[T Formattable](data []T, format FormatType, filepath string) error
func FormatSingleOutput ¶
func FormatSingleOutput[T Formattable](data T, format FormatType) (string, error)
func GenerateCertificates ¶
func GenerateRandInt ¶
GenerateRandInt generates a random integer between min and max
func GenerateRandomString ¶
GenerateRandomString returns a random string of the defined length
func GetBaseURL ¶
GetBaseURL extracts the base URL from a URL string.
func GetHostFromURL ¶
GetHostFromURL extracts the host from the given URL.
func GetIPFromURL ¶
GetIPFromURL takes a URL string, parses it to extract the host, and then resolves the host to IP addresses.
func GetLastPathSegment ¶
func GetParametersToTest ¶
func GetParametersToTest(path string, params []string, testAllParams bool) (parametersToTest []string)
GetParametersToTest returns a list of parameters to test based on the provided path and params
func GetParentURL ¶
GetParentURL returns the parent URL for the given URL. If the given URL is already a parent URL, the function returns true as the second return value.
func GetURLWithoutQueryString ¶
GetURLWithoutQueryString returns the base URL from the given URL by removing the query string
func GetUniqueBaseURLs ¶
GetUniqueBaseURLs parses a list of URLs and returns a slice of unique base URLs.
func GetUniqueItems ¶
GetUniqueItems takes a slice of strings and returns a new slice with unique items.
func JoinURLPath ¶
JoinURLPath joins a base URL and a URL path.
func LocalFileExists ¶
func NormalizeURL ¶
NormalizeURL normalizes the URL by adding an "X" to the last path segment and replacing the query parameter values with "X".
func NormalizeURLParams ¶
NormalizeURLParams normalizes the URL parameters by appending an "X" to each value.
func NormalizeURLPath ¶
NormalizeURLPath normalizes the URL path by replacing the last segment with "X".
func ParseHeadersStringToMap ¶
ParseHeadersStringToMap parses a string containing key-value pairs separated by commas into a map[string][]string
func ProcessString ¶
func ProcessString(input string, processors []StringProcessor) (string, error)
ProcessString applies a chain of processors to an input string
func ReadFileByLines ¶
func ResolveDomain ¶
ResolveDomain takes a domain name and returns its IP addresses.
func SetupCloseHandler ¶
func SetupCloseHandler()
SetupCloseHandler creates a 'listener' on a new goroutine which will notify the program if it receives an interrupt from the OS. We then handle this by calling our clean up procedure and exiting the program.
func SliceContains ¶
SliceContains utility function to check if a slice of strings contains the specified string
func SliceContainsInt ¶
SliceContainsInt utility function to check if a slice of integers contains the specified integer
func SliceContainsUint ¶
SliceContainsUint utility function to check if a slice of uints contains the specified uint
func SlicesIntersect ¶
SlicesIntersect checks if any element of the first slice is present in the second slice.
func StringsSliceToText ¶
StringsSliceToText iterates a slice of strings to generate a text list, mainly for reporting
func ZeroConsoleLog ¶
Types ¶
type ActionLogger ¶
type ActionLogger struct {
// contains filtered or unexported fields
}
ActionLogger is a custom logger that captures log entries
func NewActionLogger ¶
func NewActionLogger() *ActionLogger
NewActionLogger creates a new ActionLogger instance
func (*ActionLogger) ClearLogs ¶
func (l *ActionLogger) ClearLogs()
ClearLogs clears the captured logs
func (*ActionLogger) GetLogs ¶
func (l *ActionLogger) GetLogs() []LogEntry
GetLogs returns the captured logs
func (*ActionLogger) Log ¶
func (l *ActionLogger) Log(level LogLevel, text string) error
Log adds a new log entry
func (*ActionLogger) PrintLogs ¶
func (l *ActionLogger) PrintLogs()
PrintLogs prints all logs to the console
type DataType ¶
type DataType string
const ( TypeInt DataType = "Integer" TypeFloat DataType = "Float" TypeJSON DataType = "JSON" TypeXML DataType = "XML" TypeSVG DataType = "SVG" TypeDate1 DataType = "Date (YYYY-MM-DD)" TypeDate2 DataType = "Date (MM/DD/YYYY)" TypeArray DataType = "Array" TypeBoolean DataType = "Boolean" TypeEmail DataType = "Email" TypeURL DataType = "URL" TypeBase64 DataType = "Base64" TypeBase32 DataType = "Base32" TypeBase36 DataType = "Base36" TypeUUID DataType = "UUID" TypeHex DataType = "Hexadecimal" TypeHTML DataType = "HTML" TypeJSCode DataType = "JavaScript Code" TypeString DataType = "String" )
func GuessDataType ¶
type Fingerprint ¶
func (*Fingerprint) BuildCPE ¶
func (f *Fingerprint) BuildCPE() (string, error)
func (*Fingerprint) GetNucleiTags ¶
func (f *Fingerprint) GetNucleiTags() string
type FormatType ¶
type FormatType string
const ( Pretty FormatType = "pretty" Text FormatType = "text" JSON FormatType = "json" YAML FormatType = "yaml" Table FormatType = "table" )
func ParseFormatType ¶
func ParseFormatType(format string) (FormatType, error)
ParseFormatType converts a string format to a FormatType.
type Formattable ¶
type LogEntry ¶
type LogEntry struct { Level LogLevel `json:"level"` Text string `json:"text"` Timestamp time.Time `json:"timestamp"` }
LogEntry represents a single log message
type ParameterAuditItem ¶
type ParameterAuditItem struct { Parameter string Payload string URL string TestURL string URLEncode bool }
ParameterAuditItem struct
type ParameterValidValue ¶
ParameterValidValue struct
type ProcessError ¶
type ProcessError struct { Operation StringOperation Message string Err error }
ProcessError wraps errors that occur during processing
func (*ProcessError) Error ¶
func (e *ProcessError) Error() string
type StringOperation ¶
type StringOperation string
StringOperation defines the type of operation to be performed
const ( Base64EncodeOperation StringOperation = "base64encode" Base64DecodeOperation StringOperation = "base64decode" URLEncodeOperation StringOperation = "urlencode" URLDecodeOperation StringOperation = "urldecode" SHA1HashOperation StringOperation = "sha1hash" SHA256HashOperation StringOperation = "sha256hash" SHA512HashOperation StringOperation = "sha512hash" MD5HashOperation StringOperation = "md5hash" )
type StringProcessor ¶
type StringProcessor struct { Type StringOperation `json:"type"` Description string `json:"description"` }
StringProcessor represents a single processing operation