Re: Remote Console on MySQL

From: Jon Hart (jhart@spoofed.org)
Date: Thu Apr 06 2006 - 10:13:41 EDT


On Wed, Apr 05, 2006 at 05:11:47AM -0000, tester@secfocus.com wrote:
> Im doing a pentest and found 3306 open with no password. I logged in a root using Navcat MYSQL GUI..
>
> I can select one of the test databases and get a remote console,
>
> mysql>
>
> root@myipaddress does not have privilages to the main mysql database..

This actually sounds like a misconfiguration to me. If someone went
through the trouble of removing root@.* privileges to mysql.*, yet did
not give the root user a password, I'd venture a guess and say that the
permissions are also likely botched in other ways, too. Sure, there are
situations where such a setup could be valid, but...

Perhaps there are other users who also have no password set but have
more privileges?

> My question:
>
> Can you run commands on mysql to interact with the OS like XP..cmdshell in MSSQL?

Strictly speaking, I do not believe so. For a next step, I'd see what
you can do with the FILE privileges, as that may prove to be the next
best thing. See the following semi-related link, and NGS' "Hackproofing
MySQL" linked within:

http://www.securiteam.com/exploits/6G00P1PC0U.html

Keep in mind that the attack outlined about is an edge case because the
target system was running mysql as root, and as such, all of the FILE
operations run on the local file-system had root privileges. Depending
on how badly your target system is configured, there is a chance you too
could accomplish the same attack, albeit gaining uid=mysql and not root.

-jon

------------------------------------------------------------------------------
This List Sponsored by: Cenzic

Concerned about Web Application Security?
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's
Choice Award from eWeek. As attacks through web applications continue to rise,
you need to proactively protect your applications from hackers. Cenzic has the
most comprehensive solutions to meet your application security penetration
testing and vulnerability management needs. You have an option to go with a
managed service (Cenzic ClickToSecure) or an enterprise software
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can
help you: http://www.cenzic.com/news_events/wpappsec.php
And, now for a limited time we can do a FREE audit for you to confirm your
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:55:48 EDT