Skip to content

Commit

Permalink
modify readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dylenfu committed May 11, 2020
1 parent 138760d commit 747da03
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
1 change: 1 addition & 0 deletions methods/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions methods/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,28 +238,38 @@ func HeartbeatInterruptPong() bool {
return true
}

// todo
func ResetPeerID() bool {
return true
}

// todo
// ddos 攻击
func DDos() bool {

log4.Info("ddos attack end!")
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
Expand Down
50 changes: 43 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ handshakeWrongMsg // 握手客户端发送错误信息
heartbeat // 心跳持续测试
heartbeatInterruptPing // p2p ping中断测试
heartbeatInterruptPong // p2p pong中断测试
resetPeerID // 重置peerID
ddos // ddos 攻击单一节点,阻断流量(无法同步块)
invalidBlockHeight // 模拟节点持续快高异常
attackRoutable // 路由表攻击
attackTxPool // 交易池攻击
doubleSpend // 双花攻击
```

## 测试条件及结果预期
Expand Down Expand Up @@ -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
Expand All @@ -74,7 +110,7 @@ c、虚假peer主动发起连接,并持续ping
a、节点不能正常出块(出块慢甚至不出块)
```

#### 5.路由表攻击
#### 9.路由表攻击
```dtd
条件:
1.根据目标节点ID,构造大量距离目标seed节点很近的虚拟节点,
Expand All @@ -87,15 +123,15 @@ c、节点重启后仍然被恶意节点占满
d、节点主动发起连接大概率会连接上恶意节点
```

#### 6.块同步攻击
#### 10.块同步攻击
```dtd
条件:
a.测试工具所模拟的节点块高度始终高于正常节点
结果:
a.造成同步异常或者延时
```

#### 7.交易池攻击
#### 11.交易池攻击
```dtd
条件:
a、多个恶意节点持续对多个目标seed节点发送不合法交易(比如余额不足)
Expand All @@ -104,7 +140,7 @@ a、查询交易池,不同目标节点的交易持应该相同,而且都不
b、测试前后查询余额,账户余额不变
```

#### 8.双花攻击
#### 12.双花攻击
```dtd
条件:
a、单个恶意节点,对多个目标seed节点发送连续的4笔交易,其中1笔能成功,另外3笔不能成功,
Expand Down

0 comments on commit 747da03

Please sign in to comment.