Skip to content

Social Discovery

Social discovery (stage 4, handle_enumeration, plus stage 5 identity_matching) finds social profiles that impersonate a brand. It runs in parallel with record information and fingerprinting.

  • Brand context — the brand name and the brand’s official social handles.
  • Official handlestwitter, linkedin, instagram, facebook, youtube, tiktok, github.

The social/ package enumerates candidate handles from the brand name and existing handles:

  • Handle permutation — variations of the official handles (prefixes, suffixes, separators, numbers).
  • Search dorking — web searches for pages impersonating the brand, backed by SerpAPI or Google Programmable Search (DORK_BACKEND), producing candidate profile URLs.
  • Maigret probing — for candidates, availability/ownership is probed with Maigret (social/availability.py), which checks platform endpoints to confirm a profile exists and belongs to a handle.

Stage 5 (social/identity_matching.py, ~433 lines) matches discovered profiles against the brand:

  • Each candidate profile’s identity is compared with the brand’s official profiles.
  • Matching uses embedding-based comparison — text (display name, bio) is embedded with a sentence-transformer model (EMBEDDING_MODEL, default sentence-transformers/all-MiniLM-L6-v2) and compared for similarity.
  • Results are SocialMatchResult objects recording match signals.

The phase emits SocialFinding objects with:

  • Identity — platform, handle, display name, profile URL, avatar path, bio.
  • Audience — follower/following/post counts, account creation date, verification status.
  • Detection metadatadetection_method (permutation / dork / probe), match_signals, cross_links.
  • Scoring — a SocialScoringResult severity score, refined later by the severity assessment stage.
Variable Purpose
SOCIAL_SCAN_ENABLED master switch
DORK_BACKEND, DORK_DELAY, DORK_HTTP_TIMEOUT, DORK_MAX_RESULTS dorking behavior
SERPAPI_KEY / GOOGLE_CSE_KEY + GOOGLE_CSE_CX dork backends
MAIGRET_MAX_HANDLES, MAIGRET_WORKERS, MAIGRET_TIMEOUT, MAIGRET_RETRIES, MAIGRET_PROXY, MAIGRET_TOR_PROXY probing
EMBEDDING_MODEL identity-matching embeddings