美文网首页
eight_shell

eight_shell

作者: 1220 | 来源:发表于2019-06-10 08:26 被阅读0次
for n in {1..254}
do
    ping -W 2 -c 2 10.0.0.$n &>/dev/null
    if [ $? -eq 0 ]
    then
        echo "10.0.0.$n is alive."
    else
        echo "10.0.0.$n is dead."
    fi
done 

for n in {1..254}
do
    {
    ping -W 2 -c 2 10.0.0.$n &>/dev/null
    if [ $? -eq 0 ]
    then
        echo "10.0.0.$n is alive."
    else
        echo "10.0.0.$n is dead."
    fi
    }&
done

[root@web01 scripts]# nmap -sP 10.0.0.0/24|awk '/Nmap scan report for/ {print $NF}'
10.0.0.1
10.0.0.8
10.0.0.9
10.0.0.61
10.0.0.254
(10.0.0.7)

-sP: Ping Scan - go no further than determining if host is online

image.png image.png

相关文章

网友评论

      本文标题:eight_shell

      本文链接:https://www.haomeiwen.com/subject/zhqyxctx.html