File size: 13,000 Bytes
d7f6772
 
 
 
 
 
e7e913c
68e4cd5
e7e913c
68e4cd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768f946
68e4cd5
768f946
68e4cd5
768f946
68e4cd5
768f946
 
 
 
 
 
 
 
 
e7e913c
68e4cd5
e7e913c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68e4cd5
 
 
 
 
 
e7e913c
 
 
65367e2
68e4cd5
 
 
 
 
e7e913c
 
 
 
68e4cd5
 
 
 
 
 
 
 
 
 
 
 
e7e913c
68e4cd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7e913c
 
68e4cd5
 
 
 
 
 
 
 
 
e7e913c
 
68e4cd5
 
 
 
 
 
 
 
 
e7e913c
 
68e4cd5
 
 
 
 
 
 
 
 
e7e913c
 
68e4cd5
 
e7e913c
 
 
 
 
 
 
 
 
 
 
68e4cd5
e7e913c
68e4cd5
e7e913c
 
 
 
 
 
 
 
 
 
68e4cd5
 
 
e7e913c
 
 
 
 
 
 
 
 
 
68e4cd5
 
 
e7e913c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68e4cd5
 
 
e7e913c
68e4cd5
 
 
 
 
 
 
 
 
 
 
 
 
e7e913c
 
 
 
 
 
 
 
68e4cd5
 
 
 
