# **WRITE UP FOR PIS WEB HOMEWORK** 1:https://www.root-me.org/en/Challenges/Web-Server/HTTP-Open-redirect ![image](https://hackmd.io/_uploads/HyqLU7u1R.png) ![image](https://hackmd.io/_uploads/r1Gwm4O1C.png) Đề bài yêu cầu chúng ta redirect sang 1 trang khác so với 3 trang được hiển thị ở trang web. Quăng vào Burp: ![image](https://hackmd.io/_uploads/rkLBj8dyR.png) Chỗ ***&h*** là nó so sánh md5hash của url được redirect đến, ở đây em sẽ chọn redirect đến https://google.com, copy lại và lên gg kiếm tool hash md5, quăng vô request và lụm flag thoi :> ![image](https://hackmd.io/_uploads/SJLe2IdyR.png) ***flag: e6f8a530811d5a479812d7b82fc1a5c5*** 2:https://www.root-me.org/en/Challenges/Web-Server/HTTP-User-agent ![image](https://hackmd.io/_uploads/rJDbaL_kA.png) Nhìn đề bài em có thể suy ra được ngay ta cần phải chỉnh User-agent header, quăng vào burp và chỉnh User-agent thành Admin và em có được flag:![image](https://hackmd.io/_uploads/S1hcTUuyA.png) ***flag: rr$Li9%L34qd1AAe27*** 3:https://www.root-me.org/en/Challenges/Web-Server/HTTP-Directory-indexing ![image](https://hackmd.io/_uploads/rkC6pL_kR.png) đọc đề em có thể hiểu được đề yêu cầu đọc source, đọc source thoi nào :> ![image](https://hackmd.io/_uploads/ryWEAIdy0.png) hmm source cho em thư mục admin/pass.html, truy cập xem xem có gì nào: ![image](https://hackmd.io/_uploads/S1wdRUuJ0.png) có vẻ như em đã bị lừa, bây giờ thử truy cập vào thư mục admin xem nó chứa gì: ![image](https://hackmd.io/_uploads/ryDpAIdJR.png) P/s: em truy cập thẳng vào admin.txt luôn tại lười screenshot quá... ***flag: LINUX*** 4:https://www.root-me.org/en/Challenges/Web-Server/HTTP-Headers ![image](https://hackmd.io/_uploads/r1Q41w_kC.png) Đề cho em hint về HTTP response và yêu cầu lấy quyền admin, quăng vào burp để xem request response thoai: ![image](https://hackmd.io/_uploads/rkMblv_kA.png) Có thể thấy ở response có header ***Header-Rootme-Admin*** nhưng ở request lại không có, refresh lại page và thêm header vào với value "yes", ta có được flag: ![image](https://hackmd.io/_uploads/By2ugvu1R.png) ***flag: HeadersMayBeUseful*** 5: https://www.root-me.org/en/Challenges/Web-Server/HTTP-POST ![image](https://hackmd.io/_uploads/Bk2ClvukR.png) ![image](https://hackmd.io/_uploads/ryj-ZvukC.png) Đề yêu cầu em vượt qua số điểm định sẵn để lấy flag, quăng vào burp và chỉnh ***score*** thành 1000000000, em có được flag: ![image](https://hackmd.io/_uploads/BypwbP_kR.png) ***flag: H7tp_h4s_N0_s3Cr37S_F0r_y0U*** 6: https://www.root-me.org/en/Challenges/Web-Server/HTTP-Improper-redirect ![image](https://hackmd.io/_uploads/r105ZD_y0.png) Đề yêu cầu get access vào index, mở web lên xem thử nào: ![image](https://hackmd.io/_uploads/rkyk7DdJA.png) em nhập thử admin:admin xem có được không thì thấy không được, quăng vào burpsuite -> repeater và thử redirect vào /index.php thì xuất hiện flag ở response đầu: ![image](https://hackmd.io/_uploads/H1_TVD_yA.png) ***flag: ExecutionAfterRedirectIsBad*** 7:https://www.root-me.org/en/Challenges/Web-Server/HTTP-verb-tampering ![image](https://hackmd.io/_uploads/B1P_KDOkC.png) Search google với cụm từ Verb tampering: ![image](https://hackmd.io/_uploads/H1dpFDdkC.png) Có thể hiểu, đề yêu cầu ta thử truy cập trang web bằng cách method khác nhau như GET, POST, HEAD, DELETE, PUT, etc ..., quăng vào burp và ở method PUT ta có được flag: ![image](https://hackmd.io/_uploads/BJYt9vdJA.png) ***flag: a23e$dme96d3saez$$prap*** 8:https://battle.cookiearena.org/challenges/miscellaneous/simple-http-proxy ![image](https://hackmd.io/_uploads/HyWMiP_y0.png) Mở web lên và ta được giao diện như sau: ![image](https://hackmd.io/_uploads/B1l_sPO10.png) Socket panel: ![image](https://hackmd.io/_uploads/HkuKoDdJC.png) Tải file về và phân tích code: ![image](https://hackmd.io/_uploads/H1waiwuJR.png) Data được gửi thông qua socket và tuân theo các điều kiện sau: -truy cập tới /admin bằng phương thức POST -ip phải là localhost ( 127.0.0.1 ) -User-agent phải là Admin Browser -Header Cookier: admin -cookies admin=true -userid=admin Sau khi đáp ứng đủ điều kiện thì server sẽ trả lại flag Đây là request của em để lấy flag: ``` POST /admin HTTP/1.1 User-agent: Admin Browser Cookier: admin Cookie: admin=true Content-type: application/x-www-form-urlencoded Content-length: 12 userid=admin ``` và em có được flag:![image](https://hackmd.io/_uploads/SJkZavu1R.png) ***flag: CHH{HTTP_via_RaW_Sock3T_be7952a8a555dcf16a55488eb273edcf}*** 9:https://battle.cookiearena.org/challenges/miscellaneous/http-authentication ![image](https://hackmd.io/_uploads/HyFN6wOyR.png) hmm đề không có instance để launch, tải file xem có gì nào: ![image](https://hackmd.io/_uploads/SJQ5avu1C.png) sau khi tải về em được file zip, giải nén nó với password ***cookiehanhoan*** em được file .txt, mở nó lên em được 1 đoạn hex encoded, quăng lên cyberchef decode hex xem thử: ![image](https://hackmd.io/_uploads/Bkgl0D_kR.png) Em thấy có 1 đoạn base64 khả nghi nên em sẽ đem decode nó, và thu được flag :> ![image](https://hackmd.io/_uploads/Bk5MAPuJC.png) ***flag: EHC{fr@m4_##!@a}*** 10:https://battle.cookiearena.org/challenges/miscellaneous/http-authentication Đọc đề cho ta hint đọc source, mở web lên và đọc source thoi :> ![image](https://hackmd.io/_uploads/B1QX1ddk0.png) redirect đến /src ta được code như hình: ![image](https://hackmd.io/_uploads/B1RVyduJC.png) có thể hiểu rằng khi ta redirect đến thư mục ***/super-secret-route-nobody-will-guess*** với method PUT, server sẽ trả về flag, quăng vô burp và lấy flag thoi: ![image](https://hackmd.io/_uploads/r1rMx__J0.png) ***flag: CHH{y0u_h4v3_b33n_my_fr13nd_6e21a633a9e28f19a66001a58f0033b6}*** final thoughts: iem yêu PIS, fan cứng PIS 20 năm :>