ahmedumeraziz commited on
Commit
e2a1e70
·
verified ·
1 Parent(s): da8d5a0

Update data.py

Browse files
Files changed (1) hide show
  1. data.py +48 -84
data.py CHANGED
@@ -10,14 +10,14 @@ EVENT_DATABASE = [
10
  "Source": "Security",
11
  "Description": "An account failed to log on.",
12
  "Win_R": "eventvwr.msc",
13
- "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4625} -MaxEvents 20",
14
  "MITRE": "T1110 (Brute Force)",
15
- "Logic": "High frequency of failures (10+ per minute) suggests a brute force attack.",
16
- "Investigation_Steps": "1. Win+R > eventvwr.msc\n2. Security Log > Filter ID 4625\n3. Check 'Source Network Address' to find the attacker's IP.",
17
- "Scenario": "Attacker guessing passwords for a local admin account.",
18
  "Response": "Block Source IP at firewall. Check if the account is now locked.",
19
- "Remediation": "Implement MFA and account lockout policies.",
20
- "Tips": "Logon Type 3 is Network; Type 10 is RDP."
21
  },
22
  {
23
  "ID": "4624",
@@ -27,33 +27,15 @@ EVENT_DATABASE = [
27
  "Source": "Security",
28
  "Description": "An account was successfully logged on.",
29
  "Win_R": "eventvwr.msc",
30
- "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4624} -MaxEvents 20",
31
  "MITRE": "T1078 (Valid Accounts)",
32
- "Logic": "Look for logins at unusual hours or from unusual locations.",
33
- "Investigation_Steps": "1. Filter ID 4624\n2. Verify the 'Logon Type'. Type 10 is RDP—check if the user usually works remotely.",
34
- "Scenario": "Credential theft leading to lateral movement.",
35
- "Response": "Confirm with the user if they performed the login.",
36
- "Remediation": "Enforce 'Least Privilege' and rotate credentials.",
37
- "Tips": "Check 'TargetUserName' to ensure it's a known employee."
38
  },
39
- {
40
- "ID": "4672",
41
- "Name": "Admin Privs Assigned",
42
- "Category": "Authentication",
43
- "Severity": "Medium",
44
- "Source": "Security",
45
- "Description": "Special privileges assigned to a new logon.",
46
- "Win_R": "secpol.msc",
47
- "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4672}",
48
- "MITRE": "T1078.002 (Domain Accounts)",
49
- "Logic": "Triggered when an admin logs in. Suspicious if triggered by a standard user account.",
50
- "Investigation_Steps": "1. Filter for 4672.\n2. Cross-reference with 4624 to see the source of the login.",
51
- "Scenario": "Privilege escalation where a normal user gains admin rights.",
52
- "Response": "Audit the user's group memberships immediately.",
53
- "Remediation": "Use Privileged Access Management (PAM) tools.",
54
- "Tips": "Look for 'SeDebugPrivilege' which is often used by attackers."
55
- },
56
-
57
  # --- PROCESS & EXECUTION ---
58
  {
59
  "ID": "4688",
@@ -65,12 +47,12 @@ EVENT_DATABASE = [
65
  "Win_R": "taskmgr",
66
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4688} -MaxEvents 50",
67
  "MITRE": "T1059 (Command Execution)",
68
- "Logic": "Watch for cmd.exe or powershell.exe spawned by web servers (w3wp.exe) or Office (winword.exe).",
69
- "Investigation_Steps": "1. Filter ID 4688.\n2. Examine 'Process Command Line'.\n3. Check for 'New Process Name' and 'Parent Process Name'.",
70
- "Scenario": "Phishing email launching a shell via a macro.",
71
- "Response": "Kill the process and isolate the host.",
72
- "Remediation": "Enable ASR Rule: Block Office from creating child processes.",
73
- "Tips": "Command line auditing must be enabled via GPO to see the full command."
74
  },
75
  {
76
  "ID": "1 (Sysmon)",
@@ -82,14 +64,13 @@ EVENT_DATABASE = [
82
  "Win_R": "services.msc",
83
  "PowerShell": "Get-WinEvent -LogName 'Microsoft-Windows-Sysmon/Operational' | Where {$_.ID -eq 1}",
84
  "MITRE": "T1204 (User Execution)",
85
- "Logic": "Analyze hashes (SHA256) of unknown executables.",
86
- "Investigation_Steps": "1. Open Sysmon Operational log.\n2. Filter ID 1.\n3. Copy the Hash and search on VirusTotal.",
87
- "Scenario": "User runs a renamed malware executable (e.g., 'invoice.exe').",
88
- "Response": "Check file hash. If malicious, run a full system scan.",
89
- "Remediation": "Implement AppLocker to allow only signed binaries.",
90
- "Tips": "Sysmon is better than Log 4688 because it provides hashes."
91
  },
92
-
93
  # --- POWERSHELL ---
94
  {
95
  "ID": "4104",
@@ -97,68 +78,51 @@ EVENT_DATABASE = [
97
  "Category": "PowerShell",
98
  "Severity": "Critical",
99
  "Source": "PowerShell/Ops",
100
- "Description": "Captures the full code executed by PowerShell.",
101
  "Win_R": "eventvwr.msc",
102
- "PowerShell": "Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational' | Where {$_.ID -eq 4104}",
103
  "MITRE": "T1059.001 (PowerShell)",
104
- "Logic": "Look for keywords: 'Base64', 'IEX', 'Invoke-WebRequest'.",
105
- "Investigation_Steps": "1. Go to PowerShell/Operational log.\n2. Filter ID 4104.\n3. Read the 'ScriptBlock Text' field.",
106
- "Scenario": "Fileless malware loading a script in memory.",
107
- "Response": "Extract and de-obfuscate the script to find C2 IPs.",
108
  "Remediation": "Set Execution Policy to 'AllSigned'.",
109
- "Tips": "Catches malicious code even if the script file is deleted."
110
  },
111
-
112
- # --- NETWORK & SYSTEM ---
113
  {
114
  "ID": "5156",
115
  "Name": "Network Connection",
116
  "Category": "Network",
117
  "Severity": "Medium",
118
  "Source": "Security",
119
- "Description": "Windows Filtering Platform permitted a connection.",
120
  "Win_R": "wf.msc",
121
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=5156} -MaxEvents 50",
122
  "MITRE": "T1041 (Exfiltration)",
123
- "Logic": "Look for outbound traffic to known malicious IPs or unusual ports.",
124
- "Investigation_Steps": "1. Filter ID 5156.\n2. Check 'Dest Address' and 'Dest Port' (e.g., port 4444 or 8080).",
125
- "Scenario": "Malware 'phoning home' to a Command & Control (C2) server.",
126
- "Response": "Block the destination IP at the perimeter firewall.",
127
- "Remediation": "Restrict outbound traffic to necessary ports only.",
128
- "Tips": "This log generates a LOT of data; use carefully."
129
- },
130
- {
131
- "ID": "6416",
132
- "Name": "USB Device Plugged",
133
- "Category": "System",
134
- "Severity": "Low",
135
- "Source": "Security",
136
- "Description": "A new external device was recognized.",
137
- "Win_R": "devmgmt.msc",
138
- "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=6416}",
139
- "MITRE": "T1200 (Hardware Additions)",
140
- "Logic": "Detection of unauthorized USB storage usage.",
141
- "Investigation_Steps": "1. Filter ID 6416.\n2. Identify the 'Device Description'. Is it a mass storage device?",
142
- "Scenario": "Insider threat stealing data via a thumb drive.",
143
- "Response": "Identify what files were accessed during the USB session (ID 4663).",
144
- "Remediation": "Disable USB ports for non-authorized users via GPO.",
145
- "Tips": "Useful for Data Loss Prevention (DLP) investigations."
146
  },
 
147
  {
148
  "ID": "4720",
149
  "Name": "User Created",
150
  "Category": "User Management",
151
  "Severity": "High",
152
  "Source": "Security",
153
- "Description": "A user account was created.",
154
  "Win_R": "lusrmgr.msc",
155
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4720}",
156
  "MITRE": "T1136 (Create Account)",
157
- "Logic": "Unexpected account creation is a sign of persistence.",
158
- "Investigation_Steps": "1. Filter ID 4720.\n2. Check 'SubjectUserName' (Who created it?) and 'TargetUserName' (What was created?).",
159
- "Scenario": "Attacker creates a 'backdoor' account to maintain access.",
160
- "Response": "Disable the new account and audit who created it.",
161
- "Remediation": "Restrict account creation rights to Domain Admins only.",
162
- "Tips": "Usually followed by ID 4732 (Added to a group)."
163
  }
164
  ]
 
