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.

improvement: add regex validation before username checks

kaifcodec18cbe8962365
diff --git a/user_scanner/social/mastodon.py b/user_scanner/social/mastodon.py
index 2b516cb..7aa6349 100644
--- a/user_scanner/social/mastodon.py
+++ b/user_scanner/social/mastodon.py
@@ -1,8 +1,19 @@
+import re
from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.result import Result
-def validate_mastodon(user):
- url = f"https://mastodon.social/@{user}"
+def validate_mastodon(user: str) -> Result:
+ if not (3 <= len(user) <= 30):
+ return Result.error("Length must be 3-30 characters")
+
+ if not re.match(r'^[a-zA-Z0-9_-]+$', user):
+ return Result.error("Usernames can only contain letters, numbers, underscores and hyphens")
+
+ if not re.match(r'^[a-zA-Z0-9].*[a-zA-Z0-9]$', user):
+ return Result.error("Username must start and end with a letter or number")
+
+ url = f"https://mastodon.social/api/v1/accounts/lookup?acct={user}"
return status_validate(url, 404, 200, follow_redirects=True)
@@ -16,4 +27,4 @@ if __name__ == "__main__":
elif result == 0:
print("Unavailable!")
else:
- print("Error occured!")
+ print(f"Error occurred! Reason: {result.get_reason()}")