e7e913c
 
 
 
 
68e4cd5
 
 
d7f6772
e7e913c
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Saldırı Simülatörü</title>
    <link rel="stylesheet" href="styles.css">
    <style>
       body {
            background-color: rgb(12, 185, 228);
            color: rgb(89, 0, 233);
            font-family: 'Arial', sans-serif;
        }
        header {
            text-align: center;
            margin: 20px 0;
        }
        main {
            text-align: center;
        }
        section#attack-simulator {
            margin: 20px auto;
            width: 80%;
            max-width: 600px;
            text-align: left;
        }
        button {
            display: block;
            width: 100%;
            margin: 10px 0;
            padding: 10px;
            font-size: 16px;
            cursor: pointer;
        }
        #attack-result {
            margin-top: 20px;
        }
        /* Modal Pencere Stilleri */
        .modal {
            display: none;
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgb(0,0,0);
            background-color: rgba(0,0,0,0.4);
            padding-top: 60px;
        }
        .modal-content {
            background-color: #fefefe;
            margin: 5% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 80%;
        }
        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
        }
        .close:hover,
        .close:focus {
            color: black;
            text-decoration: none;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <header>
        <h1>Saldırı Simülatörü</h1>
    </header>
    <main>
        <section id="attack-simulator">
            <h2>Simülasyon Senaryoları</h2>
            <button id="phishingAttack">Kimlik Avı Saldırısı</button>
            <button id="ransomwareAttack">Fidye Yazılımı Saldırısı</button>
            <button id="ddosAttack">DDoS Saldırısı</button>
            <button id="malwareAttack">Kötü Amaçlı Yazılım Saldırısı</button>
            <div id="attack-result"></div>
        </section>
    </main>
    <script src="scripts.js"></script>
    <script>
        // JavaScript kodu (kullanıcı eylemlerini kaydetme)

        function logUserAction(actionType, actionDetail) {
            const actionLog = {
                timestamp: new Date().toISOString(),
                actionType: actionType,
                actionDetail: actionDetail
            };
            console.log('User Action:', JSON.stringify(actionLog));
            fetch('/log', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(actionLog)
            }).then(response => {
                if (!response.ok) {
                    console.error('Failed to log action');
                }
            });
        }

        document.getElementById('phishingAttack').addEventListener('click', () => {
            document.getElementById('attack-result').innerHTML = `
                <h3>Kimlik Avı Saldırısı!</h3>
                <p>Bir e-posta aldınız ve bu e-postadaki bağlantıya tıklamanız isteniyor. Ne yaparsınız?</p>
                <button onclick="handlePhishingResponse(true)">Bağlantıya Tıkla</button>
                <button onclick="handlePhishingResponse(false)">Bağlantıya Tıklama</button>
            `;
        });

        function handlePhishingResponse(accepted) {
            if (accepted) {
                document.getElementById('attack-result').innerHTML = `
                    <p>Bağlantıya tıkladınız ve kişisel bilgileriniz çalındı. Güvenlik önlemleri almanız gerekiyor!</p>
                `;
            } else {
                document.getElementById('attack-result').innerHTML = `
                    <p>İyi bir seçim yaptınız. Bilgilerinizi korudunuz!</p>
                `;
            }
            logUserAction('response', accepted ? 'clicked' : 'notClicked');
        }

        // Web Speech API setup
        const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
        const recognition = new SpeechRecognition();
        recognition.lang = 'tr-TR';
        recognition.continuous = false;

        recognition.onstart = function() {
            speak('Konuşmaya başlayın.');
        };

        recognition.onresult = function(event) {
            const transcript = event.results[0][0].transcript.toLowerCase();
            handleVoiceCommand(transcript);
        };

        recognition.onerror = function(event) {
            showModal('Geçersiz komut. Lütfen tekrar deneyin.');
        };

        function handleVoiceCommand(command) {
            if (command.includes('kimlik avı')) {
                handlePhishing();
            } else if (command.includes('fidye yazılımı')) {
                handleRansomware();
            } else if (command.includes('ddos saldırısı')) {
                handleDdos();
            } else if (command.includes('kötü amaçlı yazılım')) {
                handleMalware();
            } else {
                showModal('Geçersiz komut. Lütfen tekrar deneyin.');
            }
            logUserAction('voice', command);
        }

        function startRecognition() {
            recognition.start();
        }

        document.getElementById('phishingAttack').addEventListener('click', handlePhishing);
        document.getElementById('ransomwareAttack').addEventListener('click', handleRansomware);
        document.getElementById('ddosAttack').addEventListener('click', handleDdos);
        document.getElementById('malwareAttack').addEventListener('click', handleMalware);

        function handlePhishing() {
            document.getElementById('attack-result').innerHTML = `
                <h3>Kimlik Avı Saldırısı!</h3>
                <p>Bir e-posta aldınız ve bu e-postadaki bağlantıya tıklamanız isteniyor. Ne yaparsınız?</p>
                <button onclick="handlePhishingResponse(true)">Bağlantıya Tıkla</button>
                <button onclick="handlePhishingResponse(false)">Bağlantıya Tıklama</button>
            `;
            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.');
            logUserAction('click', 'phishingAttack');
        }

        function handleRansomware() {
            document.getElementById('attack-result').innerHTML = `
                <h3>Fidye Yazılımı Saldırısı!</h3>
                <p>Bilgisayarınızda şüpheli bir dosya keşfettiniz ve bilgisayarınızda kilitli dosyalar var. Ne yaparsınız?</p>
                <button onclick="handleRansomwareResponse(true)">Fidyeyi Öde</button>
                <button onclick="handleRansomwareResponse(false)">Fidye Ödemeyin</button>
            `;
            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.');
            logUserAction('click', 'ransomwareAttack');
        }

        function handleDdos() {
            document.getElementById('attack-result').innerHTML = `
                <h3>DDoS Saldırısı!</h3>
                <p>Web siteniz aşırı trafik nedeniyle yavaşlıyor. Nasıl bir tepki verirsiniz?</p>
                <button onclick="handleDdosResponse(true)">Yük Dengeleyici Kullanın</button>
                <button onclick="handleDdosResponse(false)">Sadece Bekleyin</button>
            `;
            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.');
            logUserAction('click', 'ddosAttack');
        }

        function handleMalware() {
            document.getElementById('attack-result').innerHTML = `
                <h3>Kötü Amaçlı Yazılım Saldırısı!</h3>
                <p>Bilgisayarınıza şüpheli bir yazılım yüklendi. Ne yaparsınız?</p>
                <button onclick="handleMalwareResponse(true)">Yazılımı Kaldır</button>
                <button onclick="handleMalwareResponse(false)">Yazılımı Kaldırmayın</button>
            `;
            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.');
            logUserAction('click', 'malwareAttack');
        }

        function handlePhishingResponse(accepted) {
            if (accepted) {
                document.getElementById('attack-result').innerHTML = `
                    <p>Bağlantıya tıkladınız ve kişisel bilgileriniz çalındı. Güvenlik önlemleri almanız gerekiyor!</p>
                `;
            } else {
                document.getElementById('attack-result').innerHTML = `
                    <p>İyi bir seçim yaptınız. Bilgilerinizi korudunuz!</p>
                `;
            }
            logUserAction('response', accepted ? 'clicked' : 'notClicked');
        }

        function handleRansomwareResponse(paid) {
            if (paid) {
                document.getElementById('attack-result').innerHTML = `
                    <p>Fidye ödediniz, ancak dosyalarınız hala kilitli olabilir. Yedekleme stratejilerinizi gözden geçirin.</p>
                `;
            } else {
                document.getElementById('attack-result').innerHTML = `
                    <p>Fidye ödemediğiniz için dosyalarınız kilitli kaldı. Gelecekte veri yedeklemeye özen gösterin.</p>
                `;
            }
            logUserAction('response', paid ? 'paid' : 'notPaid');
        }

        function handleDdosResponse(usedLoadBalancer) {
            if (usedLoadBalancer) {
                document.getElementById('attack-result').innerHTML = `
                    <p>Yük dengeleyici kullanarak hizmetinizi korudunuz. İyi iş çıkardınız!</p>
                `;
            } else {
                document.getElementById('attack-result').innerHTML = `
                    <p>Bekleyerek sorun çözüldü, ancak bu tür saldırılara karşı önlem almanız önemlidir.</p>
                `;
            }
            logUserAction('response', usedLoadBalancer ? 'usedLoadBalancer' : 'waited');
        }

        function handleMalwareResponse(removed) {
            if (removed) {
                document.getElementById('attack-result').innerHTML = `
                    <p>Yazılımı kaldırdınız ve sisteminizi temiz tuttunuz. Harika!</p>
                `;
            } else {
                document.getElementById('attack-result').innerHTML = `
                    <p>Kötü amaçlı yazılım bilgisayarınıza zarar verebilir. Gelecekte daha dikkatli olun.</p>
                `;
            }
            logUserAction('response', removed ? 'removed' : 'notRemoved');
        }

        function speak(message) {
            const speech = new SpeechSynthesisUtterance();
            speech.lang = 'tr-TR';
            speech.text = message;
            window.speechSynthesis.speak(speech);
        }

        function showModal(message) {
            document.getElementById('modal-text').innerText = message;
            const modal = document.getElementById('myModal');
            const span = document.getElementsByClassName('close')[0];
            modal.style.display = 'block';
            span.onclick = function() {
                modal.style.display = 'none';
            }
            window.onclick = function(event) {
                if (event.target == modal) {
                    modal.style.display = 'none';
                }
            }
        }

        function logUserAction(actionType, actionDetail) {
            const actionLog = {
                timestamp: new Date().toISOString(),
                actionType: actionType,
                actionDetail: actionDetail
            };
            console.log('User Action:', JSON.stringify(actionLog));
            fetch('/log', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(actionLog)
            }).then(response => {
                if (!response.ok) {
                    console.error('Failed to log action');
                }
            });
        }
    </script>
</body>
</html>