---
name: social-media-osint-de7781272e0a
description: >-
  Social media OSINT techniques and tools for gathering intelligence from public profiles across
  Twitter/X, LinkedIn, Instagram, and Facebook. Use when: investigating individuals or companies,
  finding social footprint, correlating usernames across platforms, mapping professional networks,
  or identifying employees and their public activity.
license: Apache-2.0
compatibility: "Python 3.9+"
metadata:
  author: terminal-skills
  version: "1.1.0"
  category: research
  tags: "social-media, sherlock, people-search, linkedin, twitter"
  use-cases: "Find all social media accounts for a target person using a known username, Build a public profile of a company's employees from LinkedIn and Twitter, Collect public Instagram profile metadata for an account under investigation, Recover archived versions of a deleted or renamed profile"
  agents: "claude-code, openai-codex, gemini-cli, cursor"
---

# Social Media OSINT

## Overview

Social media platforms expose enormous amounts of voluntarily shared personal and professional information. This skill covers the tools and techniques to systematically gather and analyze publicly available social media intelligence without violating platform terms of service or privacy laws. The primary tools are Sherlock (username search across 400+ sites), Instaloader (Instagram metadata), and manual techniques using search-engine dorks and the Wayback Machine.

**Always verify you have authorization or a legitimate OSINT purpose before investigating individuals.** Typical authorized contexts: a penetration test or social-engineering assessment with a signed scope, brand-impersonation monitoring for your own organization, due diligence, journalism, and fraud investigation.

## Instructions

### Tool 1: Sherlock — Username search across 400+ sites

```bash
# Install into an isolated environment
pipx install sherlock-project          # or: pip install sherlock-project inside a virtualenv

sherlock northwind_ops                                  # every supported site (400+)
sherlock northwind_ops northwindlogistics               # several usernames
sherlock "northwind{?}ops"                              # also tries _ - . in place of {?}
sherlock northwind_ops --site GitHub --site Reddit --site Instagram
sherlock northwind_ops --print-found --csv --txt        # writes northwind_ops.csv and northwind_ops.txt
sherlock northwind_ops northwindlogistics --csv --folderoutput findings   # one CSV per username in findings/
sherlock northwind_ops --timeout 20 --proxy socks5h://127.0.0.1:9050      # local Tor SOCKS proxy; socks5h also sends DNS lookups through it
```

Sherlock 0.16 writes no file unless `--txt`, `--csv` or `--xlsx` is given, `--output` does not create missing directories (`--folderoutput` does), and there is no `--tor` flag (use `--proxy`). A site is skipped when the handle breaks its username rules: GitHub allows no underscore, so `northwind_ops` is never checked there (`--print-all` shows `Illegal Username Format For This Site!`). The CSV has the columns `username,name,url_main,url_user,exists,http_status,response_time_s`; `exists` is `Claimed` for a hit.

```python
import csv
import subprocess
import tempfile
from pathlib import Path

def sherlock_search(username, sites=None, timeout=20):
    """Run Sherlock and return the accounts it reports as claimed."""
    with tempfile.TemporaryDirectory() as out_dir:
        cmd = ["sherlock", username, "--print-found", "--no-color", "--csv",
               "--folderoutput", out_dir, "--timeout", str(timeout)]
        for site in sites or []:
            cmd += ["--site", site]
        subprocess.run(cmd, capture_output=True, text=True, timeout=1800, check=True)
        with open(Path(out_dir) / f"{username}.csv", newline="") as f:
            return [{"site": row["name"], "url": row["url_user"]}
                    for row in csv.DictReader(f) if row["exists"] == "Claimed"]

for account in sherlock_search("northwind_ops", sites=["GitHub", "Reddit", "Instagram"]):
    print(f"[{account['site']}] {account['url']}")
```

### Tool 2: Instaloader — Instagram metadata

```bash
pip install instaloader                 # inside a virtualenv

# Profile and post metadata as JSON, no media files
instaloader --no-pictures --no-videos --no-video-thumbnails --no-captions --no-compress-json northwindlogistics

# Profile picture only, no posts
instaloader --no-posts northwindlogistics

# Logged-in session (prompts for the password, stores a session file): needed for
# private profiles the account follows, --comments, --geotags and --stories
instaloader --login=nwl_research --sessionfile=./ig-session --comments northwindlogistics
```

