🕵️♂️ (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: update codecademy module validation to handle redirects and empty Next.js profile data
Kaif50a70bd1663e
diff --git a/user_scanner/user_scan/dev/codecademy.py b/user_scanner/user_scan/dev/codecademy.pyindex 049cd9f..3347299 100644--- a/user_scanner/user_scan/dev/codecademy.py+++ b/user_scanner/user_scan/dev/codecademy.py@@ -6,17 +6,21 @@ def validate_codecademy(user):url = f"https://www.codecademy.com/profiles/{user}"def process(response):- if response.status_code == 404:+ location = response.headers.get("Location", "")+ if response.status_code in [301, 302, 303, 307, 308] or "login" in location:+ return Result.taken(extra={"is_private": True})++ elif response.status_code == 404:return Result.available()+elif response.status_code == 200:try:- # Codecademy embeds profile data in a Next.js JSON blobmatch = re.search(r'<script id="__NEXT_DATA__" type="application/json">(.*?)</script>', response.text)if match:data = json.loads(match.group(1))user_data = data.get("props", {}).get("pageProps", {}).get("profile", {})- if user_data:- extra = {}+ if user_data and user_data.get("username"):+ extra = {"is_private": False}if user_data.get("name"):extra["name"] = user_data.get("name")if user_data.get("bio"):@@ -26,13 +30,19 @@ def validate_codecademy(user):if user_data.get("createdAt"):extra["joined"] = user_data.get("createdAt")return Result.taken(extra=extra)+ else:+ return Result.available()- # If we couldn't parse it but it's 200, assume taken but no extra data- return Result.taken()+ if f"profiles/{user}" in response.text or user in response.text:+ return Result.taken(extra={"is_private": False})+ return Result.available()except Exception:return Result.taken()return Result.error("Unexpected response body, report it via GitHub issues.")- headers = {"User-Agent": "Mozilla/5.0"}- return generic_validate(url, process, show_url=url, headers=headers)+ headers = {+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",+ }+ return generic_validate(url, process, show_url=url, headers=headers, follow_redirects=False)