Update index.html
Browse files- index.html +127 -77
index.html
CHANGED
|
@@ -4,8 +4,9 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Saldırı Simülatörü</title>
|
|
|
|
| 7 |
<style>
|
| 8 |
-
|
| 9 |
background-color: rgb(12, 185, 228);
|
| 10 |
color: rgb(89, 0, 233);
|
| 11 |
font-family: 'Arial', sans-serif;
|
|
@@ -67,9 +68,6 @@
|
|
| 67 |
text-decoration: none;
|
| 68 |
cursor: pointer;
|
| 69 |
}
|
| 70 |
-
.speech-toggle {
|
| 71 |
-
margin: 10px;
|
| 72 |
-
}
|
| 73 |
</style>
|
| 74 |
</head>
|
| 75 |
<body>
|
|
@@ -85,33 +83,73 @@
|
|
| 85 |
<button id="malwareAttack">Kötü Amaçlı Yazılım Saldırısı</button>
|
| 86 |
<div id="attack-result"></div>
|
| 87 |
</section>
|
| 88 |
-
<div>
|
| 89 |
-
<button id="toggleSpeech" class="speech-toggle">Sesli Açıklamayı Aç/Kapat</button>
|
| 90 |
-
</div>
|
| 91 |
</main>
|
| 92 |
-
<
|
| 93 |
-
<div class="modal-content">
|
| 94 |
-
<span class="close">×</span>
|
| 95 |
-
<p id="modal-text"></p>
|
| 96 |
-
</div>
|
| 97 |
-
</div>
|
| 98 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
// Web Speech API setup
|
| 100 |
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 101 |
const recognition = new SpeechRecognition();
|
| 102 |
recognition.lang = 'tr-TR';
|
| 103 |
recognition.continuous = false;
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
|
| 107 |
recognition.onresult = function(event) {
|
| 108 |
const transcript = event.results[0][0].transcript.toLowerCase();
|
| 109 |
-
console.log(`Voice command received: ${transcript}`); // Debugging
|
| 110 |
handleVoiceCommand(transcript);
|
| 111 |
};
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
function handleVoiceCommand(command) {
|
| 114 |
-
console.log(`Handling command: ${command}`); // Debugging
|
| 115 |
if (command.includes('kimlik avı')) {
|
| 116 |
handlePhishing();
|
| 117 |
} else if (command.includes('fidye yazılımı')) {
|
|
@@ -123,6 +161,7 @@
|
|
| 123 |
} else {
|
| 124 |
showModal('Geçersiz komut. Lütfen tekrar deneyin.');
|
| 125 |
}
|
|
|
|
| 126 |
}
|
| 127 |
|
| 128 |
function startRecognition() {
|
|
@@ -141,9 +180,8 @@
|
|
| 141 |
<button onclick="handlePhishingResponse(true)">Bağlantıya Tıkla</button>
|
| 142 |
<button onclick="handlePhishingResponse(false)">Bağlantıya Tıklama</button>
|
| 143 |
`;
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
}
|
| 147 |
}
|
| 148 |
|
| 149 |
function handleRansomware() {
|
|
@@ -153,9 +191,8 @@
|
|
| 153 |
<button onclick="handleRansomwareResponse(true)">Fidyeyi Öde</button>
|
| 154 |
<button onclick="handleRansomwareResponse(false)">Fidye Ödemeyin</button>
|
| 155 |
`;
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
}
|
| 159 |
}
|
| 160 |
|
| 161 |
function handleDdos() {
|
|
@@ -165,9 +202,8 @@
|
|
| 165 |
<button onclick="handleDdosResponse(true)">Yük Dengeleyici Kullanın</button>
|
| 166 |
<button onclick="handleDdosResponse(false)">Sadece Bekleyin</button>
|
| 167 |
`;
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
}
|
| 171 |
}
|
| 172 |
|
| 173 |
function handleMalware() {
|
|
@@ -177,51 +213,77 @@
|
|
| 177 |
<button onclick="handleMalwareResponse(true)">Yazılımı Kaldır</button>
|
| 178 |
<button onclick="handleMalwareResponse(false)">Yazılımı Kaldırmayın</button>
|
| 179 |
`;
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
}
|
| 183 |
}
|
| 184 |
|
| 185 |
-
function handlePhishingResponse(accepted) {
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
}
|
|
|
|
| 192 |
function handleRansomwareResponse(paid) {
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
|
| 199 |
function handleDdosResponse(usedLoadBalancer) {
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
}
|
| 205 |
|
| 206 |
function handleMalwareResponse(removed) {
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
}
|
| 212 |
|
| 213 |
function showModal(message) {
|
|
|
|
| 214 |
const modal = document.getElementById('myModal');
|
| 215 |
-
const modalText = document.getElementById('modal-text');
|
| 216 |
const span = document.getElementsByClassName('close')[0];
|
| 217 |
-
|
| 218 |
-
modalText.textContent = message;
|
| 219 |
modal.style.display = 'block';
|
| 220 |
-
|
| 221 |
span.onclick = function() {
|
| 222 |
modal.style.display = 'none';
|
| 223 |
}
|
| 224 |
-
|
| 225 |
window.onclick = function(event) {
|
| 226 |
if (event.target == modal) {
|
| 227 |
modal.style.display = 'none';
|
|
@@ -229,37 +291,25 @@
|
|
| 229 |
}
|
| 230 |
}
|
| 231 |
|
| 232 |
-
function
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
method: 'POST',
|
| 235 |
headers: {
|
| 236 |
'Content-Type': 'application/json'
|
| 237 |
},
|
| 238 |
-
body: JSON.stringify(
|
| 239 |
-
})
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
});
|
| 244 |
}
|
| 245 |
-
|
| 246 |
-
function speak(message) {
|
| 247 |
-
const speech = new SpeechSynthesisUtterance(message);
|
| 248 |
-
speech.lang = 'tr-TR';
|
| 249 |
-
window.speechSynthesis.speak(speech);
|
| 250 |
-
}
|
| 251 |
-
|
| 252 |
-
// // Ses tanıma başlatma düğmesi
|
| 253 |
-
// const startRecognitionBtn = document.createElement('button');
|
| 254 |
-
// startRecognitionBtn.textContent = 'Sesli Komut Başlat';
|
| 255 |
-
// startRecognitionBtn.addEventListener('click', startRecognition);
|
| 256 |
-
// document.body.appendChild(startRecognitionBtn);
|
| 257 |
-
|
| 258 |
-
// Sesli açıklamayı aç/kapatma düğmesi
|
| 259 |
-
document.getElementById('toggleSpeech').addEventListener('click', function() {
|
| 260 |
-
speechEnabled = !speechEnabled;
|
| 261 |
-
this.textContent = speechEnabled ? 'Sesli Açıklamayı Kapat' : 'Sesli Açıklamayı Aç';
|
| 262 |
-
});
|
| 263 |
</script>
|
| 264 |
</body>
|
| 265 |
-
</html>
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Saldırı Simülatörü</title>
|
| 7 |
+
<link rel="stylesheet" href="styles.css">
|
| 8 |
<style>
|
| 9 |
+
body {
|
| 10 |
background-color: rgb(12, 185, 228);
|
| 11 |
color: rgb(89, 0, 233);
|
| 12 |
font-family: 'Arial', sans-serif;
|
|
|
|
| 68 |
text-decoration: none;
|
| 69 |
cursor: pointer;
|
| 70 |
}
|
|
|
|
|
|
|
|
|
|
| 71 |
</style>
|
| 72 |
</head>
|
| 73 |
<body>
|
|
|
|
| 83 |
<button id="malwareAttack">Kötü Amaçlı Yazılım Saldırısı</button>
|
| 84 |
<div id="attack-result"></div>
|
| 85 |
</section>
|
|
|
|
|
|
|
|
|
|
| 86 |
</main>
|
| 87 |
+
<script src="scripts.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
<script>
|
| 89 |
+
// JavaScript kodu (kullanıcı eylemlerini kaydetme)
|
| 90 |
+
|
| 91 |
+
function logUserAction(actionType, actionDetail) {
|
| 92 |
+
const actionLog = {
|
| 93 |
+
timestamp: new Date().toISOString(),
|
| 94 |
+
actionType: actionType,
|
| 95 |
+
actionDetail: actionDetail
|
| 96 |
+
};
|
| 97 |
+
console.log('User Action:', JSON.stringify(actionLog));
|
| 98 |
+
fetch('/log', {
|
| 99 |
+
method: 'POST',
|
| 100 |
+
headers: {
|
| 101 |
+
'Content-Type': 'application/json'
|
| 102 |
+
},
|
| 103 |
+
body: JSON.stringify(actionLog)
|
| 104 |
+
}).then(response => {
|
| 105 |
+
if (!response.ok) {
|
| 106 |
+
console.error('Failed to log action');
|
| 107 |
+
}
|
| 108 |
+
});
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
document.getElementById('phishingAttack').addEventListener('click', () => {
|
| 112 |
+
document.getElementById('attack-result').innerHTML = `
|
| 113 |
+
<h3>Kimlik Avı Saldırısı!</h3>
|
| 114 |
+
<p>Bir e-posta aldınız ve bu e-postadaki bağlantıya tıklamanız isteniyor. Ne yaparsınız?</p>
|
| 115 |
+
<button onclick="handlePhishingResponse(true)">Bağlantıya Tıkla</button>
|
| 116 |
+
<button onclick="handlePhishingResponse(false)">Bağlantıya Tıklama</button>
|
| 117 |
+
`;
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
+
function handlePhishingResponse(accepted) {
|
| 121 |
+
if (accepted) {
|
| 122 |
+
document.getElementById('attack-result').innerHTML = `
|
| 123 |
+
<p>Bağlantıya tıkladınız ve kişisel bilgileriniz çalındı. Güvenlik önlemleri almanız gerekiyor!</p>
|
| 124 |
+
`;
|
| 125 |
+
} else {
|
| 126 |
+
document.getElementById('attack-result').innerHTML = `
|
| 127 |
+
<p>İyi bir seçim yaptınız. Bilgilerinizi korudunuz!</p>
|
| 128 |
+
`;
|
| 129 |
+
}
|
| 130 |
+
logUserAction('response', accepted ? 'clicked' : 'notClicked');
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
// Web Speech API setup
|
| 134 |
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 135 |
const recognition = new SpeechRecognition();
|
| 136 |
recognition.lang = 'tr-TR';
|
| 137 |
recognition.continuous = false;
|
| 138 |
|
| 139 |
+
recognition.onstart = function() {
|
| 140 |
+
speak('Konuşmaya başlayın.');
|
| 141 |
+
};
|
| 142 |
|
| 143 |
recognition.onresult = function(event) {
|
| 144 |
const transcript = event.results[0][0].transcript.toLowerCase();
|
|
|
|
| 145 |
handleVoiceCommand(transcript);
|
| 146 |
};
|
| 147 |
|
| 148 |
+
recognition.onerror = function(event) {
|
| 149 |
+
showModal('Geçersiz komut. Lütfen tekrar deneyin.');
|
| 150 |
+
};
|
| 151 |
+
|
| 152 |
function handleVoiceCommand(command) {
|
|
|
|
| 153 |
if (command.includes('kimlik avı')) {
|
| 154 |
handlePhishing();
|
| 155 |
} else if (command.includes('fidye yazılımı')) {
|
|
|
|
| 161 |
} else {
|
| 162 |
showModal('Geçersiz komut. Lütfen tekrar deneyin.');
|
| 163 |
}
|
| 164 |
+
logUserAction('voice', command);
|
| 165 |
}
|
| 166 |
|
| 167 |
function startRecognition() {
|
|
|
|
| 180 |
<button onclick="handlePhishingResponse(true)">Bağlantıya Tıkla</button>
|
| 181 |
<button onclick="handlePhishingResponse(false)">Bağlantıya Tıklama</button>
|
| 182 |
`;
|
| 183 |
+
speak('Kimlik avı saldırısı! Bir e-posta aldınız ve bu e-postadaki bağlantıya tıklamanız isteniyor. Ne yaparsınız? Bağlantıya tıkla veya bağlantıya tıklama seçeneklerinden birini söyleyin.');
|
| 184 |
+
logUserAction('click', 'phishingAttack');
|
|
|
|
| 185 |
}
|
| 186 |
|
| 187 |
function handleRansomware() {
|
|
|
|
| 191 |
<button onclick="handleRansomwareResponse(true)">Fidyeyi Öde</button>
|
| 192 |
<button onclick="handleRansomwareResponse(false)">Fidye Ödemeyin</button>
|
| 193 |
`;
|
| 194 |
+
speak('Fidye yazılımı saldırısı! Bilgisayarınızda şüpheli bir dosya keşfettiniz ve bilgisayarınızda kilitli dosyalar var. Ne yaparsınız? Fidyeyi öde veya fidye ödemeyin seçeneklerinden birini söyleyin.');
|
| 195 |
+
logUserAction('click', 'ransomwareAttack');
|
|
|
|
| 196 |
}
|
| 197 |
|
| 198 |
function handleDdos() {
|
|
|
|
| 202 |
<button onclick="handleDdosResponse(true)">Yük Dengeleyici Kullanın</button>
|
| 203 |
<button onclick="handleDdosResponse(false)">Sadece Bekleyin</button>
|
| 204 |
`;
|
| 205 |
+
speak('DDoS saldırısı! Web siteniz aşırı trafik nedeniyle yavaşlıyor. Nasıl bir tepki verirsiniz? Yük dengeleyici kullanın veya sadece bekleyin seçeneklerinden birini söyleyin.');
|
| 206 |
+
logUserAction('click', 'ddosAttack');
|
|
|
|
| 207 |
}
|
| 208 |
|
| 209 |
function handleMalware() {
|
|
|
|
| 213 |
<button onclick="handleMalwareResponse(true)">Yazılımı Kaldır</button>
|
| 214 |
<button onclick="handleMalwareResponse(false)">Yazılımı Kaldırmayın</button>
|
| 215 |
`;
|
| 216 |
+
speak('Kötü amaçlı yazılım saldırısı! Bilgisayarınıza şüpheli bir yazılım yüklendi. Ne yaparsınız? Yazılımı kaldır veya yazılımı kaldırmayın seçeneklerinden birini söyleyin.');
|
| 217 |
+
logUserAction('click', 'malwareAttack');
|
|
|
|
| 218 |
}
|
| 219 |
|
| 220 |
+
function handlePhishingResponse(accepted) {
|
| 221 |
+
if (accepted) {
|
| 222 |
+
document.getElementById('attack-result').innerHTML = `
|
| 223 |
+
<p>Bağlantıya tıkladınız ve kişisel bilgileriniz çalındı. Güvenlik önlemleri almanız gerekiyor!</p>
|
| 224 |
+
`;
|
| 225 |
+
} else {
|
| 226 |
+
document.getElementById('attack-result').innerHTML = `
|
| 227 |
+
<p>İyi bir seçim yaptınız. Bilgilerinizi korudunuz!</p>
|
| 228 |
+
`;
|
| 229 |
+
}
|
| 230 |
+
logUserAction('response', accepted ? 'clicked' : 'notClicked');
|
| 231 |
}
|
| 232 |
+
|
| 233 |
function handleRansomwareResponse(paid) {
|
| 234 |
+
if (paid) {
|
| 235 |
+
document.getElementById('attack-result').innerHTML = `
|
| 236 |
+
<p>Fidye ödediniz, ancak dosyalarınız hala kilitli olabilir. Yedekleme stratejilerinizi gözden geçirin.</p>
|
| 237 |
+
`;
|
| 238 |
+
} else {
|
| 239 |
+
document.getElementById('attack-result').innerHTML = `
|
| 240 |
+
<p>Fidye ödemediğiniz için dosyalarınız kilitli kaldı. Gelecekte veri yedeklemeye özen gösterin.</p>
|
| 241 |
+
`;
|
| 242 |
+
}
|
| 243 |
+
logUserAction('response', paid ? 'paid' : 'notPaid');
|
| 244 |
}
|
| 245 |
|
| 246 |
function handleDdosResponse(usedLoadBalancer) {
|
| 247 |
+
if (usedLoadBalancer) {
|
| 248 |
+
document.getElementById('attack-result').innerHTML = `
|
| 249 |
+
<p>Yük dengeleyici kullanarak hizmetinizi korudunuz. İyi iş çıkardınız!</p>
|
| 250 |
+
`;
|
| 251 |
+
} else {
|
| 252 |
+
document.getElementById('attack-result').innerHTML = `
|
| 253 |
+
<p>Bekleyerek sorun çözüldü, ancak bu tür saldırılara karşı önlem almanız önemlidir.</p>
|
| 254 |
+
`;
|
| 255 |
+
}
|
| 256 |
+
logUserAction('response', usedLoadBalancer ? 'usedLoadBalancer' : 'waited');
|
| 257 |
}
|
| 258 |
|
| 259 |
function handleMalwareResponse(removed) {
|
| 260 |
+
if (removed) {
|
| 261 |
+
document.getElementById('attack-result').innerHTML = `
|
| 262 |
+
<p>Yazılımı kaldırdınız ve sisteminizi temiz tuttunuz. Harika!</p>
|
| 263 |
+
`;
|
| 264 |
+
} else {
|
| 265 |
+
document.getElementById('attack-result').innerHTML = `
|
| 266 |
+
<p>Kötü amaçlı yazılım bilgisayarınıza zarar verebilir. Gelecekte daha dikkatli olun.</p>
|
| 267 |
+
`;
|
| 268 |
+
}
|
| 269 |
+
logUserAction('response', removed ? 'removed' : 'notRemoved');
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
function speak(message) {
|
| 273 |
+
const speech = new SpeechSynthesisUtterance();
|
| 274 |
+
speech.lang = 'tr-TR';
|
| 275 |
+
speech.text = message;
|
| 276 |
+
window.speechSynthesis.speak(speech);
|
| 277 |
}
|
| 278 |
|
| 279 |
function showModal(message) {
|
| 280 |
+
document.getElementById('modal-text').innerText = message;
|
| 281 |
const modal = document.getElementById('myModal');
|
|
|
|
| 282 |
const span = document.getElementsByClassName('close')[0];
|
|
|
|
|
|
|
| 283 |
modal.style.display = 'block';
|
|
|
|
| 284 |
span.onclick = function() {
|
| 285 |
modal.style.display = 'none';
|
| 286 |
}
|
|
|
|
| 287 |
window.onclick = function(event) {
|
| 288 |
if (event.target == modal) {
|
| 289 |
modal.style.display = 'none';
|
|
|
|
| 291 |
}
|
| 292 |
}
|
| 293 |
|
| 294 |
+
function logUserAction(actionType, actionDetail) {
|
| 295 |
+
const actionLog = {
|
| 296 |
+
timestamp: new Date().toISOString(),
|
| 297 |
+
actionType: actionType,
|
| 298 |
+
actionDetail: actionDetail
|
| 299 |
+
};
|
| 300 |
+
console.log('User Action:', JSON.stringify(actionLog));
|
| 301 |
+
fetch('/log', {
|
| 302 |
method: 'POST',
|
| 303 |
headers: {
|
| 304 |
'Content-Type': 'application/json'
|
| 305 |
},
|
| 306 |
+
body: JSON.stringify(actionLog)
|
| 307 |
+
}).then(response => {
|
| 308 |
+
if (!response.ok) {
|
| 309 |
+
console.error('Failed to log action');
|
| 310 |
+
}
|
| 311 |
});
|
| 312 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
</script>
|
| 314 |
</body>
|
| 315 |
+
</html>
|