Web presence ah, the fix method of SQL injection point of D injection tool _ network security

Source: Internet
Author: User
Tags sql injection
The same as yesterday, my website and I gave the teacher to do a single chip computer site has been black. In my website inexplicably more than one article, there are more than a set of maps. Is wondering who can log in my backstage post and pictures, my QQ pop-up message, a stranger to me to send a message, said that my site has loopholes, but also said he got my website. But fortunately, he gave me the details of the black My Site method, but also reminded me to repair and repair, or else it will be black. From what he learned, he used the "Ah D injection Tool", first find my site whether there is an injection point, if there is, to inject, can be cracked to get the background password.

That night I downloaded the "Ah D injection Tool" to download the study, know the principle of his injection, some changes to the Web page, but the tool to check, or there are injection points. Shrimp incompetent, had to search the Internet, found the following methods, according to the following modifications, and then "Ah D injection Tool" detection, there is no injection point.

here's how to fix it
Using tools to detect the existence of a site with SQL injection point, then how to fix it?
1. Create a new ASP file, write the following code, save the file name checksql.asp.
Copy Code code as follows:

<%
Dim Fy_url,fy_a,fy_x,fy_cs (), FY_CL,FY_TS,FY_ZX
""---define part of the head------
FY_CL = 3 "' processing mode: 1 = hint information, 2 = Turn page, 3 = prompt before turning
FY_ZX = "[color=red] Enter your page address [/color]" "" ' "
""---Define the partial tail------
On Error Resume Next
Fy_url=request.servervariables ("Query_string")
Fy_a=split (Fy_url, "&")
ReDim Fy_cs (UBound (fy_a))
On Error Resume Next
For fy_x=0 to UBound (fy_a)
Fy_cs (fy_x) = Left (Fy_a (fy_x), InStr (Fy_a (fy_x), "=")-1)
Next
For fy_x=0 to UBound (Fy_cs)
If Fy_cs (fy_x) <> "" Then
If Instr (LCase (Fy_cs (fy_x)), "'" "<>0 or Instr (LCase (Fy_cs))," and "fy_x or <>0 (LCase (Fy_cs (fy_x)), "select" <>0 or Instr (LCase (Fy_cs)), "Update" fy_x or <>0 ( LCase (Fy_cs (fy_x)), "CHR") <>0 or Instr (LCase (Fy_cs)), "fy_x") Delete%20from or Instr (LCase (Fy_cs (fy_x)), ";" <>0 or Instr (LCase (Request (Fy_cs (fy_x)), insert) <>0 or INSTR (LCase (Request (Fy_cs)), "Mid" < >0 Or Instr (LCase (Request (Fy_cs (fy_x))), "Master." <>0 Then
Select Case FY_CL
Case "1"
Response.Write "<script Language=javascript>alert (") Your IP has been recorded and we will send the IP analysis to China network within 24 hours. Please be self-respect!! \ n ' '); Window.close ();</script> "
Case "2"
Response.Write "<script language=javascript>location.href=" [color=red] Enter your web address [/color] ' </Script > "
Case "3"
Response.Write "<script Language=javascript>alert (") Your IP has been recorded and we will send the IP analysis to China network within 24 hours. Please be self-respect!! "" location.href= "" [color=red] Enter your web address [/color] ';</script> '
End Select
Response.End
End If
End If
Next
%>

Then put the file on the site directory, and then find the following code in the file where the injection point was found,
<!--#include file= "***.***"-->
Note that "***.***" is a connected file, find something similar to the code, and then add a sentence later
<!--#include file= "checksql.asp"-->
Note that the checksql.asp is placed in the path, corresponding to the modification. After the completion of the tool after the sweep, to determine not to be found in the SQL injection point, the problem is resolved.

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.