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: encode user-controlled input in request query strings (batch 1/#574)

A-S-Manoj098c2533b187
diff --git a/tests/test_hudson.py b/tests/test_hudson.py
index eacfa9b..e85338b 100644
--- a/tests/test_hudson.py
+++ b/tests/test_hudson.py
@@ -16,6 +16,8 @@ class DummyClient:
def __init__(self, response=None, exc=None):
self._response = response
self._exc = exc
+ self.last_url = None
+ self.last_params = None
def __enter__(self):
return self
@@ -23,15 +25,23 @@ class DummyClient:
def __exit__(self, *a):
return False
- def get(self, url):
+ def get(self, url, params=None):
+ self.last_url = url
+ self.last_params = params
if self._exc:
raise self._exc
return self._response
def make_client_factory(response=None, exc=None):
+ instances = []
+
def factory(*args, **kwargs):
- return DummyClient(response=response, exc=exc)
+ client = DummyClient(response=response, exc=exc)
+ instances.append(client)
+ return client
+
+ factory.instances = instances
return factory
@@ -146,6 +156,24 @@ def test_run_hudson_scan_unexpected_status(monkeypatch, capsys):
assert "Hudson Rock API error: HTTP 500" in out
+def test_run_hudson_scan_passes_target_via_params(monkeypatch, capsys):
+ # Regression test: the target used to be interpolated directly into the
+ # URL's query string (e.g. "[email protected]"), which gets
+ # silently mangled by any URL-decoding client/server (the '+' becomes a
+ # space). It must be passed via `params` so httpx encodes it correctly.
+ monkeypatch.setattr(hudson, "check_hudson_permission", lambda target: True)
+ response = DummyResponse(200, {"stealers": []})
+ factory = make_client_factory(response=response)
+ monkeypatch.setattr(hudson.httpx, "Client", factory)
+
+ target = "[email protected]"
+ hudson.run_hudson_scan(target, is_email=True)
+
+ client = factory.instances[-1]
+ assert "?" not in client.last_url # query string built via params, not the URL
+ assert client.last_params == {"email": target}
+
+
def test_run_hudson_scan_handles_exception(monkeypatch, capsys):
monkeypatch.setattr(hudson, "check_hudson_permission", lambda target: True)
monkeypatch.setattr(
diff --git a/user_scanner/core/hudson.py b/user_scanner/core/hudson.py
index b76dfd7..6660999 100644
--- a/user_scanner/core/hudson.py
+++ b/user_scanner/core/hudson.py
@@ -57,7 +57,7 @@ def run_hudson_scan(target: str, is_email: bool = False):
endpoint = "search-by-email" if is_email else "search-by-username"
param = "email" if is_email else "username"
- url = f"{base_url}{endpoint}?{param}={target}"
+ url = f"{base_url}{endpoint}"
print(f"\n{M}== HUDSON ROCK INFOSTEALER INTELLIGENCE =={X}")
print(f"{C}[i] Attribution: Data provided by Hudson Rock (https://www.hudsonrock.com){X}")
@@ -65,7 +65,7 @@ def run_hudson_scan(target: str, is_email: bool = False):
try:
with httpx.Client(timeout=10.0) as client:
- response = client.get(url)
+ response = client.get(url, params={param: target})
if response.status_code == 200:
data = response.json()
diff --git a/user_scanner/email_scan/crm/axonaut.py b/user_scanner/email_scan/crm/axonaut.py
index a65ac30..7b84128 100644
--- a/user_scanner/email_scan/crm/axonaut.py
+++ b/user_scanner/email_scan/crm/axonaut.py
@@ -15,7 +15,8 @@ async def _check(email: str) -> Result:
try:
async with httpx.AsyncClient(timeout=15.0, follow_redirects=False) as client:
response = await client.get(
- f'https://axonaut.com/onboarding/?email={email}',
+ 'https://axonaut.com/onboarding/',
+ params={'email': email},
headers=headers
)
diff --git a/user_scanner/email_scan/learning/duolingo.py b/user_scanner/email_scan/learning/duolingo.py
index 3fcc92c..ca1a259 100644
--- a/user_scanner/email_scan/learning/duolingo.py
+++ b/user_scanner/email_scan/learning/duolingo.py
@@ -16,7 +16,8 @@ async def _check(email: str) -> Result:
try:
async with httpx.AsyncClient(timeout=15.0, follow_redirects=True) as client:
response = await client.get(
- f"https://www.duolingo.com/2017-06-30/users?email={email}",
+ "https://www.duolingo.com/2017-06-30/users",
+ params={"email": email},
headers=headers,
)
diff --git a/user_scanner/user_scan/community/archwiki.py b/user_scanner/user_scan/community/archwiki.py
index 9bc2a4c..9194f82 100644
--- a/user_scanner/user_scan/community/archwiki.py
+++ b/user_scanner/user_scan/community/archwiki.py
@@ -2,8 +2,16 @@ from user_scanner.core.orchestrator import Result, generic_validate
def validate_archwiki(user):
- url = f"https://wiki.archlinux.org/api.php?action=query&format=json&list=users&ususers={user}&usprop=blockinfo|groups|editcount|registration|gender&formatversion=2"
+ url = "https://wiki.archlinux.org/api.php"
show_url = f"https://wiki.archlinux.org/title/User:{user}"
+ params = {
+ "action": "query",
+ "format": "json",
+ "list": "users",
+ "ususers": user,
+ "usprop": "blockinfo|groups|editcount|registration|gender",
+ "formatversion": 2,
+ }
def process(response):
try:
@@ -37,4 +45,4 @@ def validate_archwiki(user):
return Result.error("Unexpected user structure")
except Exception as e:
return Result.error(e)
- return generic_validate(url, process, show_url=show_url)
+ return generic_validate(url, process, show_url=show_url, params=params)
diff --git a/user_scanner/user_scan/community/defensivecarry.py b/user_scanner/user_scan/community/defensivecarry.py
index 36372a5..2ff9b7a 100644
--- a/user_scanner/user_scan/community/defensivecarry.py
+++ b/user_scanner/user_scan/community/defensivecarry.py
@@ -20,10 +20,11 @@ PROFILE_PATH_RE = re.compile(r"/members/([^/]+)\.(\d+)/?$")
def validate_defensivecarry(user: str) -> Result:
- url = f"{BASE_URL}/members/?username={user}"
+ url = f"{BASE_URL}/members/"
+ params = {"username": user}
try:
- response = impersonate_request(url)
+ response = impersonate_request(url, params=params)
# The site answers 202 with a JavaScript proof-of-work page; solving it
# and replaying with the pow_bypass cookie returns the real response.
@@ -31,7 +32,9 @@ def validate_defensivecarry(user: str) -> Result:
cookie = _solve_challenge(response.text)
if not cookie:
return Result.error("Failed to solve PoW challenge", url=url)
- response = impersonate_request(url, cookies={"pow_bypass": cookie})
+ response = impersonate_request(
+ url, params=params, cookies={"pow_bypass": cookie}
+ )
except Exception as e:
return Result.error(e, url=url)
diff --git a/user_scanner/user_scan/community/fandom.py b/user_scanner/user_scan/community/fandom.py
index 9f2b584..c292e43 100644
--- a/user_scanner/user_scan/community/fandom.py
+++ b/user_scanner/user_scan/community/fandom.py
@@ -5,11 +5,15 @@ from user_scanner.core.result import Result
def validate_fandom(user: str) -> Result:
"""Validate a username on Fandom (fandom.com)."""
- url = (
- f"https://community.fandom.com/api.php"
- f"?action=query&list=users&ususers={user}&usprop=registration|gender|editcount|groups&format=json"
- )
+ url = "https://community.fandom.com/api.php"
show_url = f"https://community.fandom.com/wiki/User:{user}"
+ params = {
+ "action": "query",
+ "list": "users",
+ "ususers": user,
+ "usprop": "registration|gender|editcount|groups",
+ "format": "json",
+ }
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Accept": "application/json, text/plain, */*",
@@ -57,4 +61,7 @@ def validate_fandom(user: str) -> Result:
# 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
- return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
+ return generic_validate(
+ url, process, headers=headers, show_url=show_url,
+ follow_redirects=True, params=params,
+ )
diff --git a/user_scanner/user_scan/community/hackernews.py b/user_scanner/user_scan/community/hackernews.py
index de53f0e..59b0f57 100644
--- a/user_scanner/user_scan/community/hackernews.py
+++ b/user_scanner/user_scan/community/hackernews.py
@@ -10,7 +10,7 @@ def validate_hackernews(user: str) -> Result:
if not re.match(r"^[a-zA-Z0-9_-]+$", user):
return Result.error("Only use letters, numbers, underscores, and hyphens")
- url = f"https://news.ycombinator.com/user?id={user}"
+ url = "https://news.ycombinator.com/user"
show_url = f"https://news.ycombinator.com/user?id={user}"
def process(response):
@@ -47,5 +47,6 @@ def validate_hackernews(user: str) -> Result:
return Result.error("Unexpected response structure")
return generic_validate(
- url, process, show_url=show_url, timeout=3.0, follow_redirects=True
+ url, process, show_url=show_url, timeout=3.0, follow_redirects=True,
+ params={"id": user},
)
diff --git a/user_scanner/user_scan/community/lemmy.py b/user_scanner/user_scan/community/lemmy.py
index 087f619..e973f9e 100644
--- a/user_scanner/user_scan/community/lemmy.py
+++ b/user_scanner/user_scan/community/lemmy.py
@@ -14,7 +14,7 @@ def validate_lemmy(user: str) -> Result:
if not re.match(r"^[a-zA-Z0-9_]+$", user):
return Result.error("Only letters, numbers, and underscores allowed")
- url = f"https://lemmy.world/api/v3/user?username={user}"
+ url = "https://lemmy.world/api/v3/user"
show_url = f"https://lemmy.world/u/{user}"
def process(response):
@@ -52,4 +52,6 @@ def validate_lemmy(user: str) -> Result:
return Result.taken(extra=extra, media=media)
return Result.error(f"Unexpected status code: {response.status_code}")
- return generic_validate(url, process, show_url=show_url, timeout=5.0)
+ return generic_validate(
+ url, process, show_url=show_url, timeout=5.0, params={"username": user}
+ )
diff --git a/user_scanner/user_scan/community/thefirearmsforum.py b/user_scanner/user_scan/community/thefirearmsforum.py
index 911c114..269d020 100644
--- a/user_scanner/user_scan/community/thefirearmsforum.py
+++ b/user_scanner/user_scan/community/thefirearmsforum.py
@@ -20,10 +20,11 @@ PROFILE_PATH_RE = re.compile(r"/members/([^/]+)\.(\d+)/?$")
def validate_thefirearmsforum(user: str) -> Result:
- url = f"{BASE_URL}/members/?username={user}"
+ url = f"{BASE_URL}/members/"
+ params = {"username": user}
try:
- response = impersonate_request(url)
+ response = impersonate_request(url, params=params)
# The site answers 202 with a JavaScript proof-of-work page; solving it
# and replaying with the pow_bypass cookie returns the real response.
@@ -31,7 +32,9 @@ def validate_thefirearmsforum(user: str) -> Result:
cookie = _solve_challenge(response.text)
if not cookie:
return Result.error("Failed to solve PoW challenge", url=url)
- response = impersonate_request(url, cookies={"pow_bypass": cookie})
+ response = impersonate_request(
+ url, params=params, cookies={"pow_bypass": cookie}
+ )
except Exception as e:
return Result.error(e, url=url)
diff --git a/user_scanner/user_scan/community/wikipedia.py b/user_scanner/user_scan/community/wikipedia.py
index 6f8da4b..6769276 100644
--- a/user_scanner/user_scan/community/wikipedia.py
+++ b/user_scanner/user_scan/community/wikipedia.py
@@ -2,11 +2,19 @@ from user_scanner.core.orchestrator import Result, make_request
def validate_wikipedia(user):
# Using formatversion=2 for a cleaner JSON response
- api_url = f"https://en.wikipedia.org/w/api.php?action=query&format=json&list=users&ususers={user}&usprop=editcount|registration|gender&formatversion=2"
+ api_url = "https://en.wikipedia.org/w/api.php"
show_url = f"https://en.wikipedia.org/wiki/User:{user}"
+ params = {
+ "action": "query",
+ "format": "json",
+ "list": "users",
+ "ususers": user,
+ "usprop": "editcount|registration|gender",
+ "formatversion": 2,
+ }
try:
- response = make_request(api_url, follow_redirects=True, http2=True)
+ response = make_request(api_url, params=params, follow_redirects=True, http2=True)
if response.status_code == 200:
data = response.json()
users = data.get("query", {}).get("users", [])
diff --git a/user_scanner/user_scan/shopping/vinted.py b/user_scanner/user_scan/shopping/vinted.py
index fc8aa8c..ce66d11 100644
--- a/user_scanner/user_scan/shopping/vinted.py
+++ b/user_scanner/user_scan/shopping/vinted.py
@@ -8,7 +8,7 @@ from user_scanner.core.result import Result
def validate_vinted(user: str):
user = user.lower().strip()
- url = f"https://www.vinted.pt/member/general/search?search_text={user}"
+ url = "https://www.vinted.pt/member/general/search"
show_url = f"https://www.vinted.pt/member/general/search?search_text={user}"
if not re.match(r"^[a-zA-Z0-9_.-]+$", user):
@@ -39,4 +39,4 @@ def validate_vinted(user: str):
extra={"id": id_search[0] if len(id_search) > 0 else None}
)
- return generic_validate(url, process, show_url=show_url)
+ return generic_validate(url, process, show_url=show_url, params={"search_text": user})
diff --git a/user_scanner/user_scan/social/minds.py b/user_scanner/user_scan/social/minds.py
index 4da5539..fc9dd42 100644
--- a/user_scanner/user_scan/social/minds.py
+++ b/user_scanner/user_scan/social/minds.py
@@ -2,7 +2,7 @@ from user_scanner.core.orchestrator import generic_validate, Result
def validate_minds(user):
- url = f"https://www.minds.com/api/v3/register/validate?username={user}"
+ url = "https://www.minds.com/api/v3/register/validate"
show_url = f"https://www.minds.com/{user}"
def process(response):
@@ -14,4 +14,4 @@ def validate_minds(user):
return Result.error("Unexpected response body, report it via GitHub issues.")
- return generic_validate(url, process, show_url=show_url)
+ return generic_validate(url, process, show_url=show_url, params={"username": user})
diff --git a/user_scanner/user_scan/social/pr0gramm.py b/user_scanner/user_scan/social/pr0gramm.py
index 78bc441..853b806 100644
--- a/user_scanner/user_scan/social/pr0gramm.py
+++ b/user_scanner/user_scan/social/pr0gramm.py
@@ -1,7 +1,7 @@
from user_scanner.core.orchestrator import generic_validate, Result
def validate_pr0gramm(user):
- url = f"https://pr0gramm.com/api/profile/info?name={user}"
+ url = "https://pr0gramm.com/api/profile/info"
show_url = f"https://pr0gramm.com/user/{user}"
def process(response):
@@ -28,4 +28,6 @@ def validate_pr0gramm(user):
return Result.error("Unexpected response body, report it via GitHub issues.")
headers = {"Accept": "application/json", "User-Agent": "Mozilla/5.0"}
- return generic_validate(url, process, show_url=show_url, headers=headers)
+ return generic_validate(
+ url, process, show_url=show_url, headers=headers, params={"name": user}
+ )
diff --git a/user_scanner/user_scan/social/threads.py b/user_scanner/user_scan/social/threads.py
index 358d466..3b93c7c 100644
--- a/user_scanner/user_scan/social/threads.py
+++ b/user_scanner/user_scan/social/threads.py
@@ -3,7 +3,7 @@ from user_scanner.core.orchestrator import status_validate
def validate_threads(user):
- url = f"https://www.threads.net/api/v1/users/web_profile_info/?username={user}"
+ url = "https://www.threads.net/api/v1/users/web_profile_info/"
show_url = f"https://www.threads.net/@{user}"
headers = {
@@ -17,5 +17,6 @@ def validate_threads(user):
}
return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, http2=True
+ url, 404, 200, show_url=show_url, headers=headers, http2=True,
+ params={"username": user},
)