Skip to content

πŸ•΅οΈβ€β™‚οΈ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.

Add Microsoft 365 email scanning functionality

Anubhav Kashyap83f81481bf9f
diff --git a/user_scanner/email_scan/other/microsoft365.py b/user_scanner/email_scan/other/microsoft365.py
new file mode 100644
index 0000000..5974ece
--- /dev/null
+++ b/user_scanner/email_scan/other/microsoft365.py
@@ -0,0 +1,67 @@
+import httpx
+import random
+import string
+from user_scanner.core.result import Result
+
+
+async def _check(email: str) -> Result:
+ base_url = "https://outlook.office365.com/autodiscover/autodiscover.json/v1.0"
+ show_url = "https://office365.com"
+
+ headers = {
+ "User-Agent": "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.12026; Pro)",
+ "Accept": "application/json",
+ }
+
+ def get_random_string(length: int) -> str:
+ return "".join(random.choice(string.digits) for _ in range(length))
+
+ try:
+ async with httpx.AsyncClient(timeout=10.0, follow_redirects=False) as client:
+
+ # Step 1: Try with random local-part but same domain
+ random_email = f"{get_random_string(30)}@{email.split('@')[1]}"
+ r = await client.get(
+ f"{base_url}/{random_email}?Protocol=Autodiscoverv1",
+ headers=headers,
+ )
+
+ if r.status_code == 403:
+ return Result.error("Caught by WAF or IP Block (403)")
+
+ if r.status_code == 429:
+ return Result.error("Rate limited (429)")
+
+ # If random email returns 200 β†’ likely rate limiting or unusual behavior
+ if r.status_code == 200:
+ return Result.error("Possible rate limit or detection triggered")
+
+ # Step 2: Check actual email
+ r = await client.get(
+ f"{base_url}/{email}?Protocol=Autodiscoverv1",
+ headers=headers,
+ )
+
+ if r.status_code == 403:
+ return Result.error("Caught by WAF or IP Block (403)")
+
+ if r.status_code == 429:
+ return Result.error("Rate limited (429)")
+
+ if r.status_code == 200:
+ return Result.taken(url=show_url)
+
+ return Result.available(url=show_url)
+
+ except httpx.ConnectTimeout:
+ return Result.error("Connection timed out")
+
+ except httpx.ReadTimeout:
+ return Result.error("Server took too long to respond")
+
+ except Exception as e:
+ return Result.error(str(e))
+
+
+async def validate_office365(email: str) -> Result:
+ return await _check(email)