Skip to content

Commit 8d49660

Browse files
author
iUseYahoo
committed
Event ID and meaning scraper & Windows Defender Events IDS list and meanings
1 parent 72384a5 commit 8d49660

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

events/Windows Defender/ids.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"1000": "Malwareprotection scan started",
3+
"1001": "Malwareprotection scan completed",
4+
"1002": "Malwareprotection scan cancelled",
5+
"1003": "Malwareprotection scan paused",
6+
"1004": "Malwareprotection scan resumed",
7+
"1005": "Malwareprotection scan failed",
8+
"1006": "Malwareprotection malware detected",
9+
"1007": "Malwareprotection malware action taken",
10+
"1008": "Malwareprotection malware action failed",
11+
"1009": "Malwareprotection quarantine restore",
12+
"1010": "Malwareprotection quarantine restore failed",
13+
"1011": "Malwareprotection quarantine delete",
14+
"1012": "Malwareprotection quarantine delete failed",
15+
"1013": "Malwareprotection malware history delete",
16+
"1014": "Malwareprotection malware history delete failed",
17+
"1015": "Malwareprotection behavior detected",
18+
"1116": "Malwareprotection state malware detected",
19+
"1117": "Malwareprotection state malware action taken",
20+
"1118": "Malwareprotection state malware action failed",
21+
"1119": "Malwareprotection state malware action critically failed",
22+
"1120": "Malwareprotection threat hash",
23+
"1121": "Event when an attack surface reduction rule fires in block mode.",
24+
"1127": "Malwareprotection folder guard sector block",
25+
"1150": "Malwareprotection service healthy",
26+
"1151": "Malwareprotection service health report",
27+
"2000": "Malwareprotection signature updated",
28+
"2001": "Malwareprotection signature update failed",
29+
"2002": "Malwareprotection engine updated",
30+
"2003": "Malwareprotection engine update failed",
31+
"2004": "Malwareprotection signature reversion",
32+
"2005": "Malwareprotection engine update platformoutofdate",
33+
"2006": "Malwareprotection platform update failed",
34+
"2007": "Malwareprotection platform almostoutofdate",
35+
"2010": "Malwareprotection signature fastpath updated",
36+
"2011": "Malwareprotection signature fastpath deleted",
37+
"2012": "Malwareprotection signature fastpath update failed",
38+
"2013": "Malwareprotection signature fastpath deleted all",
39+
"2020": "Malwareprotection cloud clean restore file downloaded",
40+
"2021": "Malwareprotection cloud clean restore file download failed",
41+
"2030": "Malwareprotection offline scan installed",
42+
"2031": "Malwareprotection offline scan install failed",
43+
"2040": "Malwareprotection os expiring",
44+
"2041": "Malwareprotection os eol",
45+
"2042": "Malwareprotection protection eol",
46+
"3002": "Malwareprotection rtp feature failure",
47+
"3007": "Malwareprotection rtp feature recovered",
48+
"5000": "Malwareprotection rtp enabled",
49+
"5001": "Malwareprotection rtp disabled",
50+
"5004": "Malwareprotection rtp feature configured",
51+
"5007": "Malwareprotection config changed",
52+
"5008": "Malwareprotection engine failure",
53+
"5009": "Malwareprotection antispyware enabled",
54+
"5010": "Malwareprotection antispyware disabled",
55+
"5011": "Malwareprotection antivirus enabled",
56+
"5012": "Malwareprotection antivirus disabled",
57+
"5013": "Malwareprotection scan cancelled",
58+
"5100": "Malwareprotection expiration warning state",
59+
"5101": "Malwareprotection disabled expired state"
60+
}

events/event_ids_scraper.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
import json
4+
5+
# Define the URL of the Microsoft documentation page
6+
url = "https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/troubleshoot-microsoft-defender-antivirus"
7+
8+
# Send an HTTP GET request to the URL
9+
response = requests.get(url)
10+
11+
# Check if the request was successful (status code 200)
12+
if response.status_code == 200:
13+
# Parse the HTML content of the page
14+
soup = BeautifulSoup(response.text, "html.parser")
15+
16+
# Find all event ID sections
17+
event_id_sections = soup.find_all("h2", {"id": lambda x: x and x.startswith("event-id-")})
18+
19+
# Initialize a dictionary to store event IDs and their meanings
20+
event_id_meanings = {}
21+
22+
# Iterate through event ID sections and extract meanings
23+
for section in event_id_sections:
24+
event_id = section.get("id").replace("event-id-", "")
25+
content_div = section.find_next("div", class_="content")
26+
27+
# Find the first <p> element in the content
28+
meaning_paragraph = content_div.find("p")
29+
30+
# Extract the text and remove unnecessary prefixes
31+
meaning = meaning_paragraph.get_text(strip=True)
32+
33+
# Remove "Message:" or "Symbolic name:" if present
34+
meaning = meaning.replace("Message: ", "").replace("Symbolic name:", "")
35+
36+
# Replace underscores with spaces and capitalize the first letter
37+
meaning = meaning.replace("_", " ").capitalize()
38+
39+
event_id_meanings[event_id] = meaning
40+
41+
# Convert the dictionary to JSON
42+
result_json = json.dumps(event_id_meanings, indent=4)
43+
44+
# Save the JSON to a file
45+
with open("windows_defender_event_ids.json", "w", encoding="utf-8") as json_file:
46+
json_file.write(result_json)
47+
48+
print("Event IDs and meanings scraped and saved to 'windows_defender_event_ids.json'")
49+
else:
50+
print(f"Failed to retrieve the page. Status code: {response.status_code}")

0 commit comments

Comments
 (0)