
一个用于在 Slack 工作区中进行红队和钓鱼演练的 Slack 攻击框架。
本工具仅供安全专业人员使用。未经明确测试许可,请勿针对任何 Slack 工作区使用此工具。使用风险自负。
成千上万的组织使用 Slack 来帮助员工沟通、协作和互动。许多 Slack 工作区会安装可用于自动执行不同任务的应用程序或机器人。这些机器人被单独授予权限,规定它们被允许通过 Slack API 请求执行哪些任务。为了向 Slack API 进行身份验证,每个机器人都会被分配一个以 xoxb 或 xoxp 开头的 API 令牌。很多时候,这些令牌会在某个地方泄露。在红队演练期间获取这些令牌后,恰当地利用它们可能很麻烦。现在 EvilSlackbot 来了,它可以自动化和简化这个过程。你可以使用 EvilSlackbot 发送伪造的 Slack 消息、钓鱼链接、文件,并搜索 Slack 中泄露的秘密。
除了红队演练之外,EvilSlackbot 还针对 Slack 钓鱼模拟进行了开发。要使用 EvilSlackbot 进行 Slack 钓鱼演练,只需在 Slack 中创建一个机器人,为你的机器人授予测试所需的权限,并向 EvilSlackbot 提供一个你想要测试的员工电子邮件列表(链接、文件、伪造消息),即可进行模拟钓鱼。
EvilSlackbot 需要 python3 和 Slackclient。
pip3 install slackclient
usage: EvilSlackbot.py [-h] -t TOKEN [-sP] [-m] [-s] [-a] [-f FILE] [-e EMAIL]
[-cH CHANNEL] [-eL EMAIL_LIST] [-c] [-o OUTFILE] [-cL]
options:
-h, --help show this help message and exit
Required:
-t TOKEN, --token TOKEN
Slack Oauth token
Attacks:
-sP, --spoof Spoof a Slack message, customizing your name, icon, etc
(Requires -e,-eL, or -cH)
-m, --message Send a message as the bot associated with your token
(Requires -e,-eL, or -cH)
-s, --search Search slack for secrets with a keyword
-a, --attach Send a message containing a malicious attachment (Requires -f
and -e,-eL, or -cH)
Arguments:
-f FILE, --file FILE Path to file attachment
-e EMAIL, --email EMAIL
Email of target
-cH CHANNEL, --channel CHANNEL
Target Slack Channel (Do not include #)
-eL EMAIL_LIST, --email_list EMAIL_LIST
Path to list of emails separated by newline
-c, --check Lookup and display the permissions and available attacks
associated with your provided token.
-o OUTFILE, --outfile OUTFILE
Outfile to store search results
-cL, --channel_list List all public Slack channels
要使用此工具,您必须提供一个 xoxb 或 xoxp 令牌。
Required:
-t TOKEN, --token TOKEN (Slack xoxb/xoxp token)
python3 EvilSlackbot.py -t <token>
根据与您的令牌关联的权限,EvilSlackbot 可以执行多种攻击。EvilSlackbot 会自动检查您的令牌具有哪些权限,并显示这些权限以及您可以使用给定令牌执行的所有攻击。

Attacks:
-sP, --spoof Spoof a Slack message, customizing your name, icon, etc (Requires -e,-eL, or -cH)
-m, --message Send a message as the bot associated with your token (Requires -e,-eL, or -cH)
-s, --search Search slack for secrets with a keyword
-a, --attach Send a message containing a malicious attachment (Requires -f and -e,-eL, or -cH)
使用正确的令牌权限,EvilSlackbot 允许您以伪造的机器人名称和头像发送钓鱼消息。此攻击还需要目标的 电子邮件地址 (-e)、目标电子邮件列表 (-eL) 或 Slack 频道名称 (-cH)。EvilSlackbot 将使用这些参数查找与提供的电子邮件或频道名称关联的用户的 SlackID。要自动化您的攻击,请使用电子邮件列表。
python3 EvilSlackbot.py -t <xoxb token> -sP -e <email address>
python3 EvilSlackbot.py -t <xoxb token> -sP -eL <email list>
python3 EvilSlackbot.py -t <xoxb token> -sP -cH <Channel name>
使用正确的令牌权限,EvilSlackbot 允许您发送包含钓鱼链接的钓鱼消息。此攻击与伪造攻击的区别在于,此方法将作为与您的令牌关联的机器人发送消息。您将无法选择发送钓鱼消息的机器人的名称或图像。此攻击还需要目标的 电子邮件地址 (-e)、目标电子邮件列表 (-eL) 或 Slack 频道名称 (-cH)。EvilSlackbot 将使用这些参数查找与提供的电子邮件或频道名称关联的用户的 SlackID。要自动化您的攻击,请使用电子邮件列表。
python3 EvilSlackbot.py -t <xoxb token> -m -e <email address>
python3 EvilSlackbot.py -t <xoxb token> -m -eL <email list>
python3 EvilSlackbot.py -t <xoxb token> -m -cH <Channel name>
使用正确的令牌权限,EvilSlackbot 允许您通过关键词搜索在 Slack 中搜索秘密。目前,此攻击需要 xoxp 令牌,因为 xoxb 令牌无法获得在 Slack 中搜索关键词的适当权限。使用 -o 参数将搜索结果写入输出文件。
python3 EvilSlackbot.py -t <xoxp token> -s -o <outfile.txt>
使用正确的令牌权限,EvilSlackbot 允许您发送文件附件。附件攻击需要提供您要发送的 文件路径 (-f)。此攻击还需要目标的 电子邮件地址 (-e)、目标电子邮件列表 (-eL) 或 Slack 频道名称 (-cH)。EvilSlackbot 将使用这些参数查找与提供的电子邮件或频道名称关联的用户的 SlackID。要自动化您的攻击,请使用电子邮件列表。
python3 EvilSlackbot.py -t <xoxb token> -a -f <path to file> -e <email address>
python3 EvilSlackbot.py -t <xoxb token> -a -f <path to file> -eL <email list>
python3 EvilSlackbot.py -t <xoxb token> -a -f <path to file> -cH <Channel name>
Arguments:
-f FILE, --file FILE Path to file attachment
-e EMAIL, --email EMAIL Email of target
-cH CHANNEL, --channel CHANNEL Target Slack Channel (Do not include #)
-eL EMAIL_LIST, --email_list EMAIL_LIST Path to list of emails separated by newline
-c, --check Lookup and display the permissions and available attacks associated with your provided token.
-o OUTFILE, --outfile OUTFILE Outfile to store search results
-cL, --channel_list List all public Slack channels
使用正确的权限,EvilSlackbot 可以搜索并列出 Slack 工作区中的所有公共频道。这有助于规划在哪些频道发送消息。使用 -o 将列表写入输出文件。
python3 EvilSlackbot.py -t <xoxb token> -cL