mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-14 05:12:36 +08:00
Update ICMP.go
This commit is contained in:
parent
6ee7bab188
commit
5c05965967
@ -259,8 +259,15 @@ func RunPing(hostslist []string, chanHosts chan string) {
|
|||||||
|
|
||||||
// ExecCommandPing 执行系统Ping命令检测主机存活
|
// ExecCommandPing 执行系统Ping命令检测主机存活
|
||||||
func ExecCommandPing(ip string) bool {
|
func ExecCommandPing(ip string) bool {
|
||||||
|
// 过滤黑名单字符
|
||||||
|
forbiddenChars := []string{";", "&", "|", "`", "$", "\\", "'", "%", "\"", "\n"}
|
||||||
|
for _, char := range forbiddenChars {
|
||||||
|
if strings.Contains(ip, char) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var command *exec.Cmd
|
var command *exec.Cmd
|
||||||
|
|
||||||
// 根据操作系统选择不同的ping命令
|
// 根据操作系统选择不同的ping命令
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "windows":
|
case "windows":
|
||||||
|
Loading…
Reference in New Issue
Block a user