fuzzer

package
v0.0.0-...-7d0b5db Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package fuzzer is the entry point for go-fuzz.

Index

Constants

View Source
const (
	SequenceLength  = 10
	MutateCount     = 100
	OutputDir       = "./output"
	SaveFlag        = true
	PacketSleepTime = 100 * time.Millisecond // Single packet send and waiting time
	ShouldTrace     = false
)
View Source
const (
	NoPendingRequired byte = 0
)

Variables

View Source
var (
	EnvKey = "FUZZYDIR"
)
View Source
var (
	HandshakeTimeout = 1 * time.Second // Timeout for handshake
)

Functions

func RunFuzzer

func RunFuzzer(protocol, target, chainDir string, engine int, threads int) error

Fuzz

func SetFuzzyVMDir

func SetFuzzyVMDir()

SetFuzzyVMDir sets the output directory for FuzzyVM If the environment variable FUZZYDIR is set, the output directory will be set to that, otherwise it will be set to a temp dir (for unit tests)

Types

type EthMaker

type EthMaker struct {
	SuiteList []*eth.Suite

	PakcetSeed []eth.Packet // Use store packet seed to mutator

	Series []StateSeries
	// contains filtered or unexported fields
}

func NewEthMaker

func NewEthMaker(targetDir string, chain string) *EthMaker

func (*EthMaker) PacketStart

func (m *EthMaker) PacketStart(traceOutput io.Writer, seed eth.Packet, stats *UDPPacketStats) error

func (*EthMaker) SetResult

func (m *EthMaker) SetResult(root, logs common.Hash)

func (*EthMaker) Start

func (m *EthMaker) Start(traceOutput io.Writer) error

func (*EthMaker) ToGeneralStateTest

func (m *EthMaker) ToGeneralStateTest(name string) *GeneralStateTest

func (*EthMaker) ToSubTest

func (m *EthMaker) ToSubTest() *stJSON

type GeneralStateTest

type GeneralStateTest map[string]*stJSON

type Maker

type Maker interface {
}

Maker await a decision

type Nonce

type Nonce [gcmNonceSize]byte

type SnapMaker

type SnapMaker struct {
	SuiteList []*eth.Suite

	PakcetSeed []snap.Packet // Use store packet seed to mutator

	Series []StateSeries
	// contains filtered or unexported fields
}

func NewSnapMaker

func NewSnapMaker(targetDir string, chain string) *SnapMaker

func (*SnapMaker) PacketStart

func (m *SnapMaker) PacketStart(traceOutput io.Writer, seed snap.Packet, stats *UDPPacketStats) error

func (*SnapMaker) Start

func (m *SnapMaker) Start(traceOutput io.Writer) error

func (*SnapMaker) ToGeneralStateTest

func (m *SnapMaker) ToGeneralStateTest(name string) *GeneralStateTest

func (*SnapMaker) ToSubTest

func (m *SnapMaker) ToSubTest() *stJSON

type StateSeries

type StateSeries struct {
	Type  string
	Nonce Nonce
	State int
}

type UDPPacketStats

type UDPPacketStats struct {
	ExecuteCount      int // Execute count
	CheckTrueFail     int // First type of exception: Check is true but Success is false
	CheckFalsePass    int // Second type of exception: Check is false but Success is true
	CheckFalsePassOK  int
	CheckFalsePassBad int
	CheckTruePass     int // Third type of exception: Check is true but Success is true
}

type V4Maker

type V4Maker struct {
	Client     *discv4.UDPv4
	TargetList []*enode.Node

	PakcetSeed []discv4.Packet // Use store packet seed to mutator

	Series []StateSeries
	// contains filtered or unexported fields
}

func NewV4Maker

func NewV4Maker(targetDir string) *V4Maker

func (*V4Maker) Close

func (m *V4Maker) Close()

func (*V4Maker) PacketStart

func (m *V4Maker) PacketStart(traceOutput io.Writer, seed discv4.Packet, stats *UDPPacketStats) error

PacketStart executes fuzzing by sending single packets in multiple goroutines and collecting feedback

func (*V4Maker) SetResult

func (m *V4Maker) SetResult(root, logs common.Hash)

func (*V4Maker) Start

func (m *V4Maker) Start(traceOutput io.Writer) error

func (*V4Maker) ToGeneralStateTest

func (m *V4Maker) ToGeneralStateTest(name string) *GeneralStateTest

func (*V4Maker) ToSubTest

func (m *V4Maker) ToSubTest() *stJSON

type V5Maker

type V5Maker struct {
	Client     *discv5.UDPv5
	TargetList []*enode.Node

	PakcetSeed []discv5.Packet // Use store packet seed to mutator

	Series []StateSeries
	// contains filtered or unexported fields
}

func NewV5Maker

func NewV5Maker(targetDir string) *V5Maker

func (*V5Maker) Close

func (m *V5Maker) Close()

func (*V5Maker) PacketStart

func (m *V5Maker) PacketStart(traceOutput io.Writer, seed discv5.Packet, stats *UDPPacketStats) error

func (*V5Maker) SetResult

func (m *V5Maker) SetResult(root, logs common.Hash)

func (*V5Maker) Start

func (m *V5Maker) Start(traceOutput io.Writer) error

func (*V5Maker) ToGeneralStateTest

func (m *V5Maker) ToGeneralStateTest(name string) *GeneralStateTest

func (*V5Maker) ToSubTest

func (m *V5Maker) ToSubTest() *stJSON

Jump to

Keyboard shortcuts

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