usualdork/InstagramOSINT

GitHub: usualdork/InstagramOSINT

一款由 AI 驱动的 Instagram 终端情报工具,支持资料分析、社交图谱映射、媒体下载、数据批量导出及自然语言多步骤调查。

Stars: 0 | Forks: 0

🔍 Instagram OSINT

用于 Instagram 的情报、分析和数据导出工具包。
由 AI 驱动。专为终端打造。

Node 22+ TypeScript MIT License MCP AI Platform

igosint help

igosint profile and engagement demo

## 这是什么? **Instagram OSINT** (`igosint`) 是一个用于 Instagram 情报收集和分析的终端工具包。它通过经过身份验证的会话连接到 Instagram,并提供了 25+ 个命令,用于分析账户资料、映射社交图谱、计算互动率、下载媒体、导出批量数据,以及通过自然语言 AI 执行复杂的调查。 两种操作模式: | 模式 | 方式 | 最适合 | |------|-----|----------| | **CLI 模式** | 直接命令 (`igosint followers github --limit 10`) | 脚本、自动化、特定查询 | | **AI 对话模式** | 像人类一样与它交谈:*"将 @target 的所有照片下载到 ~/Desktop/investigation 并将其粉丝列表导出为 CSV"* | 复杂的多步骤 OSINT 工作流,解放双手的情报收集 | ## 快速开始 ``` git clone https://github.com/usualdork/InstagramOSINT.git cd igosint && npm install && npm run build # 登录 Instagram npx igosint auth login # 开始使用 npx igosint user info github npx igosint mcp setup # Configure AI npx igosint mcp chat # Ask anything ``` ## 功能概览 | 分类 | 命令 | 功能说明 | | ---------------- | ---------------------------------- | ----------------------------------------------------- | | **资料** | `user info` | 完整的资料数据、商业信息、联系方式 | | **社交图谱** | `followers`, `following`, `mutual` | 粉丝/关注列表、互相关注分析 | | **媒体** | `media`, `media-info` | 帖子列表、详细的媒体元数据 | | **互动** | `engagement` | 互动率、平均点赞/评论数、单篇帖子指标 | | **评论** | `comments` | 支持分页的评论检索 | | **快拍** | `stories` | 活跃快拍的元数据 | | **搜索** | `search users/hashtags/locations` | 跨 Instagram 的发现 | | **下载** | `download` | 将帖子、reels、图文轮播、快拍保存到本地 | | **导出** | `export` | 批量导出为 CSV/JSON/YAML 文件 | | **AI 对话** | `mcp chat` | 通过 Gemini/Groq/OpenAI 进行自然语言查询 | ## 资料情报 获取任何公开资料的完整账户数据。

user info

``` igosint user info github igosint user info github -o json # Structured output igosint user info github -o csv # Spreadsheet-ready ```
JSON 输出示例

user info json

## 社交图谱 分析粉丝/关注网络。按认证状态、隐私或文本搜索进行过滤。 ``` # 使用 filters 获取粉丝 igosint followers github --limit 10 --public --sort username # 获取 following 列表 igosint following github --limit 20 --verified # 查找两个账号之间的共同关注 igosint mutual user_a user_b -o json ``` **可用过滤器:** `--limit`, `--all`, `--sort`, `--desc`, `--verified`, `--private`, `--public`, `--contains`, `--offset` ## 互动指标 根据真实帖子数据计算互动率。

engagement metrics

``` # 账号级别的 engagement(基于最后 N 个 posts) igosint engagement github --limit 10 # 单个 post 的 engagement igosint engagement 39122146xxxxx_19318909 ```
JSON 输出

engagement json

**公式:** `engagementRate = ((avgLikes + avgComments) / followerCount) * 100` ## 媒体分析 列出帖子并获取详细的元数据,包括标签、被标记的用户和位置。 ``` # 列出最近的 posts igosint media github --limit 5 --since 2025-01-01 # 特定 post 的详细信息 igosint media-info 39122146xxxxx_19318909 -o json ``` 过滤器:`--since `, `--until `, `--sort`, `--contains` ## 搜索 发现用户、标签和位置。

search demo

``` igosint search users "photography" --limit 5 --verified igosint search hashtags "opensource" --limit 10 igosint search locations "San Francisco" --limit 5 ``` ## 下载媒体 将帖子、reels、图文轮播和快拍保存到您的文件系统中。

download post

