SQL Injection parsing (iii) database types

Source: Internet
Author: User

Previous: http://www.bkjia.com/Article/201209/153278.html

Mysql, mssql, and oracle databases all have their own unique commands. We can determine the database type to be injected based on them. In mysql and mssql, select @ version returns the current database version. in oracle, select banner from v & version returns the database version. Access to different database constructor strings is different. For example, to construct the string "yeetrack", the command in oracle is 'y' | 'track'. The command in mssql is 'y' + 'track ', in mysql, the command is 'y' 'track' with a space in the middle.

Oracle Database:

1. For a query URL, such as http://www.yeetrack.com/wordpress? P = 54, first test the number of columns to be returned for this URL, construct the URL http://www.bkjia.com/wordpress /? P = 54% 20 union % 20 select % 20 null % 20 from % 20dual-, view the returned result, if the error indicates that the number of returned columns is not 1, increase the number of null, http://www.yeetrack.com/wordpress? P = 54% 20 union % 20 select % 20 null % 20 null % 20 from % 20dual-until no error occurs in the result.

2. Confirm the number of returned columns, and then confirm the type of each column. Change null to 'A' in sequence to view the returned results. If a is returned, the returned result is correct; if an exception occurs, modify the location of 'A' until it is correct.

3. Find a correct type to test the database information. Query all objects of the database owned by the current user. select object_name, object_type from user_object. Find the table you are interested in based on the returned information, and then test the columns of the table. Select column_name from user_tab_columns where table_name = 'tablename', and finally test the table data. select username, password from user-

MSSQL database:

1. Same as oracle database.

2. Same as oracle database.

3. Check the database information. select name from sysobjects-and find the table you are interested in. Then, you can put forward the table fields and information.

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.