🕵️♂️ (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(email_scan): fix detection and token parsing in luarocks, firefox, dollarfix, and couplejoy (#697)
Kaif6dd911fa98ea
diff --git a/user_scanner/email_scan/dev/luarocks.py b/user_scanner/email_scan/dev/luarocks.pyindex 25eeecb..92b0d8c 100644--- a/user_scanner/email_scan/dev/luarocks.py+++ b/user_scanner/email_scan/dev/luarocks.py@@ -1,9 +1,8 @@-import httpximport re+import httpxfrom user_scanner.core.result import Resultasync def _check(email: str) -> Result:- url_login = "https://luarocks.org/login"url_forgot = "https://luarocks.org/user/forgot_password"show_url = "https://luarocks.org"@@ -18,30 +17,41 @@ async def _check(email: str) -> Result:'Sec-GPC': "1",'Accept-Language': "en-US,en;q=0.9",'Origin': "https://luarocks.org",- 'Referer': url_forgot+ 'Referer': url_forgot,}try:async with httpx.AsyncClient(timeout=15.0, follow_redirects=True) as client:-- # Hit login endpoint directly to grab token cookie and search form csrf- init_res = await client.get(url_login, headers=headers)+ # Hit forgot password page directly to grab session cookie and form CSRF token+ init_res = await client.get(url_forgot, headers=headers)+ if init_res.status_code == 429:+ return Result.error("Rate limited by LuaRocks (429)", url=show_url)if init_res.status_code != 200:- return Result.error(f"Failed to load validation frame: {init_res.status_code}")+ return Result.error(f"Failed to load validation frame: {init_res.status_code}", url=show_url)- csrf_match = re.search(r'name="csrf_token" value="([^"]+)"', init_res.text)+ # Match CSRF token irrespective of attribute order (name before value or value before name)+ csrf_match = re.search(+ r'name=["\']csrf_token["\'][^>]*value=["\']([^"\']+)["\']', init_res.text+ ) or re.search(+ r'value=["\']([^"\']+)["\'][^>]*name=["\']csrf_token["\']', init_res.text+ )if not csrf_match:- return Result.error("Could not parse LuaRocks state CSRF token")+ return Result.error("Could not parse LuaRocks state CSRF token", url=show_url)csrf_token = csrf_match.group(1)# Push password reset form validation checkpayload = {'csrf_token': csrf_token,- 'email': email+ 'email': email,}response = await client.post(url_forgot, data=payload, headers=headers)+ if response.status_code == 429:+ return Result.error("Rate limited by LuaRocks (429)", url=show_url)+ if response.status_code == 403:+ return Result.error("Access forbidden by LuaRocks (403)", url=show_url)+response_text = response.text.lower()# Parse structural text outputs using broad substrings to prevent template entity escaping bugs@@ -49,13 +59,21 @@ async def _check(email: str) -> Result:return Result.taken(url=show_url)# Checking for standard, stripped, and HTML-escaped string formats simultaneously- if "don't know anyone" in response_text or "don't know anyone" in response_text or "know anyone with that email" in response_text:+ if (+ "don't know anyone" in response_text+ or "don't know anyone" in response_text+ or "don't know anyone" in response_text+ or "know anyone with that email" in response_text+ ):return Result.available(url=show_url)- return Result.error("Unexpected target response markup signature")+ return Result.error(+ f"Unexpected target response markup signature (status: {response.status_code})",+ url=show_url,+ )except Exception as e:- return Result.error(str(e))+ return Result.error(str(e), url=show_url)async def validate_luarocks(email: str) -> Result:return await _check(email)diff --git a/user_scanner/email_scan/other/dollarfix.py b/user_scanner/email_scan/other/dollarfix.pyindex ad13974..c2face1 100644--- a/user_scanner/email_scan/other/dollarfix.py+++ b/user_scanner/email_scan/other/dollarfix.py@@ -49,11 +49,11 @@ async def _check(email: str) -> Result:if response.status_code == 200:data = response.json()- msg = data.get("msg", "")+ msg = str(data.get("msg", ""))- if msg in ["Incorrect password", "not set password"]:+ if msg in ["Incorrect password", "not set password", "密码错误", "未设置密码"] or "密码" in msg:return Result.taken(url=show_url)- elif msg == "The user does not exist.":+ elif msg in ["The user does not exist.", "用户不存在。", "用户不存在"] or "不存在" in msg:return Result.available(url=show_url)return Result.error("Unexpected response body, report it via GitHub issues", url=show_url)diff --git a/user_scanner/email_scan/other/firefox.py b/user_scanner/email_scan/other/firefox.pyindex 2b345ed..4280d9d 100644--- a/user_scanner/email_scan/other/firefox.py+++ b/user_scanner/email_scan/other/firefox.py@@ -9,35 +9,42 @@ async def _check(email: str) -> Result:"email": email}+ headers = {+ "Accept": "application/json",+ "Content-Type": "application/json",+ }+try:async with httpx.AsyncClient(timeout=15.0) as client:- response = await client.post(url, data=payload)+ response = await client.post(url, json=payload, headers=headers)if response.status_code == 403:- return Result.error("Caught by WAF or IP Block (403)")+ return Result.error("Caught by WAF or IP Block (403)", url=show_url)if response.status_code == 429:- return Result.error("Rate limited by Firefox (429)")+ return Result.error("Rate limited by Firefox (429)", url=show_url)if response.status_code != 200:- return Result.error(f"HTTP Error: {response.status_code}")+ return Result.error(f"HTTP Error: {response.status_code}", url=show_url)- text = response.text.lower()+ data = response.json()+ if not isinstance(data, dict):+ return Result.error("Unexpected response body format", url=show_url)- if "true" in text:+ exists = data.get("exists")+ if exists is True:return Result.taken(url=show_url)-- elif "false" in text:+ elif exists is False:return Result.available(url=show_url)- return Result.error("Unexpected response body structure")+ return Result.error("Unexpected response body structure", url=show_url)except httpx.ConnectTimeout:- return Result.error("Connection timed out! maybe region blocks")+ return Result.error("Connection timed out! maybe region blocks", url=show_url)except httpx.ReadTimeout:- return Result.error("Server took too long to respond (Read Timeout)")+ return Result.error("Server took too long to respond (Read Timeout)", url=show_url)except Exception as e:- return Result.error(e)+ return Result.error(e, url=show_url)async def validate_firefox(email: str) -> Result:return await _check(email)diff --git a/user_scanner/email_scan/social/couplejoy.py b/user_scanner/email_scan/social/couplejoy.pyindex b866e3b..a7e94f3 100644--- a/user_scanner/email_scan/social/couplejoy.py+++ b/user_scanner/email_scan/social/couplejoy.py@@ -38,7 +38,9 @@ async def _check(email: str) -> Result:if response.status_code == 400:data = response.json()- if data.get("code") == "EMAIL_NOT_FOUND":+ msg = str(data.get("message", "")).lower()+ code = str(data.get("code", ""))+ if code == "EMAIL_NOT_FOUND" or "no account with this email" in msg:return Result.available(url=show_url)return Result.error(