File size: 40,597 Bytes
f3eaa0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>防火墙告警中心</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .danger-level-critical {
            background-color: rgba(220, 38, 38, 0.1);
            border-left: 4px solid #dc2626;
        }
        .danger-level-high {
            background-color: rgba(234, 88, 12, 0.1);
            border-left: 4px solid #ea580c;
        }
        .danger-level-medium {
            background-color: rgba(245, 158, 11, 0.1);
            border-left: 4px solid #f59e0b;
        }
        .danger-level-low {
            background-color: rgba(59, 130, 246, 0.1);
            border-left: 4px solid #3b82f6;
        }
        .danger-level-info {
            background-color: rgba(16, 185, 129, 0.1);
            border-left: 4px solid #10b981;
        }
        
        .badge-critical {
            background-color: #dc2626;
            color: white;
        }
        .badge-high {
            background-color: #ea580c;
            color: white;
        }
        .badge-medium {
            background-color: #f59e0b;
            color: white;
        }
        .badge-low {
            background-color: #3b82f6;
            color: white;
        }
        .badge-info {
            background-color: #10b981;
            color: white;
        }
        
        .animate-pulse {
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }
        
        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.5;
            }
        }
        
        .collapsible-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }
        
        .collapsible-content.expanded {
            max-height: 1000px;
            transition: max-height 0.5s ease-in;
        }
        
        .rotate-90 {
            transform: rotate(90deg);
            transition: transform 0.3s ease;
        }
        
        .payload-container {
            background-color: #f8f9fa;
            border-radius: 4px;
            padding: 10px;
            font-family: monospace;
            white-space: pre-wrap;
            word-break: break-all;
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #dee2e6;
        }
        
        .payload-title {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 5px;
        }
        
        .copy-btn {
            background-color: #e9ecef;
            border: none;
            border-radius: 4px;
            padding: 2px 8px;
            font-size: 12px;
            cursor: pointer;
        }
        
        .copy-btn:hover {
            background-color: #dee2e6;
        }
        
        .ai-analysis {
            background-color: rgba(0, 0, 0, 0.03);
            border-radius: 6px;
            padding: 12px;
            margin-top: 10px;
            border-left: 3px solid #6366f1;
        }
        
        .ai-analysis-title {
            font-weight: 600;
            color: #4f46e5;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
        }
        
        .ai-analysis-title i {
            margin-right: 6px;
        }
        
        .ai-analysis-content {
            font-size: 14px;
            line-height: 1.5;
            color: #4b5563;
        }
    </style>
