项目标题与描述

Blackbird是一款强大的OSINT(开源情报)工具,专为用户名和邮箱搜索而设计。该工具集成了WhatsMyName项目的600多个社交平台数据库,能够快速准确地查找目标账户在不同平台的存在情况。项目采用Python开发,提供命令行界面,支持AI智能分析和多种数据导出格式。

功能特性

  • 多平台搜索: 支持600+社交媒体的用户名和邮箱反向查找
  • 智能AI分析: 集成免费AI引擎,自动生成用户行为和技术画像
  • 多种导出格式: 支持PDF、CSV、JSON等多种结果导出方式
  • 批量处理: 支持用户名列表文件和邮箱列表文件的批量处理
  • 元数据提取: 能够从响应中提取丰富的用户元数据信息
  • 实时更新: 自动检查并更新平台数据库,确保数据最新
  • 智能过滤: 内置结果过滤机制,减少误报率

安装指南

系统要求: Python 3.6+,支持Windows、Linux、macOS系统

# 克隆仓库
git clone https://github.com/p1ngul1n0/blackbird
cd blackbird

# 安装依赖
pip install -r requirements.txt

依赖项: rich、aiohttp、reportlab、python-dotenv、requests等

使用说明

基本用户名搜索:

python blackbird.py --username johndoe

邮箱搜索:

python blackbird.py --email [email protected]

使用AI分析:

python blackbird.py --username johndoe --ai

导出PDF报告:

python blackbird.py --email [email protected] --pdf

设置AI API密钥:

python blackbird.py --setup-ai

核心代码

主程序初始化:

def initiate():
    if not os.path.exists("logs/"):
        os.makedirs("logs/")
    logging.basicConfig(
        filename=config.LOG_PATH,
        level=logging.DEBUG,
        format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    )

    parser = argparse.ArgumentParser(
        prog="blackbird",
        description="An OSINT tool to search for accounts by username in social networks.",
    )
    parser.add_argument(
        "-u",
        "--username",
        nargs="*",
        type=str,
        help="One or more usernames to search.",
    )

站点检查核心逻辑:

async def checkSite(site, method, url, session, semaphore, config):
    returnData = {
        "name": site["name"],
        "url": url,
        "category": site["cat"],
        "status": "NONE",
        "metadata": None,
    }
    async with semaphore:
        response = await do_async_request(method, url, session, config)
        if response == None:
            returnData["status"] = "ERROR"
            return returnData
        try:
            if response:
                if (site["e_string"] in response["content"]) and (
                    site["e_code"] == response["status_code"]
                ):
                    if (site["m_string"] not in response["content"]) and (
                        (site["m_code"] != response["status_code"])
                        if site["m_code"] != site["e_code"]
                        else True
                    ):
                        returnData["status"] = "FOUND"

AI分析功能:

def send_prompt(prompt, config):
    config.console.print(f":sparkles: Analyzing with AI...")
    apikey = load_api_key_from_file(config)
    if not apikey:
        config.console.print(":x: No API key found. Please obtain an API key first with --setup-ai")
        return None
    headers = {
        "Content-Type": "application/json",
        "User-Agent": "blackbird-cli",
        "x-api-key": apikey
    }
    payload = {
        "prompt": prompt
    }

PDF导出功能:

def saveToPdf(foundAccounts, resultType, config):
    regularFontFile = os.path.join(
        os.getcwd(),
        config.ASSETS_DIRECTORY,
        config.FONTS_DIRECTORY,
        config.FONT_REGULAR_FILE,
    )
    boldFontFile = os.path.join(
        os.getcwd(),
        config.ASSETS_DIRECTORY,
        config.FONTS_DIRECTORY,
        config.FONT_BOLD_FILE,
    )
    try:
        pdfmetrics.registerFont(TTFont(config.FONT_NAME_REGULAR, regularFontFile))
        pdfmetrics.registerFont(TTFont(config.FONT_NAME_BOLD, boldFontFile))
本站提供的所有下载资源均来自互联网,仅提供学习交流使用,版权归原作者所有。如需商业使用,请联系原作者获得授权。 如您发现有涉嫌侵权的内容,请联系我们 邮箱:[email protected]