自动扫描C段段内主机
时间:2007-09-22 来源:blueantelope
确认你的系统安装有nmap
#apt-get install nmap
脚本如下:
#!/bin/bash
#####################
#* scan.sh *#
#* blueantelope *#
#* 2007-09-22 *#
#* home *#
#####################
ip_count=1
printf "Begin Scan\n"
echo "" > /tmp/scan.log
while [ $ip_count -lt 255 ]
do
ip=$1.$ip_count
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "=========Scan $ip=============" >> /tmp/scan.log
nmap -sS $ip >> /tmp/scan.log
echo "=========End $ip==============" >> /tmp/scan.log
ip_count=`expr $ip_count + 1`
done
printf "Now End Scan\n"
#apt-get install nmap
脚本如下:
#!/bin/bash
#####################
#* scan.sh *#
#* blueantelope *#
#* 2007-09-22 *#
#* home *#
#####################
ip_count=1
printf "Begin Scan\n"
echo "" > /tmp/scan.log
while [ $ip_count -lt 255 ]
do
ip=$1.$ip_count
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "" >> /tmp/scan.log
echo "=========Scan $ip=============" >> /tmp/scan.log
nmap -sS $ip >> /tmp/scan.log
echo "=========End $ip==============" >> /tmp/scan.log
ip_count=`expr $ip_count + 1`
done
printf "Now End Scan\n"
相关阅读 更多 +