10
  "Source": "Security",
11
  "Description": "An account failed to log on.",
12
  "Win_R": "eventvwr.msc",
13
+ "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4625} -MaxEvents 20 | Select-Object TimeCreated, @{N='User';E={$_.Properties[5].Value}}, @{N='IP';E={$_.Properties[19].Value}}",
14
  "MITRE": "T1110 (Brute Force)",
15
+ "Logic": "High frequency of failures (10+ per minute) suggests brute force.",
16
+ "Investigation_Steps": "1. Press **Win+R**, type `eventvwr.msc`.\n2. Go to **Security Log** > **Filter Current Log**.\n3. Type `4625` in the Event ID box.\n4. Scroll down to 'Network Information' to see the Source IP address.",
17
+ "Scenario": "Attacker trying a wordlist against the Administrator account.",
18
  "Response": "Block Source IP at firewall. Check if the account is now locked.",
19
+ "Remediation": "Enable Account Lockout Policy in `secpol.msc`.",
20
+ "Tips": "Logon Type 3 = Network; Type 10 = RDP."
21
  },
22
  {
23
  "ID": "4624",
 
27
  "Source": "Security",
28
  "Description": "An account was successfully logged on.",
29
  "Win_R": "eventvwr.msc",
30
+ "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4624} -MaxEvents 10",
31
  "MITRE": "T1078 (Valid Accounts)",
32
+ "Logic": "Monitor for RDP logins (Type 10) at unusual hours.",
33
+ "Investigation_Steps": "1. Open Event Viewer.\n2. Filter Security log for `4624`.\n3. Look for 'Logon Type'. Type 2 is local; Type 3 is network share; Type 10 is RDP.",
34
+ "Scenario": "Lateral movement using stolen credentials.",
35
+ "Response": "Verify with the user if they authorized this login.",
36
+ "Remediation": "Enforce MFA for all remote access.",
37
+ "Tips": "Check 'Logon ID' to link this to other events by the same user."
38
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  # --- PROCESS & EXECUTION ---
40
  {
41
  "ID": "4688",
 
47
  "Win_R": "taskmgr",
48
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4688} -MaxEvents 50",
49
  "MITRE": "T1059 (Command Execution)",
50
+ "Logic": "Suspicious if Office apps (Word/Excel) spawn PowerShell or CMD.",
51
+ "Investigation_Steps": "1. Press **Win+R**, type `taskmgr` to see live processes.\n2. In Event Viewer, filter for ID `4688`.\n3. Check the 'Process Command Line' field to see the exact command executed.",
52
+ "Scenario": "Malicious macro launching a reverse shell.",
53
+ "Response": "Kill the process tree and isolate the host.",
54
+ "Remediation": "Enable GPO: 'Include command line in process creation events'.",
55
+ "Tips": "Essential for catching 'Living off the Land' (LotL) attacks."
56
  },
