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(stackoverflow): verify the fragment before returning a verdict

Bruno Leonardo Michelsdafb9d47034d
diff --git a/user_scanner/user_scan/community/stackoverflow.py b/user_scanner/user_scan/community/stackoverflow.py
index abdcd56..0bb1d5f 100644
--- a/user_scanner/user_scan/community/stackoverflow.py
+++ b/user_scanner/user_scan/community/stackoverflow.py
@@ -1,16 +1,21 @@
import re
-from user_scanner.core.orchestrator import generic_validate
+from html import unescape
+from urllib.parse import quote
+
+from user_scanner.core.impersonate import impersonate_validate
from user_scanner.core.result import Result
def validate_stackoverflow(user: str) -> Result:
- url = f"https://stackoverflow.com/users/filter?search={user}"
+ url = f"https://stackoverflow.com/users/filter?search={quote(user)}"
show_url = url
def process(response):
- if response.status_code == 200:
- text = response.text
+ text = response.text
+ # The endpoint answers with an HTML fragment; without this anchor the
+ # body is a challenge or error page and carries no verdict.
+ if response.status_code == 200 and 'id="user-browser"' in text:
if "No users matched your search." in text:
return Result.available()
@@ -35,20 +40,20 @@ def validate_stackoverflow(user: str) -> Result:
img_match = re.search(r'<img src="([^"]+)"', found_card)
if loc_match and loc_match.group(1).strip():
- extra["location"] = loc_match.group(1).strip()
+ extra["location"] = unescape(loc_match.group(1).strip())
if rep_match:
- extra["reputation"] = rep_match.group(1).strip()
+ extra["reputation"] = unescape(rep_match.group(1).strip())
if img_match:
- avatar_url = img_match.group(1).strip()
+ avatar_url = unescape(img_match.group(1).strip())
if avatar_url.startswith("//"):
avatar_url = "https:" + avatar_url
- media["avatar"] = avatar_url.replace("&amp;", "&")
+ media["avatar"] = avatar_url
except Exception:
pass
return Result.taken(extra=extra, media=media)
return Result.available()
- return Result.error("Unexpected status code from Stack Overflow")
+ return Result.error(f"Unexpected response body (HTTP {response.status_code})")
- return generic_validate(url, process, show_url=show_url)
+ return impersonate_validate(url, process, show_url=show_url)