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.

fix(user_scan/): chess_com module to use re for username pre-check

kaifcodec7fc8b9ca2051
diff --git a/user_scanner/user_scan/gaming/chess_com.py b/user_scanner/user_scan/gaming/chess_com.py
index 45e8cbe..6c29db5 100644
--- a/user_scanner/user_scan/gaming/chess_com.py
+++ b/user_scanner/user_scan/gaming/chess_com.py
@@ -1,14 +1,27 @@
+import re
from user_scanner.core.orchestrator import generic_validate
from user_scanner.core.result import Result
from user_scanner.core.helpers import get_random_user_agent
-def validate_chess_com(user):
+def validate_chess_com(user: str) -> Result:
+ # Length must be between 3 and 25 characters
+ if not (3 <= len(user) <= 25):
+ return Result.error("Length must be 3-25 characters")
+
+ # Only letters, numbers, underscores, and dashes allowed
+ if not re.match(r'^[a-zA-Z0-9_-]+$', user):
+ return Result.error("Usernames can only contain letters, numbers, underscores, and hyphens")
+
+ # Must start and end with an alphanumeric character
+ if not (user[0].isalnum() and user[-1].isalnum()):
+ return Result.error("Username must start and end with a letter or number")
+
url = f"https://www.chess.com/callback/user/valid?username={user}"
show_url = "https://chess.com"
headers = {
- 'User-Agent':get_random_user_agent(),
+ 'User-Agent': get_random_user_agent(),
'Accept': "application/json, text/plain, */*",
'Accept-Encoding': "identity",
'Accept-Language': "en-US,en;q=0.9",
@@ -37,4 +50,4 @@ if __name__ == "__main__":
elif result == 0:
print("Unavailable!")
else:
- print("Error occurred!")
\ No newline at end of file
+ print(f"Error occurred! Reason: {result.get_reason()}")
diff --git a/user_scanner/user_scan/gaming/osu.py b/user_scanner/user_scan/gaming/osu.py
index 0fa58e0..c91b6ad 100644
--- a/user_scanner/user_scan/gaming/osu.py
+++ b/user_scanner/user_scan/gaming/osu.py
@@ -17,4 +17,4 @@ if __name__ == "__main__":
elif result == 0:
print("Unavailable!")
else:
- print("Error occurred!")
\ No newline at end of file
+ print("Error occurred!")