歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> 用nmap掃描端口並寫到一個靜態網頁腳本(轉貼)

用nmap掃描端口並寫到一個靜態網頁腳本(轉貼)

日期:2017/3/6 15:29:19   编辑:關於Unix

#!/bin/bash
#author coffee_45

htmlfile="/var/www/html/www.html" ;
tempfile="/home/shen/temp.temp" ;
everyrow=3 ;

echo -n > $tempfile
nmap -P0 192.168.0.160| grep open > $tempfile ;

echo -n > $htmlfile ;
echo "<table>" >> $htmlfile ;

while read line;
do
echo "<tr><td><a href=http://"$line"/ target=_blank>"$line"</a></td></tr>" >> $htmlfile ;
done < $tempfile

echo "</table>" >> $htmlfile ;

Copyright © Linux教程網 All Rights Reserved