payload

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModuleRegistry = []ModuleInfo{
	{
		Name:        "extension",
		Description: "Extension Evasion Matrix",
		TestType:    TestTypeExtensionEvasion,
		Enabled:     true,
	},
	{
		Name:        "content-type",
		Description: "Content-Type Spoofing",
		TestType:    TestTypeContentTypeSpoof,
		Enabled:     true,
	},
	{
		Name:        "magic-byte",
		Description: "Magic Byte Injection",
		TestType:    TestTypeMagicByteSpoof,
		Enabled:     true,
	},
	{
		Name:        "filename",
		Description: "Filename Obfuscation & Sanitization Faults",
		TestType:    TestTypeFilenameObfuscation,
		Enabled:     true,
	},
	{
		Name:        "path-traversal",
		Description: "Path Traversal Sequences",
		TestType:    TestTypePathTraversal,
		Enabled:     true,
	},
	{
		Name:        "graphql",
		Description: "GraphQL File Uploads",
		TestType:    TestTypeGraphQL,

		Enabled: true,
	},
	{
		Name:        "unicode",
		Description: "Unicode & Encoding Vulnerabilities",
		TestType:    TestTypeUnicodeEncoding,
		Enabled:     true,
	},
	{
		Name:        "size-boundary",
		Description: "Size Boundary Testing",
		TestType:    TestTypeSizeBoundary,
		Enabled:     true,
	},
	{
		Name:        "polyglot",
		Description: "Polyglot & Archive Attacks",
		TestType:    TestTypePolyglotArchive,
		Enabled:     true,
	},
	{
		Name:        "race-condition",
		Description: "Race Condition & TOCTOU Testing",
		TestType:    TestTypeRaceCondition,
		Enabled:     true,
	},
	{
		Name:        "server-config",
		Description: "Server Configuration Overrides",
		TestType:    TestTypeServerConfig,
		Enabled:     true,
	},
	{
		Name:        "template",
		Description: "Template Payloads",
		TestType:    TestTypeTemplate,
		Enabled:     true,
	},
	{
		Name:        "xxe",
		Description: "XXE Injection via File Upload",
		TestType:    TestTypeXXE,
		Enabled:     true,
	},
}

ModuleRegistry holds all available modules

Functions

func EnableAllModules added in v1.3.0

func EnableAllModules()

EnableAllModules enables all modules

func EnableModules added in v1.3.0

func EnableModules(names []string)

EnableModules enables only the specified modules

func IsModuleEnabled added in v1.3.0

func IsModuleEnabled(testType TestType) bool

IsModuleEnabled checks if a module is enabled by test type

func ListModules added in v1.3.0

func ListModules() string

ListModules returns a formatted string of available modules

Types

type GraphQLFields

type GraphQLFields struct {
	Operations string // JSON-encoded GraphQL mutation query
	Map        string // JSON-encoded file-to-variable mapping
	FileIndex  string // The form field name for the file (e.g., "0", "1")
}

GraphQLFields holds GraphQL-specific multipart form data Implements the GraphQL multipart request specification: https://github.com/jaydenseric/graphql-multipart-request-spec

type GraphQLMap

type GraphQLMap map[string][]string

GraphQLMap maps file indices to variable paths Example: {"0": ["variables.file"]}

type GraphQLOperation

type GraphQLOperation struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName string                 `json:"operationName,omitempty"`
}

GraphQLOperation represents a single GraphQL file upload mutation

type ModuleInfo added in v1.3.0

type ModuleInfo struct {
	Name        string
	Description string
	TestType    TestType
	Enabled     bool
}

ModuleInfo describes a loadable module

func GetEnabledModules added in v1.3.0

func GetEnabledModules() []ModuleInfo

GetEnabledModules returns all enabled modules

func GetModuleByName added in v1.3.0

func GetModuleByName(name string) *ModuleInfo

GetModuleByName returns a module by its name

type Payload

type Payload struct {
	TestType       TestType
	Technique      string
	Filename       string
	TargetFilename string
	Extension      string
	Body           []byte
	ContentType    string
	Tags           []string
	GraphQL        *GraphQLFields
	RaceSync       bool
	ExtraFields    map[string]string // per-payload form fields (from template form_data)
}

func AllPayloads

func AllPayloads(techStack, graphqlMutation, graphqlVariable, modulePath string, moduleOverwrite bool) []*Payload

AllPayloads generates the complete test matrix filtered by tech stack.

func PolyglotArchivePayloads added in v1.8.2

func PolyglotArchivePayloads() []*Payload

PolyglotArchivePayloads generates polyglot and archive-based attack payloads

type RaceBarrier added in v1.4.0

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

RaceBarrier is used to synchronize concurrent race condition payloads

func NewRaceBarrier added in v1.4.0

func NewRaceBarrier() *RaceBarrier

NewRaceBarrier creates a synchronization barrier for race condition tests

func (*RaceBarrier) AddPayload added in v1.4.0

func (rb *RaceBarrier) AddPayload(p *Payload)

AddPayload adds a payload to its filename group

func (*RaceBarrier) GetGroup added in v1.4.0

func (rb *RaceBarrier) GetGroup(targetFile string) []*Payload

GetGroup returns all payloads for a given target filename

func (*RaceBarrier) SignalReady added in v1.4.0

func (rb *RaceBarrier) SignalReady()

SignalReady signals that all payloads are prepared

func (*RaceBarrier) WaitReady added in v1.4.0

func (rb *RaceBarrier) WaitReady()

WaitReady waits for the ready signal

type TestType

type TestType string

TestType categorizes the kind of upload test being performed.

const (
	TestTypeTemplate            TestType = "Template"
	TestTypeExtensionEvasion    TestType = "Extension Evasion"
	TestTypeContentTypeSpoof    TestType = "Content-Type Spoof"
	TestTypeMagicByteSpoof      TestType = "Magic Byte Spoof"
	TestTypeFilenameObfuscation TestType = "Filename Obfuscation"
	TestTypePathTraversal       TestType = "Path Traversal"
	TestTypeSizeBoundary        TestType = "Size Boundary"
	TestTypePolyglotArchive     TestType = "Polyglot & Archive"
	TestTypeUnicodeEncoding     TestType = "Unicode Encoding"
	TestTypeServerConfig        TestType = "Server Configuration"
	TestTypeGraphQL             TestType = "GraphQL"
	TestTypeRaceCondition       TestType = "Race Condition"
	TestTypeXXE                 TestType = "XXE Injection"
)

Jump to

Keyboard shortcuts

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