当前位置:编程学习 > asp >>

全面防御asp网站防黑客攻击[我的原创]

##############################################
本文所有代码版权归属[雨浪],转载请声明
##############################################
asp最脆弱的不是技术,而是防范黑客攻击
而无论怎样攻击,就两点
通过QueryString和form
只要这两处防范好了,问题就解决了
下面是我自家独创的一些代码,供大家参考
一.防通过querystring的sql攻击
一般sql能够攻击的页面通常是在参数为数字的页面
1.首先我们做一个警告子过程
'''''子过程功能:错误信息提示''''''''''''''''''
'''''参数说明:errmsg 错误信息说明 var 处理方式 1返回不刷新 2返回上页 3关闭页面''''''''''''''''''
Public sub alarm(errmsg,var)
response.Write("<table width=514 height=293 border=0 align=center cellpadding=0 cellspacing=0>")
response.Write("<tr><td height=43><img src=images/error_bg.gif width=514 height=43></td></tr><tr>")
response.Write("<td height=239 valign=top> ")
response.Write("<table width='100%' height='100%' cellpadding=0 cellspacing=1 bgcolor='#cccccc' style='border-left:1px solid #DDDDDD;border-right:1px solid #DDDDDD'>")
response.Write("<tr bgcolor='#FFFFFF'><td width='57%' align='center'><img src='images/error_show.gif' width='272' height='92'></td>")
response.Write("<td width='43%' align='center'><div align='center' style='line-height:150%'><font color='#0099FF' style='font-size:9pt'>对于操作失败我们表示抱歉!<br>如果仍有问题,请给我们发送错误报告 </font></div></td></tr>")
response.Write("<tr bgcolor='#FFFFFF'><td height=25 colspan=2>   <strong><font color=#0099FF style='font-size:9pt'>操作失败的可能原因:</font></strong></td></tr>")
response.Write("<tr bgcolor='#FFFFFF'><td height=86 colspan=2>")
response.Write("<table width='100%' border=0 cellspacing=0 cellpadding=0>")
补充:asp教程,安全加密 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,