活动枚举脚本问题

问题描述

我正在尝试创建一个具有主动枚举功能的脚本:1。枚举使用ICMP协议(考虑TTL和数据包大小)的网络上的所有计算机 2.使用ARP协议枚举网络上的所有计算机 3.基于ICMP和ARP枚举和映射网络上的计算机 4.枚举每台计算机上的至少5个知名端口,并将它们映射到任务2.c的结果 5.保持带宽低于阈值 6.产生可读/可识别的输出 7.执行DNS侦查 8.对脚本产生了多少流量进行分析。 9.执行被动枚举(可选) 到目前为止,我的脚本是这个

echo Enter Ip address with port and range '(for nmap)'
read ipad

echo Enter 2 ip addresses 'for arp-scan',Ip2 enter 0 'if' no range
read ip1
read ip2
# enumerating machines on the network using ARP protocol

nmap -sP -PI $ipad

# enumerating 5 ports
echo "Enumerated ports "
: > task.file
nmap -sn $ipad -oG - | grep Up | cut -d ' ' -f 2 | >> task.file

nmap -iL task.file
# enumerating using ARP

echo arp scan":"
if [ $ip2 == 0 ]; then
        arp-scan $ip1
else
        arp-scan $ip1-$ip2
fi

由于某种原因,nmap -sn $ipad -oG - | grep Up | cut -d ' ' -f 2 | >> task.file在脚本中不起作用,但是当用作命令行时,它可以完美运行,我在哪里出错了

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)