```python
import instaloader

def get_instagram_profile(username, max_posts=0):
    """Fetch public Instagram profile data; returns None when it is unavailable."""
    L = instaloader.Instaloader(download_pictures=False, download_videos=False,
                                download_video_thumbnails=False, save_metadata=False)
    try:
        profile = instaloader.Profile.from_username(L.context, username)
        data = {
            "username": profile.username,
            "full_name": profile.full_name,
            "biography": profile.biography,
            "followers": profile.followers,
            "following": profile.followees,
            "posts_count": profile.mediacount,
            "is_private": profile.is_private,
            "is_verified": profile.is_verified,
            "external_url": profile.external_url,
            "business_category": profile.business_category_name,
        }
        posts = []
        if max_posts and not profile.is_private:
            for post in profile.get_posts():
                posts.append({
                    "url": f"https://www.instagram.com/p/{post.shortcode}/",
                    "date": post.date_utc.isoformat(),
                    "caption": (post.caption or "")[:200],
                    "likes": post.likes,
                    "tagged_users": post.tagged_users,
                    "location": post.location.name if post.location else None,  # None unless logged in
                })
                if len(posts) >= max_posts:
                    break
        data["posts"] = posts
        return data
    except instaloader.exceptions.ProfileNotExistsException:
        print(f"Profile @{username} does not exist.")
    except instaloader.exceptions.LoginRequiredException:
        print(f"Instagram requires a logged-in session for @{username}.")
    except instaloader.exceptions.ConnectionException as err:   # includes 429 Too Many Requests
        print(f"Instagram refused the request: {err}")
    return None
```

Anonymous requests are often refused outright (`429 Too Many Requests` on the first call), especially from cloud, VPN and proxy addresses; Instaloader's documentation notes that logged-in access is not affected in the same way.

### Tool 3: Search-engine dorks for social media discovery

```python
from urllib.parse import quote_plus

SOCIAL_DORKS = {
    "linkedin_profile": 'site:linkedin.com/in/ "{first_name} {last_name}" "{company}"',
    "linkedin_employees": 'site:linkedin.com/in/ "{company}"',
    "x_profile": 'site:x.com "{name}" OR site:twitter.com "{name}"',
    "x_mentions": 'site:x.com "@{username}"',
    "instagram_profile": 'site:instagram.com "{username}"',
    "facebook_profile": 'site:facebook.com "{first_name} {last_name}"',
    "github_profile": 'site:github.com "{name}" "{company}"',
    "reddit_profile": 'site:reddit.com/user/ "{username}"',
    "youtube_channel": 'site:youtube.com/@{username}',
    "email_mentions": '"{email}" -site:{domain}',
}

def build_dork_url(template, **kwargs):
    """Return a Google search URL for a dork; open it in a browser."""
    return "https://www.google.com/search?q=" + quote_plus(template.format(**kwargs))

print(build_dork_url(SOCIAL_DORKS["linkedin_employees"], company="Northwind Logistics"))
# https://www.google.com/search?q=site%3Alinkedin.com%2Fin%2F+%22Northwind+Logistics%22
```

Google's `cache:` operator and cached-page links were retired in 2024; use the Wayback Machine for old copies.

### Tool 4: Wayback Machine — archived social profiles

```python
import requests

def wayback_search(url, limit=10):
    """List archived snapshots of a URL via the Wayback Machine CDX API (one per month)."""
    params = {
        "url": url,
        "output": "json",
        "limit": limit,
        "fl": "timestamp,statuscode,original",
        "filter": "statuscode:200",
        "collapse": "timestamp:6",      # first 6 digits = YYYYMM
    }
    resp = requests.get("https://web.archive.org/cdx/search/cdx", params=params, timeout=120)
    resp.raise_for_status()
    rows = resp.json()
    results = []
    for timestamp, _status, original in rows[1:]:      # first row is the header
        archive_url = f"https://web.archive.org/web/{timestamp}/{original}"
        print(f"  [{timestamp[:8]}] {archive_url}")
        results.append({"timestamp": timestamp, "url": archive_url})
    return results

wayback_search("twitter.com/northwind_ops", limit=10)      # old handle, old domain
wayback_search("linkedin.com/company/northwind-logistics", limit=5)
```

### Tool 5: Combined footprint report

```python
import json

def build_social_profile(target_name, username=None, company=None):
    """Combine Sherlock, Instaloader, dorks and the Wayback Machine into one JSON report."""
    report = {"target": target_name, "username": username, "company": company,
              "accounts": [], "instagram": None, "dorks": [], "wayback": {}}
    if username:
        report["accounts"] = sherlock_search(username)
        if any(a["site"] == "Instagram" for a in report["accounts"]):
            report["instagram"] = get_instagram_profile(username)
        for site in ("twitter.com", "instagram.com"):
            report["wayback"][site] = wayback_search(f"{site}/{username}", limit=5)
    if company:
        report["dorks"].append(build_dork_url(SOCIAL_DORKS["linkedin_employees"], company=company))
    out_file = f"social_profile_{(username or target_name).lower().replace(' ', '_')}.json"
    with open(out_file, "w") as f:
        json.dump(report, f, indent=2, default=str)
    return report
```

