🕵️♂️ (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.
Python cybersecuritycybersecurity-toolsemail-osintethical-hackingethical-hacking-toolsidentificationinfosecosintosint-emailosint-toolosint-toolsosint-usernamepentestingpythonredteam-toolsredteamingthreat-intelligence
fix(classmates): clear the WAF 403 on the login handshake (#537)
BrunoLM4b5315c15ae9
diff --git a/user_scanner/email_scan/social/classmates.py b/user_scanner/email_scan/social/classmates.pyindex 53ee3f7..7652fed 100644--- a/user_scanner/email_scan/social/classmates.py+++ b/user_scanner/email_scan/social/classmates.py@@ -1,5 +1,6 @@-import httpximport re++from user_scanner.core.impersonate import impersonate_request_asyncfrom user_scanner.core.result import Result@@ -7,60 +8,55 @@ async def _check(email: str) -> Result:show_url = "https://www.classmates.com"login_url = "https://www.classmates.com/auth/login"+ # No User-Agent or client hints: the impersonating transport supplies a set+ # that matches its TLS fingerprint, and overriding half of it re-trips the WAF.headers = {- 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Mobile Safari/537.36",'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",- 'Accept-Encoding': "identity",- 'sec-ch-ua-platform': '"Android"','Origin': "https://www.classmates.com",'Referer': login_url,'Accept-Language': "en-US,en;q=0.9"}try:- async with httpx.AsyncClient(timeout=15.0, follow_redirects=True) as client:- r_init = await client.get(login_url, headers=headers)-- if r_init.status_code == 403:- return Result.error("Caught by WAF (403) during Handshake")+ # The login page is fetched as a plain navigation; sending the form's+ # Origin/Referer on it is what the WAF answers 403 to.+ r_init = await impersonate_request_async(login_url, allow_redirects=True)- csrf_match = re.search(- r'name="_csrf" value="([^"]+)"', r_init.text)- if not csrf_match:- return Result.error("Failed to extract CSRF token from login page")+ if r_init.status_code == 403:+ return Result.error("Caught by WAF (403) during Handshake")- csrf_token = csrf_match.group(1)+ csrf_match = re.search(r'name="_csrf" value="([^"]+)"', r_init.text)+ if not csrf_match:+ return Result.error("Failed to extract CSRF token from login page")- payload = {- '_csrf': csrf_token,- 'successUrl': "",- 'emailOrRegId': email,- 'password': "SafetyMismatch_123!",- 'rememberme': "no"- }+ payload = {+ '_csrf': csrf_match.group(1),+ 'successUrl': "",+ 'emailOrRegId': email,+ 'password': "SafetyMismatch_123!",+ 'rememberme': "no"+ }- response = await client.post(login_url, data=payload, headers=headers)+ response = await impersonate_request_async(+ login_url, "POST", data=payload, headers=headers, allow_redirects=True+ )- if response.status_code == 403:- return Result.error("Caught by WAF or IP Block (403) during Check")+ if response.status_code == 403:+ return Result.error("Caught by WAF or IP Block (403) during Check")- if response.status_code == 429:- return Result.error("Rate limited by Classmates (429)")+ if response.status_code == 429:+ return Result.error("Rate limited by Classmates (429)")- res_text = response.text+ res_text = response.text- if "invalid registration/password" in res_text:- return Result.taken(url=show_url)+ if "invalid registration/password" in res_text:+ return Result.taken(url=show_url)- if "did not find an account for the email address" in res_text:- return Result.available(url=show_url)+ if "did not find an account for the email address" in res_text:+ return Result.available(url=show_url)- return Result.error("Unexpected response body structure")+ return Result.error("Unexpected response body structure")- except httpx.ConnectTimeout:- return Result.error("Connection timed out! maybe region blocks")- except httpx.ReadTimeout:- return Result.error("Server took too long to respond (Read Timeout)")except Exception as e:return Result.error(e)