header-logo
Suggest Exploit
vendor:
SQL Buddy
by:
Fady Osman
7,5
CVSS
HIGH
Remote Code Execution
78
CWE
Product Name: SQL Buddy
Affected Version From: SQL Buddy 1.3.3
Affected Version To: SQL Buddy 1.3.3
Patch Exists: NO
Related CWE: N/A
CPE: sqlbuddy
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: Kubuntu 14.10
2014

SQL Buddy Remote Code Execution

SQL Buddy suffers from a remote code execution. This happens due to the fact that it allows the user to login using any server he wants and that it allows the user to export data from the database to a file on the webserver. In order to exploit this bug, the user must use a sql server they control and have valid credentials for, create a database and a table with one column of type text, insert the php code they want to execute into that table, choose the previously created table from the left menu, click Export from the top menu, choose CSV format, choose 'Text File' and name the file with php extension for example shell.php. The exported file will be at : sqlbuddy/exports/ assuming the user installed sqlbuddy in a folder named sqlbuddy.

Mitigation:

Ensure that the user is not able to export data from the database to a file on the webserver.
Source

Exploit-DB raw data:

# Exploit Title: SQL Buddy Remote Code Execution
# Date: November 29 2014
# Exploit Author: Fady Osman (@fady_osman)
# Youtube Channel  : https://www.youtube.com/user/cutehack3r
# Vendor Homepage: http://sqlbuddy.com/
# Software Link:
https://github.com/calvinlough/sqlbuddy/raw/gh-pages/sqlbuddy.zip
# Version: SQL Buddy 1.3.3
# Tested on: Kubuntu 14.10

SQLBuddy provides a web based mysql administration and it's included in
packages like wamp server.

SQL Buddy suffers from a remote code execution. This happens due to the
fact that it allows the user to login using any server he wants and that it
allows the user to export data from the database to a file on the webserver.

In order to exploit this bug do the following steps:

1- Use a sql server you control and have a valid credentials for (You can
use one of the free mysql hosting services).
2- Create a database and a table with one column of type text.
3- Insert the php code you want to execute into that table.
4- Choose the previously created table from the left menu.
5- Click Export from the top menu.
6- Choose CSV format.
7- Choose "Text File" and name the file with php extension for example
shell.php.

The exported file will be at : sqlbuddy/exports/ assuming you installed
sqlbuddy in a folder named sqlbuddy.

-- 

*Regards,*
[image: Fady Osman on about.me]

Fady Osman
about.me/Fady_Osman
    <http://about.me/Fady_Osman>