📱 Telegram OSINT 情报收集工具

⚠️ 需要配置 Telegram API
工具框架已部署,需要获取 API 凭证后才能使用

🎯 功能概述

🔑 配置步骤

步骤 1: 获取 API 凭证
1. 访问: https://my.telegram.org/apps
2. 使用手机号登录
3. 创建新应用
4. 获取 api_id 和 api_hash
步骤 2: SSH 连接服务器
ssh [email protected]
步骤 3: 安装依赖
cd /root/osint-tools/telegram-osint
pip3 install telethon --break-system-packages
步骤 4: 配置 API
cp config.example.py config.py
nano config.py

# 填入你的凭证:
API_ID = 'your_api_id'
API_HASH = 'your_api_hash'
PHONE = '+86xxxxxxxxxxx'
步骤 5: 运行工具
python3 telegram_osint.py

📖 高级用法示例

1. 查询用户信息

from telethon import TelegramClient

async def get_user_info(username):
    async with TelegramClient('session', api_id, api_hash) as client:
        user = await client.get_entity(username)
        print(f"用户ID: {user.id}")
        print(f"姓名: {user.first_name}")
        print(f"用户名: @{user.username}")
        print(f"电话: {user.phone}")

2. 导出群组成员

async def export_members(group_id):
    async with TelegramClient('session', api_id, api_hash) as client:
        participants = await client.get_participants(group_id)
        for user in participants:
            print(f"{user.id},{user.username},{user.first_name}")

3. 采集频道消息

async def fetch_channel_messages(channel, limit=100):
    async with TelegramClient('session', api_id, api_hash) as client:
        async for message in client.iter_messages(channel, limit=limit):
            print(f"{message.date}: {message.text}")

🛠️ 常用 OSINT 场景

🔒 隐私和安全

注意事项:
• 遵守 Telegram ToS 和当地法律
• 不要滥用 API 导致账号被封
• 保护好 session 文件
• 限制请求频率避免触发反垃圾机制
• 不要公开分享他人隐私信息

📚 参考资源