[*]Discovery / credits: Malvuln (John Page aka hyp3rlinx) (c) 2022
Original source: https://malvuln.com/advisory/618f28253d1268132a9f10819a6947f2.txt
Backup media: infosec.exchange/@malvuln
Threat: Trojan-Dropper.Win32.Decay.dxv (CyberGate v1.00.0)
Vulnerability: Insecure Proprietary Password Encryption
Vuln ID: MVID-2022-0664
Description: This well known RAT malware stores credentials using a proprietary insecure encryption routine in its “Settings.ini” file. The recovery procedure is trivial to decrypt stored credentials. theres no key, xor or combined encrypt mechanism and relies on basic SUB, ADD and bitwise operations SHR and SHL. Analysis of the following single encrypted character table reveal the pattern 0,G,W,m that repeats every few alpha-numeric characters a-c, d-g, h-k etc…
For example, the password “abc” is stored as “OM9Z”, in order to recover the first character we need only perform the following bitwise operations SUB, ADD, SHR and SHL.
OM9Z = “abc”
To recover the first password character, use the first two stored values “OM” which will return the ascii value “a”.
eax = len(key) – len(b)
ebx = eax -1
ecx = len(key) – len(b)
edx = ecx -1
ebx << 6
0x600 + 0x16
0x616 >> 4
61 = ‘a’
import argparse, sys, time, os, atexit
from operator import *
#CyberGate v1.00.0 – Insecure Proprietary Password Encryption
#Basic password decryptor for the following RAT malwares:
#Trojan-Dropper.Win32.Decay.dxv (CyberGate v1.00.0)
#Spy-Net 2.7 Beta 02 – Backdoor.Win32.Shpinat.a
#By John Page (aka hyp3rlinx) Copyright (C) circa 2022
#PoC to decrypt credentials due to flawed proprietary encryption.
#RAT password save usage:
#Click ‘START’ / Options then choose ‘Select listening ports’ from menu.
#Enter a new password in the ‘Connection Password’ field and click save.
#Password gets stored in ‘Settings.ini’ file.
#Note: Should recover most numeric and or lowercase passwords. May return
#multiple password candidates depending on the password recovered.
#Some limitation with long and or complex passwords, did not put much time on it!
#TODO: Better handle complex long mixed letters and or repeating characters.
#Author is NOT responsible for any misuse or incorrect password recovery,
#the user accepts ALL risk by using the software.
#MIT License – Copyright (c) 2022 malvuln
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the “Software”), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.
#THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#Permission is also explicitly given for insertion in vulnerability databases and similar,
#provided that due credit is given to the author:
#John Page (aka malvuln/hyp3rlinx) Copyright (C)(TM) 2022
____ ______ __
/ __ ___ _________ ___ __ / ____/________ ______/ /_____ _____
/ / / / _ / ___/ __ `/ / / / / / / ___/ __ `/ ___/ //_/ _ / ___/
/ /_/ / __/ /__/ /_/ / /_/ / / /___/ / / /_/ / /__/ ,< / __/ /
/_____/___/___/__,_/__, / ____/_/ __,_/___/_/|_|___/_/
By Malvuln (c) circa 2022