Simple Command Line Tool to Enumerate Slack Workspace Names from Slack Webhook URLs.
You need a Slack OAuth User Token with team:read privs to enumerate a workspace name. These are free and easy to create.
Important: You can use any account's OAuth token to enumerate cross-workspace names. This means you can enumerate a workspace name for any Slack Webhook.
- Install the
requests
pypi library.
pip install requests
- Run the
whoamislack.py
script.
python3 whoamislack.py --token <TOKEN_VALUE> https://hooks.slack.com/T234DSLKJ/BSDFJWEK23/e9Wi324jlkasdf
The script takes one (or two) command line arguments.
- A Slack User OAuth token with
team:read
privs (see below how to generate it). You can set an env variable namedSLACK_OAUTH_TOKEN
to the token value or pass the token on the command line with the--token
flag. - A Slack Webhook URL. This is a required and a positional argument.
- Login to any Slack workspace (or create a new one) in the browser and visit https://api.slack.com/apps.
- Click
Create New App
. SelectFrom scratch
. Name it and associate it with a workspace. - Click
OAuth and Permissions
underFeatures
. - Under
Scopes
>User Token Scopes
, add theteam:read
permission. - Scroll up. Under
OAuth Tokens for Your Workspace
, clickInstall to Workspace
. - Copy your
User OAuth Token
.