### Key data points to collect

| Platform | Key Intelligence |
|----------|-----------------|
| **LinkedIn** | Job title, employer, education, skills, connections, work history |
| **Twitter/X** | Interests, location, network, opinions, timing patterns |
| **Instagram** | Tagged locations, relationships, lifestyle, tagged users |
| **Facebook** | Family connections, political views, groups, check-ins |
| **GitHub** | Technical skills, projects, commit email addresses, code patterns |
| **Reddit** | Interests, opinions, subreddit activity, username linkages |

## Examples

### Example 1: Find accounts that use a company's handle

**User prompt:** "We're Northwind Logistics. Check where the handle `northwind_ops` is registered so we can spot impersonators."

```bash
sherlock northwind_ops northwindlogistics --print-found --csv --folderoutput findings --timeout 20
```

```
[*] Checking username northwind_ops on:

[+] Instagram: https://instagram.com/northwind_ops
[+] Reddit: https://www.reddit.com/user/northwind_ops

[*] Checking username northwindlogistics on:

[+] GitHub: https://www.github.com/northwindlogistics

[*] Search completed with 3 results
```

`findings/northwind_ops.csv` and `findings/northwindlogistics.csv` hold one row per claimed account. Open each URL and compare it with the list of accounts the company actually owns; report the rest as possible impersonation, with a screenshot and the date.

### Example 2: Recover the history of a renamed account

**User prompt:** "Our old support account @northwind_help was renamed last year. Find archived copies of the old profile for the incident report."

```python
snapshots = wayback_search("twitter.com/northwind_help", limit=12)
print(len(snapshots), "monthly snapshots")
```

```
  [20230114] https://web.archive.org/web/20230114091522/https://twitter.com/northwind_help
  [20230203] https://web.archive.org/web/20230203174410/https://twitter.com/northwind_help
2 monthly snapshots
```

Each line is the first successful capture of a month. An empty list means the page was never archived with status 200 — repeat the query with the `x.com` host and without the `filter` parameter before concluding that nothing exists.

## Guidelines

- **Authorization and law**: collecting public data is legal in most jurisdictions, but purpose matters. Get the scope in writing, and remember that GDPR and similar laws apply to personal data even when it is public — collect only what the engagement needs and delete it afterwards.
- **Platform terms**: automated scraping violates the terms of Instagram, LinkedIn, X and Facebook, and logging in with an account to scrape can get that account suspended. Prefer manual browsing or official APIs; never use these tools to access private content you are not entitled to see.
- **A hit is not an identity**: Sherlock only reports that a username exists on a site. Common handles belong to different people, and some sites return false positives. Confirm with a second signal (same avatar, bio, linked accounts) before attributing an account.
- **Instaloader rate limits**: Instagram throttles aggressively. Do not restart Instaloader in a loop, keep one session file instead of logging in repeatedly, and avoid downloading thousands of posts in one run.
- **EXIF is usually gone**: X, Instagram and Facebook strip EXIF (including GPS) from the copies they serve, so downloaded platform images rarely carry coordinates. `exiftool -gps:all IMG_4471.jpg` is worth running only on original files obtained elsewhere — personal sites, forums, file shares.
- **Wayback limits**: login-walled pages (most Instagram, LinkedIn and recent X profiles) are archived poorly; the CDX API is slow and rate-limited, so keep `limit` small and back off on HTTP 429, 503 or 504 (`wayback_search` raises `requests.HTTPError` on them).
- **Decoy accounts**: sophisticated subjects keep misleading or abandoned profiles. Cross-reference several sources before drawing conclusions.
- **Do not publish**: findings about individuals go to the client or case file, not to public channels. Never use this skill for stalking, harassment or doxxing.


---
Source attribution: terminal-skills
Original project: https://github.com/TerminalSkills/skills/blob/8a9852d489f274538be9bf1c9121aeb403750b1c/skills/social-media-osint/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   Copyright 2025 Terminal Skills

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Mega AI Hub resource metadata

Creator / publisher: terminal-skills
Original project: https://github.com/TerminalSkills/skills/blob/8a9852d489f274538be9bf1c9121aeb403750b1c/skills/social-media-osint/SKILL.md
Attribution basis: Source repository record

Fields of work: Education & Research, Marketing
Roles: Researcher, Marketing Analyst, Social Media Manager, Influencer Marketer, PR & Communications
Specialties: API
Tools: Sherlock, Instaloader
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 4fdace2d9e05fbec4aeb984a900b5840207f87d3735bb1a96fe651d3938e1a1d
