{"modulePath":"github.com/MaxflowO2/go-mfc","version":"v0.0.0-20210523022220-88b26fd8599d","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package v4test\n\n## Variables\n\n```go\nvar (\n\t// Remote node under test\n\tRemote string\n\t// IP where the first tester is listening, port will be assigned\n\tListen1 string = \"127.0.0.1\"\n\t// IP where the second tester is listening, port will be assigned\n\t// Before running the test, you may have to `sudo ifconfig lo0 add 127.0.0.2` (on MacOS at least)\n\tListen2 string = \"127.0.0.2\"\n)\n```\n\n```go\nvar AllTests = []utesting.Test{\n\t{Name: \"Ping/Basic\", Fn: BasicPing},\n\t{Name: \"Ping/WrongTo\", Fn: PingWrongTo},\n\t{Name: \"Ping/WrongFrom\", Fn: PingWrongFrom},\n\t{Name: \"Ping/ExtraData\", Fn: PingExtraData},\n\t{Name: \"Ping/ExtraDataWrongFrom\", Fn: PingExtraDataWrongFrom},\n\t{Name: \"Ping/PastExpiration\", Fn: PingPastExpiration},\n\t{Name: \"Ping/WrongPacketType\", Fn: WrongPacketType},\n\t{Name: \"Ping/BondThenPingWithWrongFrom\", Fn: BondThenPingWithWrongFrom},\n\t{Name: \"Findnode/WithoutEndpointProof\", Fn: FindnodeWithoutEndpointProof},\n\t{Name: \"Findnode/BasicFindnode\", Fn: BasicFindnode},\n\t{Name: \"Findnode/UnsolicitedNeighbors\", Fn: UnsolicitedNeighbors},\n\t{Name: \"Findnode/PastExpiration\", Fn: FindnodePastExpiration},\n\t{Name: \"Amplification/InvalidPongHash\", Fn: FindnodeAmplificationInvalidPongHash},\n\t{Name: \"Amplification/WrongIP\", Fn: FindnodeAmplificationWrongIP},\n}\n```\n\n## Functions\n\n```go\nfunc BasicFindnode(t *utesting.T)\n```\nBasicFindnode sends a FINDNODE request after performing the endpoint proof. The remote node should respond.\n\n```go\nfunc BasicPing(t *utesting.T)\n```\nThis test just sends a PING packet and expects a response.\n\n```go\nfunc BondThenPingWithWrongFrom(t *utesting.T)\n```\nThis 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.\n\n```go\nfunc FindnodeAmplificationInvalidPongHash(t *utesting.T)\n```\nThis 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.\n\n```go\nfunc FindnodeAmplificationWrongIP(t *utesting.T)\n```\nThis 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.\n\n```go\nfunc FindnodePastExpiration(t *utesting.T)\n```\nThis test sends FINDNODE with an expiration timestamp in the past. The remote node should not respond.\n\n```go\nfunc FindnodeWithoutEndpointProof(t *utesting.T)\n```\nThis test just sends FINDNODE. The remote node should not reply because the endpoint proof has not completed.\n\n```go\nfunc PingExtraData(t *utesting.T)\n```\nThis 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.\n\n```go\nfunc PingExtraDataWrongFrom(t *utesting.T)\n```\nThis test sends a PING packet with additional data and wrong 'from' field and expects a PONG response.\n\n```go\nfunc PingPastExpiration(t *utesting.T)\n```\nThis test sends a PING packet with an expiration in the past. The remote node should not respond.\n\n```go\nfunc PingWrongFrom(t *utesting.T)\n```\nThis test sends a PING packet with wrong 'from' field and expects a PONG response.\n\n```go\nfunc PingWrongTo(t *utesting.T)\n```\nThis test sends a PING packet with wrong 'to' field and expects a PONG response.\n\n```go\nfunc UnsolicitedNeighbors(t *utesting.T)\n```\nThis 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.\n\n```go\nfunc WrongPacketType(t *utesting.T)\n```\nThis test sends an invalid packet. The remote node should not respond.\n\n","path":"github.com/MaxflowO2/go-mfc/cmd/devp2p/internal/v4test","name":"v4test","synopsis":"","isRedistributable":true}
