ghluka/discord-palantir
GitHub: ghluka/discord-palantir
一款 Discord OSINT 工具,通过提取 token 所属所有服务器的数据并存入数据库,实现对用户的持续追踪与检索。
Stars: 0 | Forks: 0
# 👁️ Discord Palantir
一款 Discord OSINT 工具。通过提取 token 所有 guilds 的数据,将用户信息记录到数据库中以进行追踪。
## 📜 环境要求:
- [python](https://python.org)(我在 v3.13.7 版本上运行)
- [postgresql](https://www.postgresql.org/download/)
- pip install -r requirements.txt
## ⚙️ 运行:
```
cd src # make sure you're in the src directory
# 导入 discord 账号:
py scraper/sync.py --token "" # set to a discord token
py scraper/sync.py --token "" --workers 4 # sync multiple guilds at once
# 运行网站
py main.py
```
该网站包含一个 API 和一个用于搜索用户和 guilds 的浏览器 UI。
📌 展开查看设置指南(强烈推荐)
- 安装 [postgresql](https://www.postgresql.org/download/) - 进入你安装 postgresql 的目录,然后导航到 `/scripts` 目录,运行 `runpsql` 脚本 - 它会打开一个类似这样的登录界面: ``` Server [localhost]: localhost Database [postgres]: postgres Port [5432]: 5432 Username [postgres]: postgres Password for user postgres: ``` - 只需输入你安装 postgres 时的所有信息,你也可以输入特定的端口 - 然后将以下内容粘贴或输入到 postgres 终端中 ``` CREATE DATABASE discord_archive; CREATE USER discord_user WITH PASSWORD 'your_password'; -- set the your_password to something else thats secure GRANT ALL PRIVILEGES ON DATABASE discord_archive TO discord_user; \c discord_archive ALTER SCHEMA public OWNER TO discord_user; GRANT ALL ON SCHEMA public TO discord_user; \q ``` - 再次打开终端运行 psql,这次我们不去 `/scripts` 目录运行 `runpsql`,而是去 `/bin` 目录运行 `psql` - 这一次我们要将参数直接传递给 psql,而不是运行脚本,所以请传入以下参数: ``` -U discord_user -d discord_archive -f "schema.sql" ``` - 将 `schema.sql` 替换为本仓库中 `/src/schema.sql` 文件的完整路径 - 运行时,它可能会提示 ``` Password for user discord_user: ``` - 只需输入你创建 discord_user 时设置的密码即可 恭喜,你现在拥有了一个初始化好的 postgre 数据库。现在让我们终于可以编写数据库 URL 了,它看起来会是这样的: ``` postgresql://discord_user:your_password@localhost:5432/discord_archive ``` 除了 `your_password@localhost:5432` 之外,请不要更改任何内容, 如果你为数据库设置了自定义端口或 IP,你需要更改 `localhost:5432`,否则请不要修改。 再次将 `your_password` 更改为你创建 discord_user 时设置的密码。 - 在 `/src` 目录中创建一个名为 `.env` 的文件 - 将以下内容作为你的 `.env` 文件内容: ``` DATABASE_URL="" ``` - 将 `DATABASE_URL` 设置为你刚刚创建的 postgresql 数据库 URL,它看起来会是这样: ``` DATABASE_URL="postgresql://discord_user:your_password@localhost:5432/discord_archive" ``` - 可选的媒体缓存设置: ``` MEDIA_CACHE_DIR="media_cache" MEDIA_CACHE_IMAGE_SIZE="256" MEDIA_CACHE_WEBP_QUALITY="70" DISCORD_RETRY_ATTEMPTS="8" DISCORD_RETRY_BASE_DELAY="2" DISCORD_RETRY_MAX_DELAY="60" ``` 个人头像和 guild 图标会被缓存为小型的静态 `.webp` 文件,即使原始 Discord 资源是动态的也是如此。标签:Discord, ESC4, OSINT, PostgreSQL, Python, URL抓取, 数据抓取, 数据泄露, 无后门, 测试用例, 用户追踪, 逆向工具