作者:angel 前言 PHP是一种功能强大的Web开发语言。开发效率高,语法简单,为动态网站量身定做,加强面向对象(向C 靠拢,与JAVA搭了点边),可惜单线程(这是至命弱点,......
echo "</tr\n";
echo "</table>\n";
echo "<TABLE cellSpacing=0 cellPadding=10 width=100% border=0>\n";
echo "<TR>\n";
echo "<TD align=center><b>Copyright © 2004 Security Angel Team[S4T] All Rights Reserved.</b></TD>\n";
echo "</TR>\n";
echo "</TABLE>\n";
echo "</center>\n";
echo "</body>\n";
echo "</html>\n";
exit;
}
// 探测结束 echo "<table border=0 cellpadding=15 cellspacing=0>\n";
echo "<tr>\n";
echo "<td align=center><strong>您的IP:<font color=red>".$youip."</font></strong></td>\n";
echo "</tr>\n";
echo "<form method=POST action=portscan.php>\n";
echo "<tr><td>\n";
echo "<input type=text name=remoteip size=12>\n";
echo "<input type=submit value=扫描 name=scan>\n";
echo "</td></tr>\n";
echo "</form>";
echo "</table>\n";
// 如果表单为空则显示提交IP地址的表单 ?> <TABLE cellSpacing=0 cellPadding=10 width="100%" border=0>
<TR>
<TD align=center><b>Copyright © 2004 Security Angel Team[S4T] All Rights Reserved.</b></TD>
</TR>
</TABLE>
</center>
</body>
</html>
后记
这个扫描器很简单。就是用了一个数组来定义端口的相关信息,原理就是用fsockopen函数连接,如果可以连接,就表示端口打开,否则就是关闭。
最大的缺点就是PHP是单线程的,所以速度会很慢,这个是用方便、简单作为代价的,其实写这个代码的就是想告诉大家,PHP并不仅仅用于动态网站的开发,也可以用于网络安全领域,往往太注意事物的本职工作,就会忽略其他方面的特点。
3/3 首页 上一页 1 2 3 |