Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

MySQL username + password -- How to connect?

Hi guys,

I already tried to connect to my host via navicat/heidisql: no luck.
Is there any other way to connect to the mysql database, even though the mysql port isn't open?

I have root username + password by the way, just need a way to connect to the database somehow.

Would like to hear your opinions :)
(Oct 22, 2012 09:26 AM)eXpan Wrote:  SQL Databases tend to only be in the network or only allowing localhost to connect.
You will need to root or shell the webhost on it or any other source that has access.

I have and SQL inject point, can I inflict any damage there? Change the MYSQL user or something like that?
Port is close? It's being filtered / local only. I don't think you can connect remotely. That is, you'll be able to do so locally with a shell.
(Oct 22, 2012 09:26 AM)eXpan Wrote:  SQL Databases tend to only be in the network or only allowing localhost to connect.
lolwut. If the MySQL service port (Usually 3306) is open, OP will be able to connect remotly with any MySQL application. I guess sysadmins are starting to be aware to the issue, but most of dem are open as I can see.
(Oct 22, 2012 09:41 AM)Th3PonyWizard Wrote:  Port is close? It's being filtered / local only. I don't think you can connect remotely. That is, you'll be able to do so locally with a shell.
lolwut. If the MySQL service port (Usually 3306) is open, OP will be able to connect remotly with any MySQL application. I guess sysadmins are starting to be aware to the issue, but most of dem are open as I can see.

The port is closed, yes. Already tried logging in remotely and couldn't do so.
So now I will have to continue my hunt in looking for an admin panel... Yay!
Look for MySQL client or just do it like I do: (ubuntu)
Code
mysql -h host -u root -p
Enter password and you're in.
O o
/¯/_____________________________________/¯¯
| 0x41414141 ~~~
\_\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯\__
/█\
/ \
(Oct 22, 2012 09:46 AM)Zixem Wrote:  Look for MySQL client or just do it like I do: (ubuntu)
Code
mysql -h host -u root -p
Enter password and you're in.

ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (111)
If what you want to is shell the website only then check if the SQL user has FILE privileges and do SELECT INTO OUTFILE,etc.. and there you have your shell. If you are interested in the contents of the database then you'll have to upload your shell and then connect via your shell (or localhost to them) to the database.
(Oct 22, 2012 11:45 AM)Mormaii Wrote:  If what you want to is shell the website only then check if the SQL user has FILE privileges and do SELECT INTO OUTFILE,etc.. and there you have your shell. If you are interested in the contents of the database then you'll have to upload your shell and then connect via your shell (or localhost to them) to the database.

The user in my sql injectionpoint does not have writing privileges, so into outfile is out of the option unless I can login to another mysql user. Any suggestions?
(Oct 22, 2012 01:22 PM)IIBAN Wrote:  The user in my sql injectionpoint does not have writing privileges, so into outfile is out of the option unless I can login to another mysql user. Any suggestions?

I do not know anything about what you're trying to do/what is the situation/what you want to accomplish.
(Oct 22, 2012 01:26 PM)Mormaii Wrote:  I do not know anything about what you're trying to do/what is the situation/what you want to accomplish.

Here's the situation:
- I have an injectionpoint from which I dumped the MYSQL users + passwords, the result of this is that I have the password of the root user.

- Now I would like to log into the MYSQL database, so I can add my shell.

My goals: Get a shell on the server. 🤝
bro, you need sql dumper for connect to mysql
(Oct 22, 2012 01:38 PM)IIBAN Wrote:  Here's the situation:
- I have an injectionpoint from which I dumped the MYSQL users + passwords, the result of this is that I have the password of the root user.

- Now I would like to log into the MYSQL database, so I can add my shell.

My goals: Get a shell on the server. 🤝

You can look for other domains on the same server so if you can upload a shell to those sites you could log in as root into the database from that domain and upload shell on target site.
(Oct 22, 2012 01:51 PM)Mormaii Wrote:  You can look for other domains on the same server so if you can upload a shell to those sites you could log in as root into the database from that domain and upload shell on target site.

I have access to the wordpress blog of the site, as an administrator, but I can't install plugins/themes = no shell if I am correct.
(Oct 22, 2012 02:10 PM)IIBAN Wrote:  I have access to the wordpress blog of the site, as an administrator, but I can't install plugins/themes = no shell if I am correct.

I don't have any experience with wordpress but i've seen there are ways in which it could be done. Have you tried timthumb?
(Oct 22, 2012 01:38 PM)IIBAN Wrote:  Here's the situation:
- I have an injectionpoint from which I dumped the MYSQL users + passwords, the result of this is that I have the password of the root user.

- Now I would like to log into the MYSQL database, so I can add my shell.

My goals: Get a shell on the server. 🤝

Hint: If you have an injection point and you manually dumped the database you might as well use UDF injection or load_file using the same injection point to upload your shell on the site ..

In case you have no idea what i just said.. please google for more info about it.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Ramb0xMar 2, 2019 07:31 AM 5 210 Mar 2, 2019 07:31 AM
Last Post: Ramb0x
by r3elMay 28, 2018 11:48 PM 34 663 May 28, 2018 11:48 PM
Last Post: r3el
by gussiAug 3, 2017 02:18 AM 2 148 Aug 3, 2017 02:18 AM
Last Post: sysadmn