I was testing for SQL vulnerabilities at random over the Internet and found a whole lot of websites that are still vulnerable to SQL injections. I refrained from any further testing due to lack of explicit permission by owners.However, here's a demonstration--from one of my penetration testing projects--of how these websites may be hacked if the SQL vulnerabilities are left unpatched.
Tip: Read up a little on SQL injection. For example, start with figuring out what this is trying to do:
SELECT * FROM users WHERE name = '' OR '1'='1';
The tool sqlmap comes preloaded with both Kali and Backtrack.
If the dynamic parameter in the php script is vulnerable then sqlmap will try to inject code into it.
I've blacked out the website's information for obvious reasons.
First, get the tool to list the available databases:
The 'information_schema' DB is where MySQL stores the schema, so I'm not interested in that one. The other one is my target.
I try to grab the 'tables' available in this other database:
There are a bunch of tables that get listed, among those the table 'members' looks interesting, grab the columns for that table:
And I see a column with passwords, I'll get the hashes here (I've seen some web admins who are so careless that they store the passwords in plaintext which would require no password cracking):
Finally, I get my hands on the password hashes and the reverse engineering begins from there (use jtr):
Unless you actually know what sqlmap did for you in the background, it is not that interesting and makes you a perfect script kiddie.
Once you crack the password hashes, you can login to the website's control panel as 'admin' and then change html files (index.html for homepage). That would be website defacing.
Disclaimer: As stated in the beginning, this excerpt is from an authorized penetration test. If you notice an SQL weakness in a website, please refrain from engaging in illicit activities and inform the web administrator.
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteWONDERFUL Post.thanks for share..extra wait .. …
ReplyDeleteAlso visit my web site ... spain tourist board
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete">
ReplyDeletehey your blog is infected with comment spams
ReplyDeleteYes, that was before I turned on the Captcha. Now I manually approve each comment. I will remove these spam comments soon someday.
Deletehey what it d command for access table datas?
ReplyDeleteif the website not having sql vulnerability then how to hack..
ReplyDeleteyeaah
ReplyDeletethe bug is cosed :(
ReplyDeleteWhich school did you go to for becoming a penetration tester? :)
ReplyDeletehi Mr pranshu bajpai really you know about penetration
ReplyDeleteoh really pranshu you know about penetration
ReplyDeletesIR I AMA NOT HAVING VERNUBILITY OF THE WEBSITE THE HOW CAN I HACK THE DATA BAES
ReplyDelete