Documente Academic
Documente Profesional
Documente Cultură
SKIP TO CONTENT
HOME
LINUX
WINDOWS
TECH
CODING
UBUNTU
GENERAL
Home
>
Security
>
How to hack remote database with sqlmap
2 Comments
In the previous post on sqlmap basics we learnt how to use sqlmap to hack a
vulnerable web application and fetch the list of databases, tables, columns and
data rows. In this post we shall see how to do some simple fingerprinting on the
remote database to find valuable information that can be used to assist in
further exploitation of a system.
So lets say we have a vulnerable url
http://localhost/weak.php?id=10
$ python ./sqlmap.py -u
"http://localhost/weak.php?id=10" --dbs
Then use the -T --columns and the --dump options to list out the tables of a
database, columns of a table and data in a table and so on.
To find out more information about the remote system database use the option
"-b". It will try to find the exact banner of the database server. Lets try it on a
mysql database.
.....
The output has the banner text which is "5.1.61". This is the mysql banner and
clearly shows the mysql version being used. Now you can search google for any
mysql vulnerabilities that might exist in this version of mysql.
The next command will fetch the list of users and roles.
..........
........
So in the above output we have the current user, current database, the
hostname.
On mysql if the database user has permission to the FILE operation, then it can
read files from the file system. It can read only those files that are publicly
readable or readable by the mysql user. Here is a quick example to read the
/etc/passwd file.
sqlmap will store the file in its directory on the local file system, so that it can
be read later.
The sql-query option can be used to run arbitrary sql queries on the database.
$ python sqlmap.py -u "http://localhost/weak.php?id=10" --sql-query="select now();"
...........
The last line in the output is the sql query output which was run on the remote
database.
Conclusion
So with all the above information it gets easier to get further into the system
and eventually take control of it, if possible. Sqlmap does quite a massive task
by discovering the database, the data and details about the operating system.
But in most cases it might not able to fully provide control of the remote
system in the form of a shell.
Related Post
Email harvesting with metasploit | Sqlmap tutorial for beginners – Cracking linux password with
tutorial hacking with... john the ripper ̵...
Post navigation
Php reverse shell with netcatHack gmail password with social engineering toolkit (SET)
2 thoughts on “How to hack remote database with sqlmap”
1. Rodger
July 19, 2017 at 8:08 pm
Contact darkwebsolutions for any type of hacking /database services
they offer different services on different range of hacking issues and
also helps to retrieve accounts that have been taken by hackers .You wll be
grateful.. www dot darkwebsolutions dot co
Reply
2. Roy Paul
July 17, 2016 at 2:02 pm
thank you for this tutorial.
Reply
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Post Comment
SEARCH
Search for:
Search
CONNECT WITH US
OTHER INTERESTING STUFF
Using sqlmap with login forms
Sqlmap tutorial for beginners – hacking with sql injection