MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / analyze_gmail

Method analyze_gmail

IntelOSINT.py:12858–12957  ·  view source on GitHub ↗
(self, email)

Source from the content-addressed store, hash-verified

12856 return results
12857
12858 def analyze_gmail(self, email):
12859 email = (email or "").strip()
12860 if not email.endswith('@gmail.com'):
12861 return None
12862
12863 info = {"Status": "Analisi Gmail in corso..."}
12864 main_img = "https://cdn-icons-png.flaticon.com/512/281/281764.png" # Google icon
12865 status_code = 404
12866 local_part, _, domain_part = email.partition("@")
12867 info["Email"] = email
12868 info["Username Locale"] = local_part
12869 info["Dominio"] = domain_part
12870 info["Account Provider"] = "Google" if domain_part.lower() in ("gmail.com", "googlemail.com") else domain_part
12871
12872 def _walk_values(obj):
12873 if isinstance(obj, dict):
12874 for v in obj.values():
12875 yield from _walk_values(v)
12876 elif isinstance(obj, (list, tuple)):
12877 for v in obj:
12878 yield from _walk_values(v)
12879 else:
12880 yield obj
12881
12882 try:
12883 # Undocumented endpoint, may break without notice.
12884 lookup_url = "https://accounts.google.com/_/lookup/accountlookup?hl=it"
12885
12886 # This payload structure is based on observed requests from web clients.
12887 payload = f"[[null,null,null,null,[1,null,null,null,null,[null,\"{email}\"]]]]"
12888
12889 headers = {
12890 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
12891 'Google-Accounts-XSRF': '1', # Required header
12892 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
12893 }
12894
12895 r = requests.post(lookup_url, headers=headers, data=payload, timeout=8)
12896
12897 if r.status_code == 200:
12898 clean_response = r.text[5:] # Remove )]}' XSSI prefix
12899 data = json.loads(clean_response)
12900
12901 # Primary parser (legacy structure) + fallback generic walker.
12902 gaia_id = None
12903 name = None
12904 pfp_url = None
12905 try:
12906 user_data = data[0][2][1]
12907 gaia_id = user_data[8] if len(user_data) > 8 else None
12908 name = user_data[3] if len(user_data) > 3 else None
12909 pfp_url = user_data[2] if len(user_data) > 2 else None
12910 except Exception:
12911 pass
12912
12913 if not gaia_id or not name or not pfp_url:
12914 for val in _walk_values(data):
12915 if not isinstance(val, str):

Callers 1

analyze_gmail_osintMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected