v4test

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Remote node under test
	Remote string
	// Listen1 is the IP where the first tester is listening, port will be assigned
	Listen1 string = "127.0.0.1"
	// Listen2 is the IP where the second tester is listening, port will be assigned
	// Before running the test, you may have to `sudo ifconfig lo0 add 127.0.0.2` (on MacOS at least)
	Listen2 string = "127.0.0.2"
)
View Source
var AllTests = []utesting.Test{
	{Name: "Ping/Basic", Fn: BasicPing},
	{Name: "Ping/WrongTo", Fn: PingWrongTo},
	{Name: "Ping/WrongFrom", Fn: PingWrongFrom},
	{Name: "Ping/ExtraData", Fn: PingExtraData},
	{Name: "Ping/ExtraDataWrongFrom", Fn: PingExtraDataWrongFrom},
	{Name: "Ping/PastExpiration", Fn: PingPastExpiration},
	{Name: "Ping/WrongPacketType", Fn: WrongPacketType},
	{Name: "Ping/BondThenPingWithWrongFrom", Fn: BondThenPingWithWrongFrom},
	{Name: "Findnode/WithoutEndpointProof", Fn: FindnodeWithoutEndpointProof},
	{Name: "Findnode/BasicFindnode", Fn: BasicFindnode},
	{Name: "Findnode/UnsolicitedNeighbors", Fn: UnsolicitedNeighbors},
	{Name: "Findnode/PastExpiration", Fn: FindnodePastExpiration},
	{Name: "Amplification/InvalidPongHash", Fn: FindnodeAmplificationInvalidPongHash},
	{Name: "Amplification/WrongIP", Fn: FindnodeAmplificationWrongIP},
}

Functions

func BasicFindnode

func BasicFindnode(t *utesting.T)

BasicFindnode sends a FINDNODE request after performing the endpoint proof. The remote node should respond.

func BasicPing

func BasicPing(t *utesting.T)

BasicPing just sends a PING packet and expects a response.

func BondThenPingWithWrongFrom

func BondThenPingWithWrongFrom(t *utesting.T)

This test verifies that the default behaviour of ignoring 'from' fields is unaffected by the bonding process. After bonding, it pings the target with a different from endpoint.

func FindnodeAmplificationInvalidPongHash

func FindnodeAmplificationInvalidPongHash(t *utesting.T)

This test attempts to perform a traffic amplification attack against a 'victim' endpoint using FINDNODE. In this attack scenario, the attacker attempts to complete the endpoint proof non-interactively by sending a PONG with mismatching reply token from the 'victim' endpoint. The attack works if the remote node does not verify the PONG reply token field correctly. The attacker could then perform traffic amplification by sending many FINDNODE requests to the discovery node, which would reply to the 'victim' address.

func FindnodeAmplificationWrongIP

func FindnodeAmplificationWrongIP(t *utesting.T)

This test attempts to perform a traffic amplification attack using FINDNODE. The attack works if the remote node does not verify the IP address of FINDNODE against the endpoint verification proof done by PING/PONG.

func FindnodePastExpiration

func FindnodePastExpiration(t *utesting.T)

This test sends FINDNODE with an expiration timestamp in the past. The remote node should not respond.

func FindnodeWithoutEndpointProof

func FindnodeWithoutEndpointProof(t *utesting.T)

This test just sends FINDNODE. The remote node should not reply because the endpoint proof has not completed.

func PingExtraData

func PingExtraData(t *utesting.T)

PingExtraData This test sends a PING packet with additional data at the end and expects a PONG response. The remote node should respond because EIP-8 mandates ignoring additional trailing data.

func PingExtraDataWrongFrom

func PingExtraDataWrongFrom(t *utesting.T)

This test sends a PING packet with additional data and wrong 'from' field and expects a PONG response.

func PingPastExpiration

func PingPastExpiration(t *utesting.T)

This test sends a PING packet with an expiration in the past. The remote node should not respond.

func PingWrongFrom

func PingWrongFrom(t *utesting.T)

PingWrongFrom sends a PING packet with wrong 'from' field and expects a PONG response.

func PingWrongTo

func PingWrongTo(t *utesting.T)

PingWrongTo sends a PING packet with wrong 'to' field and expects a PONG response.

func UnsolicitedNeighbors

func UnsolicitedNeighbors(t *utesting.T)

This test sends an unsolicited NEIGHBORS packet after the endpoint proof, then sends FINDNODE to read the remote table. The remote node should not return the node contained in the unsolicited NEIGHBORS packet.

func WrongPacketType

func WrongPacketType(t *utesting.T)

This test sends an invalid packet. The remote node should not respond.

Types

This section is empty.

Jump to

Keyboard shortcuts

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