-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsolution_engine.py
More file actions
59 lines (57 loc) · 2.23 KB
/
Copy pathsolution_engine.py
File metadata and controls
59 lines (57 loc) · 2.23 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
def get_recommendations(attack_type: str):
attack_type = attack_type.lower()
advice = {
"dos": {
"message": "⚠️ DoS Attack Detected — Stay calm, follow these steps:",
"steps": [
"Temporarily disconnect from the network.",
"Block suspicious IPs in your firewall.",
"Close unused open ports.",
"Restart your network adapter.",
],
},
"port_scan": {
"message": "🔍 Port Scan Detected — Let's secure your ports:",
"steps": [
"Close all unnecessary open ports.",
"Enable strict firewall rules.",
"Monitor incoming connections for unusual patterns.",
"Ensure router firewall is enabled.",
],
},
"sql_injection": {
"message": "💉 SQL Injection Detected — Protect your database:",
"steps": [
"Block the source IP immediately.",
"Review and patch vulnerable endpoints.",
"Enable parameterized queries in your app.",
"Audit database access logs.",
],
},
"xss": {
"message": "🌐 XSS Attack Detected — Secure your web layer:",
"steps": [
"Enable Content Security Policy (CSP) headers.",
"Sanitize all user inputs server-side.",
"Block the source IP in your WAF.",
"Review recent web application logs.",
],
},
"malware": {
"message": "🦠 Malware Activity Detected — Act fast:",
"steps": [
"Terminate unknown or suspicious processes.",
"Disconnect from the internet temporarily.",
"Run an offline antivirus scan.",
"Delete temporary files and check startup programs.",
],
},
}
return advice.get(attack_type, {
"message": "✅ Normal Traffic — Everything looks fine.",
"steps": [
"Network activity is within normal parameters.",
"Continue normal operations 😊",
"System is being monitored in real-time.",
],
})