显示 Web 服务识别 URL

This commit is contained in:
ZacharyZcR
2026-06-04 14:26:20 +08:00
parent 08a87b3128
commit 68f990d20b
2 changed files with 55 additions and 3 deletions
+25 -1
View File
@@ -478,7 +478,31 @@ func TestBuildServiceLogMessage(t *testing.T) {
Extras: map[string]string{},
},
isWeb: true,
wantContain: []string{"192.168.1.1:80", "http", "1.1"},
wantContain: []string{"http://192.168.1.1", "http", "1.1"},
},
{
name: "非标准端口HTTP服务显示URL",
addr: "192.168.1.1:8080",
serviceInfo: &ServiceInfo{
Name: "http",
Version: "1.1",
Banner: "",
Extras: map[string]string{},
},
isWeb: true,
wantContain: []string{"http://192.168.1.1:8080", "http", "1.1"},
},
{
name: "HTTPS服务显示HTTPS URL",
addr: "192.168.1.1:443",
serviceInfo: &ServiceInfo{
Name: "https",
Version: "1.1",
Banner: "",
Extras: map[string]string{},
},
isWeb: true,
wantContain: []string{"https://192.168.1.1", "https", "1.1"},
},
{
name: "带Banner的SSH服务",