SQL database Hang Horse solution

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Today received a friend's help phone, rushed back to the bedroom on the server to view the situation, the original is a website was invaded, the destruction is quite serious, the SQL database is hung horse, all the table inside most of the fields are repeatedly inserted horse code, check the log, fortunately not related to the security of the server There's just a lot of exception warnings in the database.

No way, I had to fix the database, because they do not have a database backup, there is no way to restore the database Ah, not even the transaction log is not open, try to recover a few times are unsuccessful, restore the database there is no hope, I have to obediently help them clean up the horse code, can not manually remove the horse code, After all, the data is too big to directly modify, through the search for a barely effective solution, each table to execute this SQL statement

Update tablename set @ziduanming =replace (CAST (@ziduanming as varchar (8000)), ', null '

The above SQL statement corresponds to modifying the table, the field name, and the replacement content

In fact, the SQL database hanging horse is a newer method of horse-hanging, as long as the site is injected, and the connection database is DB Owner permissions can be a database hanging horse, estimated the process of the attack should be automated, through advanced scanning technology to collect tens of thousands of of the site's SQL injection vulnerabilities, for vulnerability attacks, Automate the SQL injection to hang the horse. This time there should be a lot of sites suffer, Asp+mssql is mainly targeted!

I give the solution

SQL database Hanging Horse Solution:

Correct cleaning Trojan, note that the database can not be arbitrarily modified or deleted, after the horse, more need to be cautious operation. It is recommended that you back up and then carefully clean up.

If you haven't backed up before, use my SQL command to fix it,

How to prevent SQL database hanging horses:

1, clean up all the injection points on the site.

2, for the site to configure a reliable anti-injection program.

3, the best in the site source code to do a good job of filtering in the database to limit the type and length of characters.

4, the habit of regular backup database. You may not be able to guarantee a daily backup of the database, but will also guarantee a weekly backup, if there is time to make sure to back up the database every day.

5, the best is to ask professional website security company, to your station and server to do a thorough security assessment.

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.