Trojan code clearing method set

Source: Internet
Author: User

1. directly replace the varchar type.

For example, "Update [t_information] Set publisher = Replace (publisher ,'','')"

2. The text field requires a bit of trouble (more than 8000 requires another solution)
"Update [t_information] Set authorinfor = Replace (cast (authorinfor as varchar (8000 )),'','')"

3. Some special symbols, such as %, can be processed in the following ways
Update [infor_types] Set parentid = Replace (parentid, char (37 ),'')

 

  1. <% @ Language = "VBScript" codePage = "936" %>
  2. <! -- # Include file = "INC/Conn. asp" -->
  3. <MetaHTTP-equiv = "Content-Type" content = "text/html; charset = gb2312">
  4. <%
  5. Server. scripttimeout = 1000000
  6. 'Xtype = 99 ntext is similar to text. The difference is that the ntext type adopts the Unicode standard character set.
  7. 'Xtype = 35 text is used to store a large amount of text data.
  8. 'Xtype = 231 nvarchar is used to define variable-length binary data. The maximum length is 4000 characters.
  9. 'Xtype = 167 varchar stores variable-length data that can contain up to 8000 characters
  10. STR = "'<MCE: scriptSrc = "http://e6t.3322.org/c.js" mce_src = "http://e6t.3322.org/c.js"> </MCE: SCRIPT>'"' Trojan code after the text type field
  11. SQL = "SELECT. name as t_name, B. name as c_name, B. xtype from sysobjects A, syscolumns B where. id = B. ID and. xtype = 'U' and (B. xtype = 99 or B. xtype = 35 or B. xtype = 231 or B. xtype = 167 )"
  12. Set rs = conn.exe cute (SQL)
  13. While not Rs. EOF
  14. T_name = RS ("t_name") 'table name
  15. C_name = RS ("c_name") 'field name
  16. Xtype = RS ("xtype") 'field type
  17. If (xtype = 99 or xtype = 35) then
  18. Conn.exe cute ("Update [" + t_name + "] Set [" + c_name + "] = Replace (cast ([" + c_name + "] As varchar (8000 )), "+ STR + ",'')")
  19. Else
  20. Conn.exe cute ("Update [" + t_name + "] Set [" + c_name + "] = Replace ([" + c_name + "]," + STR + ",'') ")
  21. End if
  22. Rs. movenext
  23. Wend
  24. Response. Write ("Trojan data has been cleared. Please refresh the page again! ")
  25. %>

'"' Trojan code after the text type field
SQL = "SELECT. name as t_name, B. name as c_name, B. xtype from sysobjects A, syscolumns B where. id = B. ID and. xtype = 'U' and (B. xtype = 99 or B. xtype = 35 or B. xtype = 231 or B. xtype = 167 )"
Set rs = conn.exe cute (SQL)
While not Rs. EOF
T_name = RS ("t_name") 'table name
C_name = RS ("c_name") 'field name
Xtype = RS ("xtype") 'field type
If (xtype = 99 or xtype = 35) then
Conn.exe cute ("Update [" + t_name + "] Set [" + c_name + "] = Replace (cast ([" + c_name + "] As varchar (8000 )), "+ STR + ",'')")
Else
Conn.exe cute ("Update [" + t_name + "] Set [" + c_name + "] = Replace ([" + c_name + "]," + STR + ",'') ")
End if
Rs. movenext
Wend
Response. Write ("Trojan data has been cleared. Please refresh the page again! ")
%>

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.