utils

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextSpecificMagic = map[string][]string{
	"html": {"<", ">", "'", "\"", "&"},
	"js":   {"'", "\"", ";", "{", "}", "(", ")", "`"},
	"css":  {"{", "}", ";", ":", "/*", "*/", "'", "\""},
	"url":  {"&", "=", "?", "#", "%", "+", " "},
	"json": {"{", "}", "[", "]", ":", ",", "\""},
	"xml":  {"<", ">", "&", "'", "\""},
	"sql":  {"'", "\"", ";", "--", "/*", "*/", "(", ")"},
}

ContextSpecificMagic contains magic characters for specific contexts

View Source
var MagicCharacters = []string{
	"'", "\"", "<", ">", "&", ";", "(", ")", "{", "}", "[", "]",
	"`", "~", "!", "@", "#", "$", "%", "^", "*", "+", "=",
	"|", "\\", "/", "?", ":", ",", ".", " ", "\t", "\n", "\r",
}

MagicCharacters contains special characters for manual XSS testing

Functions

func CheckPType

func CheckPType(str string) bool

func ContainsFromArray

func ContainsFromArray(slice []string, item string) bool

func DetectContext added in v2.12.0

func DetectContext(response string, param string, value string) string

DetectContext attempts to detect the context where a parameter appears

func DuplicatedResult

func DuplicatedResult(result []model.PoC, rst model.PoC) bool

func GenerateMagicCharacter added in v2.12.0

func GenerateMagicCharacter(context string) string

GenerateMagicCharacter generates a magic character based on context

func GenerateMagicString added in v2.12.0

func GenerateMagicString(context string, length int) string

GenerateMagicString generates a string with multiple magic characters

func GenerateRandomToken

func GenerateRandomToken(url string) string

GenerateRandomToken is make scan id

func GenerateTerminalWidthLine

func GenerateTerminalWidthLine(char string) string

GenerateTerminalWidthLine generates a string that fills the terminal width with the specified character

func GenerateTestPayload added in v2.12.0

func GenerateTestPayload(context string) string

GenerateTestPayload creates a test payload with magic characters

func GetBypassHints added in v2.12.0

func GetBypassHints(char string) []string

GetBypassHints returns WAF bypass hints for specific characters

func GetTerminalWidth

func GetTerminalWidth() int

GetTerminalWidth returns the width of the terminal

func IndexOf

func IndexOf(element string, data []string) int

func IsAllowType

func IsAllowType(contentType string) bool

IsAllowType is checking content-type

func MakeTargetSlice

func MakeTargetSlice(targets []string) map[string][]string

MakeTargetSlice is make slice for multicast option

Types

This section is empty.

Jump to

Keyboard shortcuts

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