# Error messages Trigger error to get info. Trong request đến /product?productId={}. Cần truyền vào tham số productid giá trị kiểu số nguyên, nên khi truyền kiểu string thì báo lỗi và trong lỗi có đề cập đến version của apache. ![image](https://hackmd.io/_uploads/SJ1UsTa-A.png) # Debug page Khi truy cập trang chủ, trong response trả về có chứa dòng comment của dev, nội dung là ``` <!-- <a href=/cgi-bin/phpinfo.php>Debug</a> --> ``` Có vẻ đây là đường dẫn đến trang debug. Truy cập trang debug và tìm secret_key ![image](https://hackmd.io/_uploads/rkHijT6bA.png) # Source code disclosure via backup files ![image](https://hackmd.io/_uploads/SJ972pab0.png) # Authentication bypass via information disclosure Khi gửi request với method TRACE đến /admin, trong response ta thấy có trường X-Custom-IP-Authorization, dự đoán server dùng trường này để xác định request từ bên ngoài hay bên trong mạng nội bộ. ![image](https://hackmd.io/_uploads/HJ0c36TZA.png) Ta thêm trường X-Custom-IP-Authorization vào request với value là 127.0.0.1, gửi GET /admin thì đã bypass, lấy được đường dẫn để xóa user carlos là "GET /admin/delete?username=carlos". ![image](https://hackmd.io/_uploads/rkQ3naTb0.png) # Version control history Get info from github Download toàn bộ thư mục /.git ![image](https://hackmd.io/_uploads/rkYMTaaZA.png) Gọi lệnh “git log” để xem các commit ![image](https://hackmd.io/_uploads/HyMVpap-R.png) Dự đoán password của admin bị xóa qua commit 662e5b0b36e54aa5cd380f462bdc5fa1eb2fd8a8. Gọi lệnh “git show {mã hash của commit}” để show chi tiết commit. ![image](https://hackmd.io/_uploads/ByRI6aT-A.png)