mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 13:11:53 +08:00
fix(parsers): 修复带横杠域名被误识别为IP范围的问题
如 111-555.sss.com 这类域名因包含 - 被错误解析为 IP 范围, 添加 looksLikeIPRange() 检查,只有 - 前是有效 IP 才走范围解析
This commit is contained in:
@@ -444,6 +444,16 @@ func TestParseIP_SingleIP(t *testing.T) {
|
||||
"example.com",
|
||||
[]string{"example.com"},
|
||||
},
|
||||
{
|
||||
"带横杠的域名",
|
||||
"111-555.sss.com",
|
||||
[]string{"111-555.sss.com"},
|
||||
},
|
||||
{
|
||||
"多段横杠域名",
|
||||
"my-test-server.example.com",
|
||||
[]string{"my-test-server.example.com"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user