Documentation ¶
Index ¶
- Variables
- func BasicFindnode(t *utesting.T)
- func BasicPing(t *utesting.T)
- func BondThenPingWithWrongFrom(t *utesting.T)
- func FindnodeAmplificationInvalidPongHash(t *utesting.T)
- func FindnodeAmplificationWrongIP(t *utesting.T)
- func FindnodePastExpiration(t *utesting.T)
- func FindnodeWithoutEndpointProof(t *utesting.T)
- func PingExtraData(t *utesting.T)
- func PingExtraDataWrongFrom(t *utesting.T)
- func PingPastExpiration(t *utesting.T)
- func PingWrongFrom(t *utesting.T)
- func PingWrongTo(t *utesting.T)
- func UnsolicitedNeighbors(t *utesting.T)
- func WrongPacketType(t *utesting.T)
Constants ¶
This section is empty.
Variables ¶
var ( // Remote node under test Remote string // IP where the first tester is listening, port will be assigned Listen1 string = "127.0.0.1" // 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" )
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 ¶
BasicFindnode sends a FINDNODE request after performing the endpoint proof. The remote node should respond.
func BondThenPingWithWrongFrom ¶
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 ¶
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 ¶
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 ¶
This test sends FINDNODE with an expiration timestamp in the past. The remote node should not respond.
func FindnodeWithoutEndpointProof ¶
This test just sends FINDNODE. The remote node should not reply because the endpoint proof has not completed.
func 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 ¶
This test sends a PING packet with additional data and wrong 'from' field and expects a PONG response.
func PingPastExpiration ¶
This test sends a PING packet with an expiration in the past. The remote node should not respond.
func PingWrongFrom ¶
This test sends a PING packet with wrong 'from' field and expects a PONG response.
func PingWrongTo ¶
This test sends a PING packet with wrong 'to' field and expects a PONG response.
func UnsolicitedNeighbors ¶
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 ¶
This test sends an invalid packet. The remote node should not respond.
Types ¶
This section is empty.