Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
msteams — 通过 Microsoft Graph API 将代理流量隧道传输到 Microsoft Teams 频道的 Mythic C2 配置文件,支持 AES256 加密、抖动、终止日期和代理。 | Kitploit
工具/GitHubGitHub/whispergate/msteams
防御工具渗透测试框架加密/解密工具后渗透利用命令与控制实用工具与框架红队Payload 开发
GitHubwhispergate/msteams

msteams

通过 Microsoft Graph API 将代理流量隧道传输到 Microsoft Teams 频道的 Mythic C2 配置文件,支持 AES256 加密、抖动、终止日期和代理。

查看仓库
28172天前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

msteams

一个 Mythic C2 Profile,使用 Microsoft Graph API 通过 Microsoft Teams 频道进行通信。

工作原理

root@kitploit:~
Agent <---> Microsoft Teams Channel <---> C2 Server <---> Mythic
  1. Agent 通过 OAuth2 客户端凭据向 Microsoft Entra ID 进行身份验证
  2. 将其 Mythic 消息(base64 编码、AES 加密)发布到 Teams 频道
  3. C2 服务器通过 Graph API 轮询该频道,将新消息转发给 Mythic
  4. Mythic 的响应被发布回该频道
  5. Agent 轮询该频道并获取响应

通信表现为正常的 Teams 频道活动。

此 Profile 支持:

  • Kill Dates
  • 带抖动的休眠间隔
  • AES256 加密
  • 代理配置
  • 可选的消息清理(处理后删除消息)
  • 用于发送的 Webhook 回退

安装

从你的 Mythic 服务器:

root@kitploit:~
sudo ./mythic-cli install github https://github.com/Whispergate/msteams

或从本地文件夹:

root@kitploit:~
sudo ./mythic-cli install folder /path/to/msteams

Entra ID 设置

  1. 应用注册 - 在 Azure Portal > Microsoft Entra ID > App registrations 中创建
  2. 客户端密钥 - 在 Certificates & secrets 下生成
  3. API 权限 - 授予应用程序权限和管理员同意:
    • ChannelMessage.Read.All - 读取频道消息
    • ChannelMessage.Send - 发送频道消息
  4. 团队和频道 ID - 通过 Graph Explorer 或 Teams 客户端频道链接获取

如果 ChannelMessage.Send 不可用,请使用 Group.ReadWrite.All 或配置 webhook URL。

完整设置说明位于安装后的 Mythic 文档页面:https://<your-mythic-server>:7443/docs/c2-profiles/msteams。

配置

通过 Mythic UI 编辑:C2 Profiles > msteams > View/Edit Config。

兼容的 Agent

  • Starburst - 通过基于 WinHTTP 的 MS Teams 传输提供完整支持

任何实现了 msteams C2 profile 参数的 Mythic agent 都可以使用此 profile。Agent 需要:

  1. 使用配置的凭据向 Graph API 进行身份验证
  2. 将 base64 编码的 Mythic 消息发布到配置的 Teams 频道
  3. 轮询该频道以获取来自 C2 服务器的响应

无需 Azure 的测试

test/ 中包含一个模拟测试基础设施,用于在没有任何 Azure 或 M365 账户的情况下进行本地测试。这让你可以针对本地伪造的 Graph API 测试完整的 C2 管道——包括已编译的植入程序。

模拟服务器设置

  1. 将 test/mock_server.py 复制到你的 Mythic 主机并启动它:

    root@kitploit:~
    python3 mock_server.py
    

    这会在端口 8443 上启动一个伪造的 Graph API。

  2. 在 Mythic 中使用模拟值配置 msteams C2 profile:

    root@kitploit:~
    {
      "tenant_id": "fake-tenant-id",
      "client_id": "fake-client-id",
      "client_secret": "fake-client-secret",
      "team_id": "fake-team-id",
      "channel_id": "fake-channel-id",
      "graph_base": "http://<mythic-host-ip>:8443/v1.0",
      "login_base": "http://<mythic-host-ip>:8443",
      "poll_interval": 3,
      "clear_messages": true,
      "debug": true
    }
    
  3. 在 Mythic UI 中启动 msteams profile。

使用已编译植入程序(Starburst)进行测试

要针对模拟服务器测试真实的已编译 agent,agent 二进制文件需要使用模拟服务器的 IP 和端口进行硬编码构建,而不是使用真实的 Graph API 端点。在 Starburst agent 代码(agent_code/src/transport/msteams.cc)中:

root@kitploit:~
// Change these for mock testing:
#define GRAPH_API_HOST  "<mythic-host-ip>"
#define LOGIN_HOST      "<mythic-host-ip>"
#define API_PORT        8443

// And change WINHTTP_FLAG_SECURE to 0 in WinHttpOpenRequest
// since the mock server uses plain HTTP:
        WINHTTP_DEFAULT_ACCEPT_TYPES,
        0

然后重新安装 Starburst,使用 msteams profile(使用相同的伪造 tenant/client/team/channel ID)构建 payload,并在能够访问 Mythic 主机的 Windows VM 上运行它。

在构建生产 payload 之前,请记得还原这些更改:

root@kitploit:~
#define GRAPH_API_HOST  "graph.microsoft.com"
#define LOGIN_HOST      "login.microsoftonline.com"
#define API_PORT        443

        WINHTTP_DEFAULT_ACCEPT_TYPES,
        WINHTTP_FLAG_SECURE

使用伪造 Agent 进行测试(无需编译)

要进行快速的管道测试而无需编译 agent:

root@kitploit:~
GRAPH_URL=http://<mythic-host-ip>:8443 python test/fake_agent.py

更多详情请参见 test/README.md。

OPSEC 注意事项

  • 使用成员最少的专用私有频道
  • 启用 clear_messages 以在处理后进行清理
  • 保持 poll_interval 合理(10-30 秒)以避免速率限制
  • 所有消息在 Mythic payload 层面均使用 AES256 加密
  • Teams 消息并非端到端加密(租户管理员和 Microsoft 可见)
  • Graph API 速率限制约为每个租户每个应用每秒 30 个请求

文件结构

root@kitploit:~
msteams/
  config.json                          # Mythic container config
  C2_Profiles/msteams/
    Dockerfile                         # Container image
    main.py                            # Mythic service entrypoint
    requirements.txt                   # Python dependencies
    rabbitmq_config.json               # RabbitMQ settings
    msteams/
      c2_functions/msteams.py          # C2Profile class + parameters
      c2_code/
        server.py                      # Main polling loop
        graph_client.py                # MS Graph API client
        mythic_client.py               # Mythic API forwarder
        config.py                      # Config singleton
        config.json                    # Default config values
  documentation-c2/msteams/_index.md   # Mythic docs page
  test/
    mock_server.py                     # Mock Graph API server
    fake_agent.py                      # Simulated agent for testing
    test_c2_server.py                  # Standalone C2 server test harness
    test_config.json                   # Test config with fake values
下载工具
参数描述默认值
tenant_idEntra ID 租户(目录)ID
client_id应用注册客户端 ID
client_secret应用注册客户端密钥
team_idTeams 团队 ID
channel_idTeams 频道 ID
webhook_url用于发送的可选 webhook URL
graph_baseGraph API 基础 URLhttps://graph.microsoft.com/v1.0
login_base登录端点基础 URLhttps://login.microsoftonline.com
poll_interval轮询间隔秒数10
clear_messages处理后删除消息false
debug启用详细日志记录false