ASP implementation three ways to prevent data from external submission 1th/3 page _ Application Tips

Source: Internet
Author: User
Ways to prevent data from being submitted externally

The first way to screen special characters and keywords

Fqys=request.servervariables ("Query_string")

Dim Nothis (18)

Nothis (0) = "NET user"

Nothis (1) = "xp_cmdshell"

Nothis (2) = "/add"

Nothis (3) = "Exec%20master.dbo.xp_cmdshell"

Nothis (4) = "Net localgroup Administrators"

Nothis (5) = "Select"

Nothis (6) = "Count"

Nothis (7) = "ASC"

Nothis (8) = "char"

Nothis (9) = "Mid"

Nothis (10) = "'"

Nothis (11) = ":"

Nothis (12) = "" "

Nothis (+) = "Insert"

nothis = "Delete"

Nothis = "Drop"

Nothis = "Truncate"

Nothis (a) = "from"

Nothis (18) = "%"

Errc=false

For i= 0 To UBound (nothis)

If InStr (Fqys,nothis (i)) <>0 then

Errc=true

End If

Next

If ERRC Then

Response.Write "<script language=" "JavaScript" ">"

Response.Write "Parent.alert" (' Sorry!) you are trying to attack this server or want to obtain the highest management of this server! will be directly to the home page ... ');

Response.Write "self.location.href= ' default.asp ';"

Response.Write "</script>"

Response.End

End If
Current 1/3 page 123 Next read the full text

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.