``` # 下载 post 或 reel(videos 保存为 .mp4,images 保存为 .jpg) igosint download 39122146xxxxx_19318909 --dir ~/Desktop/osint # 下载所有 carousel images(自动检测并下载每一个) igosint download 37698909xxxxx_8670305522 --dir ./output # 下载用户的全部活跃 stories igosint download stories:target_user --dir ~/Desktop/stories ``` 图文轮播会自动下载所有幻灯片。每个文件都使用媒体 ID 命名。 ## 数据导出 将粉丝、关注或媒体数据批量导出为结构化文件。

export demo

``` # 导出所有 followers 到 CSV(选择特定 fields) igosint export followers github -o csv \ --file ~/Desktop/osint/github_followers.csv \ --fields username,fullName,isVerified # 导出 following 到 JSON igosint export following github -o json --file following.json # 导出最后 50 个 posts 的 metadata igosint export media github -o yaml --limit 50 --file media.yaml ``` | 参数 | 描述 | | -------------------- | --------------------------------- | | `-o csv\|json\|yaml` | 输出格式 | | `--file ` | 输出文件路径 | | `--fields ` | 要包含的逗号分隔字段 | | `--limit N` | 最大项目数(省略则导出全部) | ## AI 对话模式 (MCP) Instagram OSINT 内置了一个由 LLM (Gemini, Groq, OpenAI) 驱动的 AI 代理。它能解释您的自然语言请求,自主调用正确的工具组合,处理文件路径和目录创建,并返回格式化的结果。过去需要 5 个以上 CLI 命令才能完成的多步骤工作流,现在只需一句话就能搞定。 ### 设置(一次性) ``` igosint mcp setup ``` 可从以下选择:**Gemini** (Google), **Groq**, **OpenAI**,或任何**自定义的 OpenAI 兼容**端点。 ### 用法 ``` igosint mcp chat ``` ### 示例会话 ``` You: Get me everything about @github. Profile, engagement rate, and their top 3 posts. ⚡ Calling get_user_info... ⚡ Calling get_engagement... ⚡ Calling get_media... AI: GitHub (@github) is a verified IT company with 827K followers. Engagement rate: 1.21% (avg 9.8K likes, 129 comments per post). Top 3 posts: [video] Universe Early Bird (488 likes), [carousel] Agentic announcement (2.1K likes), [video] Copilot teaser (54K likes). ``` ``` You: Download all photos from @target_user to ~/Desktop/osint/photos ⚡ Calling get_media... ⚡ Calling download_media... (x5) AI: Downloaded 5 posts (8 files total) to ~/Desktop/osint/photos/. Includes 2 carousel albums (6 images) and 2 single photos. Directory created automatically. ``` ``` You: Export the complete follower list of @github as CSV to ~/Documents/investigation/github_followers.csv with only username, fullName, and isVerified columns ⚡ Calling export_data... AI: Done. Exported 827,449 followers to ~/Documents/investigation/github_followers.csv (CSV format, 3 fields: username, fullName, isVerified) ``` ``` You: Find who both @github and @vercel follow in common ⚡ Calling get_mutual_connections... AI: Found 5 mutual accounts that both @github and @vercel follow: @reactjs, @nodejs, @typescript, @nextjs, @openai ``` ``` You: What's the engagement difference between @nike and @adidas? ⚡ Calling get_engagement... (x2) AI: Nike: 0.84% engagement (avg 142K likes, 1.2K comments, 16.9M followers) Adidas: 0.31% engagement (avg 18K likes, 430 comments, 5.8M followers) Nike outperforms by 2.7x in engagement rate despite having 3x more followers. ``` ### AI 自动处理的任务: - 多步骤操作(获取 ID,然后逐个下载,最后导出元数据) - 智能文件路径解析(“我的桌面”会变为 `~/Desktop`,并自动创建文件夹) - 输出格式决策(为数据选择 CSV,为 API 选择 JSON,为展示选择文本) - 在一次查询中对多个账户进行对比分析 - 分页感知(当您说“完整列表”时,会获取所有页面) ### 支持的提供商 | 提供商 | 模型 | 速度 | 工具调用 | | ------------- | --------------------- | :-------: | :----------: | | Google Gemini | `gemini-2.5-flash` | 快速 | 优秀 | | Groq | `openai/gpt-oss-120b` | 非常快 | 良好 | | OpenAI | `gpt-4o-mini` | 适中的 | 良好 | | 自定义 | 任何 OpenAI 兼容的 | 视情况 | 视情况 | ## 输出格式 每个命令都支持多种输出格式: | 格式 | 参数 | 用例 | | -------- | -------------- | ---------------------------- | | 表格 | _(默认)_ | 终端查看 | | JSON | `-o json` | API,编程使用 | | CSV | `-o csv` | 电子表格,分析工具 | | YAML | `-o yaml` | 可读的结构化数据 | | Markdown | `-o markdown` | 文档,报告 | 所有 JSON 输出都使用一致的信封格式: ``` {"ok": true, "data": ...} // Success {"ok": false, "error": "..."} // Error ``` ## 身份验证 ``` igosint auth login # Interactive login (username + password) igosint auth status # Check session validity igosint auth refresh # Refresh session without re-entering credentials igosint auth logout # Clear session igosint auth switch # Switch between accounts ``` 会话持久化保存在 `~/.igosint/users//` 中,并具有严格的文件权限。 ## 频率限制和缓存 内置针对 Instagram API 频率限制的保护机制: | 功能 | 详情 | | ----------------------- | ----------------------------------------------------- | | **指数退避** | 初始延迟 1 秒,成倍增加最高至 60 秒,最多重试 5 次 | | **请求间延迟** | `--delay ` 用于调整请求节奏 | | **本地缓存** | 响应已缓存(资料缓存 300 秒,快拍缓存 60 秒) | | **绕过缓存** | `--no-cache` 标志 | | **自定义 TTL** | `--cache-ttl ` 标志 | ## 安装 **要求:** Node.js 22+ ``` git clone https://github.com/usualdork/InstagramOSINT.git cd igosint npm install npm run build ``` 如需全局访问: ``` npm link igosint --help ``` ## 项目结构 ``` igosint/ ├── source/ │ ├── commands/ CLI command components (React/Ink) │ │ ├── auth/ Login, logout, status, refresh │ │ ├── mcp/ AI chat setup and interface │ │ ├── search/ User, hashtag, location search │ │ ├── user/ Profile info │ │ ├── followers Social graph │ │ ├── following Social graph │ │ ├── mutual Mutual connections │ │ ├── media Media listing │ │ ├── media-info Media details │ │ ├── engagement Engagement metrics │ │ ├── comments Comment retrieval │ │ ├── download Media download │ │ └── export Data export │ ├── mcp/ AI/MCP layer │ │ ├── config Provider settings │ │ ├── tools Tool definitions (15 tools) │ │ ├── executor Tool execution engine │ │ └── chat Interactive chat loop │ ├── utils/ Shared utilities │ │ ├── formatter JSON/CSV/YAML/Markdown/Table output │ │ ├── filter-engine Filtering, sorting, pagination │ │ ├── pagination-handler Auto cursor-based pagination │ │ ├── rate-limiter Exponential backoff │ │ ├── cache-manager Filesystem TTL cache │ │ └── error-handler Error classification │ ├── client.ts Instagram API client (wraps instagram-private-api) │ └── types/ TypeScript type definitions ├── tests/ │ └── properties/ Property-based tests (fast-check) └── docs/ └── screenshots/ Terminal screenshots for docs ``` ## 测试 26 个基于属性的测试验证了正确性保证: ``` npm test # Full suite (lint + type check + tests) npx ava tests/properties/ # Property tests only npx tsc --noEmit # Type check only ``` 测试的属性包括格式化程序的往返过程、过滤器的正确性、分页的完整性、频率限制器的时序、缓存 TTL、互动公式,以及用于互相关注连接的集合交集。 ## 安全性 - 会话以文件权限 `0600` 存储 - API 密钥仅在本地存储,仅传输给配置的 AI 提供商 - 无遥测,无数据收集 - 尊重 Instagram 的隐私设置(私密账户需要关注才能访问) - 所有通信均通过 HTTPS ## 限制 - 需要经过身份验证的 Instagram 会话 - 只有您关注的私密账户才能访问 - Instagram 可能会对高强度使用进行频率限制(已通过内置退避机制处理) - 快拍仅在其活跃期间(24 小时窗口内)可下载 - 大型账户(10 万+粉丝)的完整粉丝导出由于分页原因需要一定时间 ## 许可证 MIT 许可证。详见 [LICENSE](./LICENSE)。 本软件包含来自开源项目的组件。详见 [NOTICES](./NOTICES)。

使用 TypeScript、React/Ink 以及满满的终端热爱构建。

标签:ESC4, MITM代理, OSINT, TypeScript, 人工智能, 安全情报, 安全插件, 数据导出, 数据泄露, 用户模式Hook绕过, 社交媒体分析, 自动化攻击