From 747da038b953550ce543be79d10c32de014f4f1e Mon Sep 17 00:00:00 2001 From: dylenfu Date: Mon, 11 May 2020 19:16:52 +0800 Subject: [PATCH] modify readme.md --- methods/endpoint.go | 1 + methods/methods.go | 10 +++++++++ readme.md | 50 ++++++++++++++++++++++++++++++++++++++------- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/methods/endpoint.go b/methods/endpoint.go index f5bc810..f975529 100644 --- a/methods/endpoint.go +++ b/methods/endpoint.go @@ -34,6 +34,7 @@ func init() { core.OntTool.RegMethod("heartbeat", Heartbeat) core.OntTool.RegMethod("heartbeatInterruptPing", HeartbeatInterruptPing) core.OntTool.RegMethod("heartbeatInterruptPong", HeartbeatInterruptPong) + core.OntTool.RegMethod("resetPeerID", ResetPeerID) core.OntTool.RegMethod("ddos", DDos) core.OntTool.RegMethod("invalidBlockHeight", InvalidBlockHeight) core.OntTool.RegMethod("attackRoutable", AttackRoutable) diff --git a/methods/methods.go b/methods/methods.go index ae80eb3..218a2ab 100644 --- a/methods/methods.go +++ b/methods/methods.go @@ -238,6 +238,12 @@ func HeartbeatInterruptPong() bool { return true } +// todo +func ResetPeerID() bool { + return true +} + +// todo // ddos 攻击 func DDos() bool { @@ -245,21 +251,25 @@ func DDos() bool { return true } +// todo // 异常块高 func InvalidBlockHeight() bool { return true } +// todo // 路由表攻击 func AttackRoutable() bool { return true } +// todo // 非法交易攻击 func AttackTxPool() bool { return true } +// todo // 双花 func DoubleSpend() bool { return true diff --git a/readme.md b/readme.md index b13310b..fb79bd8 100644 --- a/readme.md +++ b/readme.md @@ -31,10 +31,12 @@ handshakeWrongMsg // 握手客户端发送错误信息 heartbeat // 心跳持续测试 heartbeatInterruptPing // p2p ping中断测试 heartbeatInterruptPong // p2p pong中断测试 +resetPeerID // 重置peerID ddos // ddos 攻击单一节点,阻断流量(无法同步块) invalidBlockHeight // 模拟节点持续快高异常 - - +attackRoutable // 路由表攻击 +attackTxPool // 交易池攻击 +doubleSpend // 双花攻击 ``` ## 测试条件及结果预期 @@ -64,7 +66,41 @@ a、第一次握手失败 b、第二次握手成功 ``` -#### 4、网络流量攻击 +#### 4、心跳测试 +```dtd +条件: +a、保持正常心跳 +结果: +a、连接正常,模拟块高持续增加 +``` + +#### 5、心跳中断ping +```dtd +条件: +a、心跳过程中,主动中断ping,持续n sec +结果: +a、连接正常,块高保持一定高度后持续增长 +b、连接断开 +``` + +#### 6、心跳中断pong +```dtd +条件: +a、心跳过程中,主动中断pong,持续n sec +结果: +a、连接正常,块高保持一定高度后持续增长 +b、连接断开 +``` + +#### 7、更新peerID +```dtd +条件: +a、建立连接保持心跳后,变更peerID +结果: +a、连接断开 +``` + +#### 8、网络流量攻击 ```dtd 条件: a、构造多个虚假peerID @@ -74,7 +110,7 @@ c、虚假peer主动发起连接,并持续ping a、节点不能正常出块(出块慢甚至不出块) ``` -#### 5.路由表攻击 +#### 9.路由表攻击 ```dtd 条件: 1.根据目标节点ID,构造大量距离目标seed节点很近的虚拟节点, @@ -87,7 +123,7 @@ c、节点重启后仍然被恶意节点占满 d、节点主动发起连接大概率会连接上恶意节点 ``` -#### 6.块同步攻击 +#### 10.块同步攻击 ```dtd 条件: a.测试工具所模拟的节点块高度始终高于正常节点 @@ -95,7 +131,7 @@ a.测试工具所模拟的节点块高度始终高于正常节点 a.造成同步异常或者延时 ``` -#### 7.交易池攻击 +#### 11.交易池攻击 ```dtd 条件: a、多个恶意节点持续对多个目标seed节点发送不合法交易(比如余额不足) @@ -104,7 +140,7 @@ a、查询交易池,不同目标节点的交易持应该相同,而且都不 b、测试前后查询余额,账户余额不变 ``` -#### 8.双花攻击 +#### 12.双花攻击 ```dtd 条件: a、单个恶意节点,对多个目标seed节点发送连续的4笔交易,其中1笔能成功,另外3笔不能成功,