57
  {
58
  "ID": "1 (Sysmon)",
 
64
  "Win_R": "services.msc",
65
  "PowerShell": "Get-WinEvent -LogName 'Microsoft-Windows-Sysmon/Operational' | Where {$_.ID -eq 1}",
66
  "MITRE": "T1204 (User Execution)",
67
+ "Logic": "New executables running from `Temp` or `AppData` folders.",
68
+ "Investigation_Steps": "1. Navigate to **Applications and Services > Microsoft > Windows > Sysmon > Operational**.\n2. Filter for ID `1`.\n3. Copy the SHA256 hash and check it on VirusTotal.",
69
+ "Scenario": "User executes a renamed malware binary.",
70
+ "Response": "If the hash is malicious, perform memory forensics.",
71
+ "Remediation": "Use AppLocker to restrict unsigned code.",
72
+ "Tips": "Sysmon provides the ParentCommandLine, which is vital for context."
73
  },
 
74
  # --- POWERSHELL ---
75
  {
76
  "ID": "4104",
 
78
  "Category": "PowerShell",
79
  "Severity": "Critical",
80
  "Source": "PowerShell/Ops",
81
+ "Description": "Full code executed by PowerShell.",
82
  "Win_R": "eventvwr.msc",
83
+ "PowerShell": "Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational' | Where {$_.ID -eq 4104} | Select -ExpandProperty Message",
84
  "MITRE": "T1059.001 (PowerShell)",
85
+ "Logic": "Search for 'Base64', 'IEX', or 'DownloadString'.",
86
+ "Investigation_Steps": "1. Go to **PowerShell/Operational** log in Event Viewer.\n2. Filter ID `4104`.\n3. Examine the 'ScriptBlock Text'. This captures code even if run in memory.",
87
+ "Scenario": "Fileless malware executing a Cobalt Strike beacon.",
88
+ "Response": "Analyze the URL/IP the script is trying to connect to.",
89
  "Remediation": "Set Execution Policy to 'AllSigned'.",
90
+ "Tips": "This log de-obfuscates scripts automatically."
91
  },
