Skip to content

Commit 51d8117

Browse files
author
WinGeek
committed
Merge branch 'main' of github.com:OpenNHP/opennhp
2 parents 148ab09 + b01222d commit 51d8117

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
**NHP (Network-resource Hiding Protocol)** is a lightweight, cryptography-based Zero Trust protocol designed to safeguard servers and data from attackers by leveraging resource-hiding and encryption. It includes two core sub-protocols:
1212

1313
- **Network-infrastructure Hiding Protocol (nHP):** Protects servers and applications by concealing domains, IP addresses, and ports.
14-
- **Data-object Hiding Protocol (dHP):** Ensures data security and privacy (e.g., files, databases, APIs) through cryptographic key negotiation and encryption.
14+
- **Data-object Hiding Protocol (dHP):** Ensures data security and privacy by making data "usable but not visible" through cryptographic key negotiation and encryption.
1515

1616
**OpenNHP** is the open source implementation of NHP.
1717

ac/httpac.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (ha *HttpAC) initRouter() {
139139
refreshGrp.GET("/:token", func(ctx *gin.Context) {
140140
var err error
141141
token := ctx.Param("token")
142-
log.Info("get refresh request. aspId: %s, query: %v", token, ctx.Request.URL.RawQuery)
142+
log.Info("get refresh request. token: %s, query: %v", token, ctx.Request.URL.RawQuery)
143143

144144
if len(token) == 0 {
145145
err = common.ErrUrlPathInvalid

agent/knock.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ func (a *UdpAgent) preAccessRequest(ackMsg *common.ServerKnockAckMsg) (err error
256256
acWg.Add(1)
257257
go func(info *common.PreAccessInfo) {
258258
defer acWg.Done()
259-
260-
a.processPreAccessAction(info)
259+
if info != nil {
260+
a.processPreAccessAction(info)
261+
}
261262
}(action)
262263
}
263264
acWg.Wait()

docs/zh-cn/deploy.zh-cn.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,13 @@ permalink: /zh-cn/deploy/
151151

152152
### 2.6 测试NHP网络隐身效果
153153

154-
验证NHP网络隐身效果,可以通过nhp-agent主机 *(IP:192.168.56.1)*进行`ping` nhp-ac主机 *(IP:192.168.56.102)*来测试。
154+
验证NHP网络隐身效果,可以通过nhp-agent主机 *(IP:192.168.56.1)*进行`nmap扫描(以80端口为例)` nhp-ac主机 *(IP:192.168.56.102)*来测试。此外,可以在另外一台虚拟机(模拟黑客扫描攻击),扫描nhp-ac 主机查看效果
155155

156156
| 测试用例 | 测试命令 | 测试目的 | 预期结果 |
157157
|:--:|:--:|:--:|:--:|
158-
| nhp-agent未运行 |`ping 192.168.56.102` | 测试AC对Agent隐身 | ping 失败 |
159-
| nhp-agent已运行 |`ping 192.168.56.102` | 测试AC对Agent开放 | ping 成功 |
158+
| nhp-agent未运行 |`nmap -sS -p 80 192.168.56.102` | 测试AC对Agent隐身 | 80/tcp filtered |
159+
| nhp-agent已运行 |`nmap -sS -p 80 192.168.56.102` | 测试AC对Agent开放 | 80/tcp open |
160+
| nhp-agent已运行 |`nmap -sS -p 80 192.168.56.102` | 测试AC对黑客隐身 | 80/tcp filtered |
160161

161162
## 3. 日志说明
162163

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/pelletier/go-toml/v2 v2.1.1
1212
github.com/spf13/viper v1.18.2
1313
github.com/urfave/cli/v2 v2.27.0
14-
golang.org/x/crypto v0.17.0
14+
golang.org/x/crypto v0.31.0
1515
gorm.io/driver/mysql v1.5.2
1616
gorm.io/gorm v1.25.5
1717
)

0 commit comments

Comments
 (0)