Get personal Slack tokens from the web interface
I am currently in 5 slack organisations and wanted to automate setting my status across all the orgs simultaneously. Unfortunately Slack have deprecated personal api tokens… You may also be in an environment where slack apps are tightly controlled.
Don’t lose hope though - with a bit of l33t h4x0ring you can get a personal bearer token from the web UI!
Log into slack in a browser with devtools available (a URL like https://your-org.slack.com)
Boot up dev tools and inspect the cookies.
Copy the value of the
Run SlackPirate.py with the
--cookieflag to find the bearer token for all the slack organisations the account has access to.
$ python SlackPirate.py --cookie=Io%2FEQqmUW9%2B72jxbNIBfM1bVq29qxxx This cookie has access to the following Workspaces: URL: https://foo.slack.com/ Token: xoxs-... (not admin) URL: https://bar.slack.com/ Token: xoxs-... (not admin) URL: https://baz.slack.com/ Token: xoxs-... (not admin)
xoxs-value is the bearer token.
Test this against the
curl -H 'Authorization: Bearer xoxs-...' -XGET \ https://slack.com/api/auth.test
If you get a response back with your account details you’re all set! Check out the API docs here - https://api.slack.com/methods/