92
+ # --- NETWORK ---
 
93
  {
94
  "ID": "5156",
95
  "Name": "Network Connection",
96
  "Category": "Network",
97
  "Severity": "Medium",
98
  "Source": "Security",
99
+ "Description": "Windows Firewall permitted a connection.",
100
  "Win_R": "wf.msc",
101
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=5156} -MaxEvents 50",
102
  "MITRE": "T1041 (Exfiltration)",
103
+ "Logic": "Outbound connections to unknown IPs on non-standard ports (e.g. 4444).",
104
+ "Investigation_Steps": "1. Press **Win+R**, type `wf.msc` to check Firewall rules.\n2. In Event Viewer, filter Security log for `5156`.\n3. Identify the 'Destination Address'.",
105
+ "Scenario": "Malware communicating with a C2 server.",
106
+ "Response": "Block the destination IP at the perimeter.",
107
+ "Remediation": "Enable Egress filtering.",
108
+ "Tips": "Requires 'Audit Filtering Platform Connection' to be enabled."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  },
110
+ # --- USER & SYSTEM ---
111
  {
112
  "ID": "4720",
113
  "Name": "User Created",
114
  "Category": "User Management",
115
  "Severity": "High",
116
  "Source": "Security",
117
+ "Description": "A new user account was created.",
118
  "Win_R": "lusrmgr.msc",
119
  "PowerShell": "Get-WinEvent -FilterHashtable @{LogName='Security';ID=4720}",
120
  "MITRE": "T1136 (Create Account)",
121
+ "Logic": "Unauthorized account creation for persistence.",
122
+ "Investigation_Steps": "1. Press **Win+R**, type `lusrmgr.msc` to view local users.\n2. Filter Security log for ID `4720`.\n3. Check 'Subject' (who created the user).",
123
+ "Scenario": "Attacker creating a backdoor account.",
124
+ "Response": "Disable the account and audit the creator's activity.",
125
+ "Remediation": "Limit account creation rights to specific admins.",
126
+ "Tips": "Look for names that mimic system accounts (e.g., 'SytemAdmin')."
127
  }
128
  ]