# **WRITE UP FOR PIS WEB HOMEWORK**
1:https://www.root-me.org/en/Challenges/Web-Server/HTTP-Open-redirect


Đề 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:

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 :>

***flag: e6f8a530811d5a479812d7b82fc1a5c5***
2:https://www.root-me.org/en/Challenges/Web-Server/HTTP-User-agent

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:
***flag: rr$Li9%L34qd1AAe27***
3:https://www.root-me.org/en/Challenges/Web-Server/HTTP-Directory-indexing

đọc đề em có thể hiểu được đề yêu cầu đọc source, đọc source thoi nào :>

hmm source cho em thư mục admin/pass.html, truy cập xem xem có gì nào:

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ì:

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

Đề 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:

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:

***flag: HeadersMayBeUseful***
5: https://www.root-me.org/en/Challenges/Web-Server/HTTP-POST


Đề 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:

***flag: H7tp_h4s_N0_s3Cr37S_F0r_y0U***
6: https://www.root-me.org/en/Challenges/Web-Server/HTTP-Improper-redirect

Đề yêu cầu get access vào index, mở web lên xem thử nào:

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:

***flag: ExecutionAfterRedirectIsBad***
7:https://www.root-me.org/en/Challenges/Web-Server/HTTP-verb-tampering

Search google với cụm từ Verb tampering:

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:

***flag: a23e$dme96d3saez$$prap***
8:https://battle.cookiearena.org/challenges/miscellaneous/simple-http-proxy

Mở web lên và ta được giao diện như sau:

Socket panel: 
Tải file về và phân tích code:

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:
***flag: CHH{HTTP_via_RaW_Sock3T_be7952a8a555dcf16a55488eb273edcf}***
9:https://battle.cookiearena.org/challenges/miscellaneous/http-authentication

hmm đề không có instance để launch, tải file xem có gì nào:

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ử:

Em thấy có 1 đoạn base64 khả nghi nên em sẽ đem decode nó, và thu được flag :>

***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 :>

redirect đến /src ta được code như hình:

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:

***flag: CHH{y0u_h4v3_b33n_my_fr13nd_6e21a633a9e28f19a66001a58f0033b6}***
final thoughts: iem yêu PIS, fan cứng PIS 20 năm :>