</head>
<body class="bg-gray-50">
    <div class="container mx-auto px-4 py-8">
        <header class="mb-8">
            <h1 class="text-3xl font-bold text-gray-800 flex items-center">
                <i class="fas fa-shield-alt text-blue-500 mr-3"></i>
                防火墙告警中心
            </h1>
            <div class="flex justify-between items-center mt-4">
                <div class="text-sm text-gray-600">
                    <span class="font-semibold">最后更新时间:</span> 
                    <span id="last-update-time">刚刚</span>
                </div>
                <div class="flex space-x-2">
                    <button class="px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition flex items-center">
                        <i class="fas fa-sync-alt mr-2"></i> 刷新
                    </button>
                    <button class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 transition flex items-center">
                        <i class="fas fa-cog mr-2"></i> 设置
                    </button>
                </div>
            </div>
        </header>
        
        <div class="bg-white rounded-lg shadow-md overflow-hidden mb-6">
            <div class="p-4 border-b border-gray-200 flex justify-between items-center">
                <h2 class="text-xl font-semibold text-gray-800">告警筛选</h2>
                <button id="toggle-filters" class="text-blue-500 hover:text-blue-700 transition">
                    <i class="fas fa-chevron-down"></i>
                </button>
            </div>
            <div id="filter-content" class="collapsible-content expanded">
                <div class="p-4 grid grid-cols-1 md:grid-cols-3 gap-4">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-1">时间范围</label>
                        <select class="w-full p-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
                            <option>最近1小时</option>
                            <option selected>最近24小时</option>
                            <option>最近7天</option>
                            <option>最近30天</option>
                            <option>自定义</option>
                        </select>
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-1">危险等级</label>
                        <div class="flex flex-wrap gap-2">
                            <label class="inline-flex items-center">
                                <input type="checkbox" class="rounded text-red-600" checked>
                                <span class="ml-2 text-sm">严重</span>
                            </label>
                            <label class="inline-flex items-center">
                                <input type="checkbox" class="rounded text-orange-600" checked>
                                <span class="ml-2 text-sm"></span>
                            </label>
                            <label class="inline-flex items-center">
                                <input type="checkbox" class="rounded text-yellow-600" checked>
                                <span class="ml-2 text-sm"></span>
                            </label>
                            <label class="inline-flex items-center">
                                <input type="checkbox" class="rounded text-blue-600" checked>
                                <span class="ml-2 text-sm"></span>
                            </label>
                            <label class="inline-flex items-center">
                                <input type="checkbox" class="rounded text-green-600">
                                <span class="ml-2 text-sm">信息</span>
                            </label>
                        </div>
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-1">攻击类型</label>
                        <select class="w-full p-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
                            <option>全部类型</option>
                            <option>SQL注入</option>
                            <option>XSS攻击</option>
                            <option>DDoS攻击</option>
                            <option>暴力破解</option>
                            <option>端口扫描</option>
                            <option>恶意软件</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="bg-white rounded-lg shadow-md overflow-hidden">
            <div class="p-4 border-b border-gray-200 flex justify-between items-center">
                <h2 class="text-xl font-semibold text-gray-800">聚合告警列表</h2>
                <div class="text-sm text-gray-600">
                    <span class="font-semibold">总计:</span> 
                    <span id="total-alerts">24</span> 条告警
                </div>
            </div>
            
            <div class="divide-y divide-gray-200">
                <!-- 示例告警条目 1 -->
                <div class="danger-level-critical p-4 hover:bg-gray-50 transition cursor-pointer">
                    <div class="flex justify-between items-start">
                        <div>
                            <div class="flex items-center mb-2">
                                <span class="badge-critical text-xs font-semibold px-2 py-1 rounded-full mr-2">严重</span>
                                <h3 class="text-lg font-medium text-gray-800">SQL注入攻击</h3>
                            </div>
                            <div class="text-sm text-gray-600 mb-3">
                                <span class="font-medium">最近发生:</span> 2023-06-15 14:23:45
                                <span class="mx-2">|</span>
                                <span class="font-medium">告警次数:</span> 8
                            </div>
                        </div>
                        <button class="expand-btn text-gray-400 hover:text-gray-600 transition">
                            <i class="fas fa-chevron-down"></i>
                        </button>
                    </div>
                    
                    <div class="collapsible-content">
                        <div class="ai-analysis">
                            <div class="ai-analysis-title">
                                <i class="fas fa-brain"></i>
                                AI风险分析
                            </div>
                            <div class="ai-analysis-content">
                                此告警被标记为<strong class="text-red-600">严重</strong>级别,因为:
                                <ul class="list-disc pl-5 mt-2 space-y-1">
                                    <li>检测到多个SQL注入尝试,包括使用'OR '1'='1'等经典注入技术</li>
                                    <li>攻击针对的是登录接口,可能导致认证绕过和数据库完全泄露</li>
                                    <li>攻击源来自多个地理位置,表明是有组织的攻击活动</li>
                                    <li>检测到UNION SELECT和WAITFOR DELAY等高级注入技术</li>
                                    <li>攻击成功可能导致整个数据库被窃取或破坏</li>
                                </ul>
                            </div>
                        </div>
                        
                        <div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">攻击源信息</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>位置</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>192.168.1.45</div>
                                            <div>54321</div>
                                            <div>中国, 北京</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.0.34.12</div>
                                            <div>12345</div>
                                            <div>美国, 加州</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>172.16.23.67</div>
                                            <div>45678</div>
                                            <div>德国, 柏林</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">受害资产</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>服务</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.5</div>
                                            <div>80</div>
                                            <div>Web服务</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.6</div>
                                            <div>443</div>
                                            <div>HTTPS服务</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">攻击Payload</h4>
                            <div class="payload-container">
                                <div class="payload-title">
                                    <span>示例攻击请求:</span>
                                    <button class="copy-btn" onclick="copyToClipboard(this)">
                                        <i class="fas fa-copy mr-1"></i>复制
                                    </button>
                                </div>
                                POST /login.php HTTP/1.1
                                Host: example.com
                                User-Agent: Mozilla/5.0
                                Content-Type: application/x-www-form-urlencoded
                                Content-Length: 132
                                
                                username=admin' OR '1'='1'--&password=123456
                                
                                <div class="payload-title mt-3">
                                    <span>其他变体:</span>
                                </div>
                                1. username=admin' UNION SELECT null,username,password FROM users--
                                2. username=admin' AND 1=CONVERT(int,(SELECT table_name FROM information_schema.tables))--
                                3. username=admin'; WAITFOR DELAY '0:0:5'--
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">详细信息</h4>
                            <div class="bg-gray-50 rounded-md p-3 text-sm">
                                <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                                    <div>
                                        <div class="text-gray-500">协议</div>
                                        <div>TCP</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">判断来源</div>
                                        <div>防火墙规则</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">首次发生</div>
                                        <div>2023-06-15 08:12:33</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">最近发生</div>
                                        <div>2023-06-15 14:23:45</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4 flex justify-end space-x-2">
                            <button class="px-3 py-1 bg-blue-500 text-white text-sm rounded-md hover:bg-blue-600 transition">
                                <i class="fas fa-eye mr-1"></i> 查看详情
                            </button>
                            <button class="px-3 py-1 bg-green-500 text-white text-sm rounded-md hover:bg-green-600 transition">
                                <i class="fas fa-check mr-1"></i> 标记为已处理
                            </button>
                            <button class="px-3 py-1 bg-gray-200 text-gray-700 text-sm rounded-md hover:bg-gray-300 transition">
                                <i class="fas fa-ban mr-1"></i> 忽略此类
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 示例告警条目 2 -->
                <div class="danger-level-high p-4 hover:bg-gray-50 transition cursor-pointer">
                    <div class="flex justify-between items-start">
                        <div>
                            <div class="flex items-center mb-2">
                                <span class="badge-high text-xs font-semibold px-2 py-1 rounded-full mr-2"></span>
                                <h3 class="text-lg font-medium text-gray-800">暴力破解尝试</h3>
                            </div>
                            <div class="text-sm text-gray-600 mb-3">
                                <span class="font-medium">最近发生:</span> 2023-06-15 13:45:21
                                <span class="mx-2">|</span>
                                <span class="font-medium">告警次数:</span> 12
                            </div>
                        </div>
                        <button class="expand-btn text-gray-400 hover:text-gray-600 transition">
                            <i class="fas fa-chevron-down"></i>
                        </button>
                    </div>
                    
                    <div class="collapsible-content">
                        <div class="ai-analysis">
                            <div class="ai-analysis-title">
                                <i class="fas fa-brain"></i>
                                AI风险分析
                            </div>
                            <div class="ai-analysis-content">
                                此告警被标记为<strong class="text-orange-600"></strong>级别,因为:
                                <ul class="list-disc pl-5 mt-2 space-y-1">
                                    <li>检测到针对SSH和RDP服务的持续暴力破解尝试</li>
                                    <li>攻击频率高(12次),表明是自动化工具发起的攻击</li>
                                    <li>攻击源IP来自高风险地区(俄罗斯、乌克兰)</li>
                                    <li>尝试了root、admin等特权账户</li>
                                    <li>使用了常见弱密码组合(123456, password等)</li>
                                    <li>成功破解可能导致服务器被完全控制</li>
                                    <li>虽然攻击成功率低,但潜在影响严重</li>
                                </ul>
                            </div>
                        </div>
                        
                        <div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">攻击源信息</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>位置</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>45.67.89.123</div>
                                            <div>34567</div>
                                            <div>俄罗斯, 莫斯科</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>78.90.12.34</div>
                                            <div>23456</div>
                                            <div>乌克兰, 基辅</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">受害资产</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>服务</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.10</div>
                                            <div>22</div>
                                            <div>SSH服务</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.15</div>
                                            <div>3389</div>
                                            <div>RDP服务</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">攻击Payload</h4>
                            <div class="payload-container">
                                <div class="payload-title">
                                    <span>SSH暴力破解日志:</span>
                                    <button class="copy-btn" onclick="copyToClipboard(this)">
                                        <i class="fas fa-copy mr-1"></i>复制
                                    </button>
                                </div>
                                Jun 15 13:45:21 sshd[12345]: Failed password for root from 45.67.89.123 port 34567 ssh2
                                Jun 15 13:45:23 sshd[12345]: Failed password for root from 45.67.89.123 port 34567 ssh2
                                Jun 15 13:45:25 sshd[12345]: Failed password for admin from 45.67.89.123 port 34567 ssh2
                                Jun 15 13:45:27 sshd[12345]: Failed password for test from 45.67.89.123 port 34567 ssh2
                                
                                <div class="payload-title mt-3">
                                    <span>常见尝试用户名:</span>
                                </div>
                                root, admin, test, guest, user, oracle, mysql, postgres, ubuntu, pi
                                
                                <div class="payload-title mt-3">
                                    <span>常见尝试密码:</span>
                                </div>
                                123456, password, admin, 12345, 123456789, qwerty, 111111, 1234567, 123123, abc123
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">详细信息</h4>
                            <div class="bg-gray-50 rounded-md p-3 text-sm">
                                <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                                    <div>
                                        <div class="text-gray-500">协议</div>
                                        <div>TCP</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">判断来源</div>
                                        <div>异常行为检测</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">首次发生</div>
                                        <div>2023-06-15 09:05:17</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">最近发生</div>
                                        <div>2023-06-15 13:45:21</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4 flex justify-end space-x-2">
                            <button class="px-3 py-1 bg-blue-500 text-white text-sm rounded-md hover:bg-blue-600 transition">
                                <i class="fas fa-eye mr-1"></i> 查看详情
                            </button>
                            <button class="px-3 py-1 bg-green-500 text-white text-sm rounded-md hover:bg-green-600 transition">
                                <i class="fas fa-check mr-1"></i> 标记为已处理
                            </button>
                            <button class="px-3 py-1 bg-gray-200 text-gray-700 text-sm rounded-md hover:bg-gray-300 transition">
                                <i class="fas fa-ban mr-1"></i> 忽略此类
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 示例告警条目 3 -->
                <div class="danger-level-medium p-4 hover:bg-gray-50 transition cursor-pointer">
                    <div class="flex justify-between items-start">
                        <div>
                            <div class="flex items-center mb-2">
                                <span class="badge-medium text-xs font-semibold px-2 py-1 rounded-full mr-2"></span>
                                <h3 class="text-lg font-medium text-gray-800">端口扫描活动</h3>
                            </div>
                            <div class="text-sm text-gray-600 mb-3">
                                <span class="font-medium">最近发生:</span> 2023-06-15 12:30:15
                                <span class="mx-2">|</span>
                                <span class="font-medium">告警次数:</span> 4
                            </div>
                        </div>
                        <button class="expand-btn text-gray-400 hover:text-gray-600 transition">
                            <i class="fas fa-chevron-down"></i>
                        </button>
                    </div>
                    
                    <div class="collapsible-content">
                        <div class="ai-analysis">
                            <div class="ai-analysis-title">
                                <i class="fas fa-brain"></i>
                                AI风险分析
                            </div>
                            <div class="ai-analysis-content">
                                此告警被标记为<strong class="text-yellow-600"></strong>级别,因为:
                                <ul class="list-disc pl-5 mt-2 space-y-1">
                                    <li>检测到来自越南IP的端口扫描活动</li>
                                    <li>扫描范围包括22-100和135-139等敏感端口范围</li>
                                    <li>扫描行为特征与Nmap工具匹配</li>
                                    <li>虽然端口扫描本身不直接造成损害,但通常是攻击前的情报收集阶段</li>
                                    <li>扫描频率中等(4次),表明攻击者正在寻找网络弱点</li>
                                    <li>如果发现开放端口,可能会引发后续更严重的攻击</li>
                                </ul>
                            </div>
                        </div>
                        
                        <div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">攻击源信息</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>位置</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>103.45.67.89</div>
                                            <div>34567</div>
                                            <div>越南, 河内</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-sm font-medium text-gray-700 mb-2">受害资产</h4>
                                <div class="bg-gray-50 rounded-md p-3">
                                    <div class="grid grid-cols-3 gap-2 text-sm mb-2 font-medium text-gray-500">
                                        <div>IP地址</div>
                                        <div>端口</div>
                                        <div>服务</div>
                                    </div>
                                    <div class="space-y-2">
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.20</div>
                                            <div>22-100</div>
                                            <div>多端口</div>
                                        </div>
                                        <div class="grid grid-cols-3 gap-2 text-sm">
                                            <div>10.10.10.25</div>
                                            <div>135-139</div>
                                            <div>多端口</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">攻击Payload</h4>
                            <div class="payload-container">
                                <div class="payload-title">
                                    <span>端口扫描行为特征:</span>
                                    <button class="copy-btn" onclick="copyToClipboard(this)">
                                        <i class="fas fa-copy mr-1"></i>复制
                                    </button>
                                </div>
                                1. 短时间内对多个端口发起TCP SYN请求
                                2. 使用Nmap扫描特征:
                                   - Nmap -sS -p 22,80,443,3389 10.10.10.20
                                   - Nmap -sV -O -p- 10.10.10.25
                                3. 异常端口访问模式:
                                   - 依次访问22,23,25,53,80,443,3389等常见服务端口
                                   - 对高端口(>10000)进行随机扫描
                                
                                <div class="payload-title mt-3">
                                    <span>检测到的扫描工具指纹:</span>
                                </div>
                                - Nmap (版本: 7.92)
                                - Masscan
                                - Zmap
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <h4 class="text-sm font-medium text-gray-700 mb-2">详细信息</h4>
                            <div class="bg-gray-50 rounded-md p-3 text-sm">
                                <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                                    <div>
                                        <div class="text-gray-500">协议</div>
                                        <div>TCP/UDP</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">判断来源</div>
                                        <div>行为分析</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">首次发生</div>
                                        <div>2023-06-15 11:05:42</div>
                                    </div>
                                    <div>
                                        <div class="text-gray-500">最近发生</div>
                                        <div>2023-06-15 12:30:15</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4 flex justify-end space-x-2">
                            <button class="px-3 py-1 bg-blue-500 text-white text-sm rounded-md hover:bg-blue-600 transition">
                                <i class="fas fa-eye mr-1"></i> 查看详情
                            </button>
                            <button class="px-3 py-1 bg-green-500 text-white text-sm rounded-md hover:bg-green-600 transition">
                                <i class="fas fa-check mr-1"></i> 标记为已处理
                            </button>
                            <button class="px-3 py-1 bg-gray-200 text-gray-700 text-sm rounded-md hover:bg-gray-300 transition">
                                <i class="fas fa-ban mr-1"></i> 忽略此类
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 更新时间
        function updateTime() {
            const now = new Date();
            const options = { 
                year: 'numeric', 
                month: '2-digit', 
                day: '2-digit', 
                hour: '2-digit', 
                minute: '2-digit', 
                second: '2-digit',
                hour12: false
            };
            document.getElementById('last-update-time').textContent = now.toLocaleString('zh-CN', options);
        }
        
        // 初始化更新时间
        updateTime();
        setInterval(updateTime, 60000); // 每分钟更新一次
        
        // 折叠/展开筛选区域
        document.getElementById('toggle-filters').addEventListener('click', function() {
            const content = document.getElementById('filter-content');
            content.classList.toggle('expanded');
            this.querySelector('i').classList.toggle('rotate-90');
        });
        
        // 折叠/展开告警详情
        document.querySelectorAll('.expand-btn').forEach(btn => {
            btn.addEventListener('click', function(e) {
                e.stopPropagation();
                const content = this.closest('div').nextElementSibling;
                content.classList.toggle('expanded');
                this.querySelector('i').classList.toggle('rotate-90');
            });
        });
        
        // 点击整行也可以展开/折叠
        document.querySelectorAll('.danger-level-critical, .danger-level-high, .danger-level-medium').forEach(row => {
            row.addEventListener('click', function(e) {
                if (e.target.tagName !== 'BUTTON' && e.target.tagName !== 'I') {
                    const btn = this.querySelector('.expand-btn');
                    const content = btn.nextElementSibling || btn.closest('div').nextElementSibling;
                    content.classList.toggle('expanded');
                    btn.querySelector('i').classList.toggle('rotate-90');
                }
            });
        });
        
        // 复制Payload内容到剪贴板
        function copyToClipboard(button) {
            const payloadContainer = button.closest('.payload-title').nextElementSibling;
            const range = document.createRange();
            range.selectNode(payloadContainer);
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand('copy');
            window.getSelection().removeAllRanges();
            
            // 显示复制成功反馈
            const originalText = button.innerHTML;
            button.innerHTML = '<i class="fas fa-check mr-1"></i>已复制';
            setTimeout(() => {
                button.innerHTML = originalText;
            }, 2000);
        }
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=dihin/warning" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>