Comprehensive Defense ASP website anti-hacker attack [my original]
Source: Internet
Author: User
##############################################
This article all code copyright belongs to [rain wave], reprint please declare
##############################################
ASP is not the most vulnerable technology, but to prevent hacker attacks
And no matter how it's attacked, it's two.
Through QueryString and form
As long as these two defenses are good, the problem is solved.
Here are some of my own original code, for your reference
A. Anti-querystring SQL attack
General SQL can attack the page is usually in the parameter is a number of pages
1. First we do a warning process
The "' Sub-process function: Error message prompt '" "" "" "" ""
"' Parameter description: ERRMSG error message description var processing mode 1 return does not refresh 2 return to Page 3" "" "" "" '
Public Sub Alarm (errmsg,var)
Response. Write ("<table width=514 height=293 border=0 align=center cellpadding=0")
Response. Write ("<tr><td 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 ' ></td> ')
Response. Write ("<td width= ' 43% ' align= ' center ' ><div align= ' center ' style= ' line-height:150% ><font ' color= ') 0099FF ' style= ' font-size:9pt ' > for operation failure We apologize! <br> If there is still a problem, please send us error report </font></div></td></tr> ")
Response. Write ("<tr bgcolor= ' #FFFFFF ' ><td height=25 colspan=2> <strong>< Font color= #0099FF style= ' font-size:9pt ' the possible cause of the failure of the Operation:</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>")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service