WebIPS prevents scanning software from scanning websites

Source: Internet
Author: User
Tags servervariables

Previously issued a similar, support ASP and PHP version (Portal: http://www.bkjia.com/Article/201102/83466.html oldjun original,) Today I combined with a customer portal site security maintenance requirements, the method to prevent JSKY from scanning WEB applications is named webips. The following code has been tested: Mainstream JSKY, small steel gun, identification, MatriXay, WEB application scanners such as WebRavor, IBM Appscan, and HP WebInspect are ineffective. We also hope programmers can join the Honker Security Team to explore unknown fields and now release ASP version code, at the beginning, I made a judgment on the web spider and added anti-injection code to the ASP program of the garbage point. I hope everyone can work together to improve it! (Usage: create a file webips. asp and call some of the public files, usually config. asp)
<%
User_agent = Request. ServerVariables ("HTTP_USER_AGENT ")
Function check (user_agent) to determine whether it is a spider
Allow_agent = split ("Baiduspider, Scooter, Baidu, Googlebot, Sosospider, Yahoo, YoudaoBot, msnbot, Sogou, Baidu, FAST-WebCrawler, MSNBOT, Aleksika Spider, larbin, Slurp, cuil ",",")
Check_agent = false
For agenti = lbound (allow_agent) to ubound (allow_agent)
If instr (user_agent, allow_agent (agenti)> 0 then
Check_agent = true
Exit
End if
Next
Check = check_agent
End function
If check (user_agent) = False then
If request. servervariables ("query_string") <> "then
Urlcan = "? "& Request. servervariables (" query_string ")
Else
Urlcan = ""
End if
Rurl = "http: //" & request. servervariables ("http_host") & request. servervariables ("url") & urlcan
If session ("refresh") <> 1 then
Session ("refresh") = session ("refresh") + 1
Response. redirect rurl
End if
Ips = Request. Cookies ("ips ")
If ips <> "" then
Ips = ips + "dd"
Response. Cookies ("ips") = ips
Response. redirect rurl
End if
End if
%>
<%
Dim SQL _injdata, SQL _inj, SQL _Get, SQL _Data, SQL _Post, SQL _cook
SQL _injdata = "| and | exec | insert | select | delete | update | count | chr | master | truncate | char | declare | -- | script | cast"
SQL _inj = split (SQL _Injdata, "| ")
If Request. QueryString <> "Then
For Each SQL _Get In Request. QueryString
For SQL _Data = 0 To Ubound (SQL _inj)
If instr (LCase (Request. QueryString (SQL _Get), SQL _Inj (SQL _DATA)> 0 Then
Response. Write"

Related Article

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.