SQL Injection breaks through single quotes

Source: Internet
Author: User

Today, I have no intention of discovering the company's standardized management backend address for inbound traffic. I have read many web security-related articles and entered single quotation marks in my account, on the page where the logon prompt fails, the following error occurs: SQL statement execution error: SELECT Password, RoleID, UserName, LastIP, LastTime, LastWrongNums, lastWrongTimes FROM TOperator where binary username = ''' array (0 => '000000', 1 => 42000, 2 => 'you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \' Line 2 ',) you can see that the SQL single quotes are escaped. When you look at the page encoding, gb2312, you can use the double byte of gbk to break through the escape restrictions of single quotes (GBK Double Byte encoding: A Chinese character is expressed in two bytes. The first byte corresponds to 0x81-0xFE, And the last byte corresponds to 0x40-0xFE (except 0x7F), which exactly covers the corresponding encoding 0x5C .) When the parameter % d5 'is submitted, it is % d5 % 27 after browser URL encoding, 0xd50x27 after php url Decoding, and 0xd50x5c0x27 after PHP escape, that is, the escape character 0x5c (\) is inserted before 0 × 27 (\). When MySQL is connected using GBK encoding, the byte sequence 0xd50x5c0x27 is understood by MySQL as GBK encoding: GBK encoding '. But I am using aa % d5 'or 1 = 1 after the submission still prompts the user does not exist, have not found the reason, see 2cto Related Description stickers (http://www.bkjia.com/Article/201301/184401.html ), you can use the default account and password to log on successfully. As there are a lot of things, we will make breakthroughs in the future

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.