-SSN'', ''IMAP'', ''Https'', ''Microsoft-DS'', ''MSSQL'', ''MYSQL'', ''Terminal Services'' ); // 通过IP格式的检查后用数组定义各端口对应的服务名称及状态
echo "<table border=0 cellpadding=15 cellspacing=0>\n"; echo "<tr>\n"; echo "<td align=center><strong>您扫描的IP:<font color=red>".$remoteip."</font></strong></td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "<table cellpadding=5 cellspacing=1 bgcolor=#636194>\n"; echo "<tr bgcolor=#7371A5 align=center>\n"; echo "<td><span class=style1>端口</span></td>\n"; echo "<td><span class=style1>服务</span></td>\n"; echo "<td><span class=style1>检测结果</span></td>\n"; echo "<td><span class=style1>描述</span></td>\n"; echo "</tr>\n"; // 输出显示的表格
for($i=0;$i<sizeof($port);$i++) { $fp = @fsockopen($remoteip, $port[$i], &$errno, &$errstr, 1); if (!$fp) { echo "<tr bgcolor=#FFFFFF><td align=center>".$port[$i]."</td><td>".$msg[$i]."</td><td align=center>".$close."</td><td>".$closed."</td></tr>\n"; } else { echo "<tr bgcolor=#F4F7F9><td align=center>".$port[$i]."</td><td>".$msg[$i]."</td><td align=center>".$open."</td><td>".$opened."</td></tr>"; } } // 用for语句,分别用fsockopen函数连接远程主机的相关端口,并输出结果
echo "<tr><td colspan=4 align=center>\n"; echo "<a href=portscan.php><font color=#FFFFFF>继续扫描>>></font>&l |