-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
222 lines (187 loc) · 5.84 KB
/
index.html
File metadata and controls
222 lines (187 loc) · 5.84 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html>
<head>
<title>Clickjacking Test</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background: #f5f5f5;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #333;
text-align: center;
}
.input-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="url"] {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 3px;
font-size: 14px;
box-sizing: border-box;
}
button {
background: #007cba;
color: white;
border: none;
padding: 10px 20px;
border-radius: 3px;
cursor: pointer;
margin-right: 10px;
margin-bottom: 10px;
}
button:hover {
background: #005a87;
}
.test-frame {
position: relative;
width: 100%;
height: 400px;
border: 2px solid #ccc;
margin: 20px 0;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
.overlay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #28a745;
color: white;
border: none;
padding: 15px 30px;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
z-index: 10;
}
.overlay:hover {
background: #218838;
}
.status {
padding: 10px;
margin: 10px 0;
border-radius: 3px;
display: none;
}
.success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.info {
background: #e3f2fd;
padding: 15px;
border-radius: 3px;
margin-bottom: 20px;
border-left: 4px solid #2196f3;
}
.transparent {
opacity: 0.1;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Clickjacking Test</h1>
<div class="input-group">
<label for="url">Target URL:</label>
<input type="url" id="url" placeholder="https://example.com">
</div>
<button onclick="loadSite()">Load</button>
<button onclick="toggleTransparency()">Toggle Transparency</button>
<button onclick="toggleOverlay()">Toggle Overlay</button>
<div class="test-frame">
<iframe id="testFrame" src="about:blank"></iframe>
<button class="overlay" id="overlayBtn" onclick="overlayClick()">
Click Me!
</button>
</div>
<div id="status" class="status"></div>
<div class="info">
<strong>Cara test:</strong><br>
1. Masukkan URL target<br>
2. Klik Load<br>
3. Jika website muncul = vulnerable<br>
4. Jika tidak muncul/error = protected<br>
5. Toggle transparency untuk simulasi attack
</div>
</div>
<script>
let isTransparent = false;
let overlayVisible = true;
function loadSite() {
const url = document.getElementById('url').value;
const frame = document.getElementById('testFrame');
const status = document.getElementById('status');
if (!url) {
showStatus('Masukkan URL terlebih dahulu', 'error');
return;
}
frame.src = url;
showStatus('Loading...', 'info');
frame.onload = function() {
showStatus('Website loaded - Cek apakah muncul di iframe', 'success');
};
frame.onerror = function() {
showStatus('Gagal load - Website mungkin protected', 'error');
};
}
function toggleTransparency() {
const frame = document.getElementById('testFrame');
isTransparent = !isTransparent;
if (isTransparent) {
frame.classList.add('transparent');
} else {
frame.classList.remove('transparent');
}
}
function toggleOverlay() {
const overlay = document.getElementById('overlayBtn');
overlayVisible = !overlayVisible;
if (overlayVisible) {
overlay.classList.remove('hidden');
} else {
overlay.classList.add('hidden');
}
}
function overlayClick() {
alert('Overlay clicked! Dalam serangan nyata, ini bisa jadi tombol berbahaya.');
}
function showStatus(message, type) {
const status = document.getElementById('status');
status.textContent = message;
status.className = 'status ' + type;
status.style.display = 'block';
}
</script>
</body>
</html>