Giter VIP home page Giter VIP logo

Comments (9)

Mythra avatar Mythra commented on August 26, 2024 1

Thanks @insomniacslk , seems to be working for me so I can re-enable MFA. I appreciate your work on this!

from irc-slack.

insomniacslk avatar insomniacslk commented on August 26, 2024

Hi @securityinsanity , thanks for your feedback! The first thing that looks odd to me is the empty Slack websocket URL on the third line of the log, where it says "Using URL:", there I expect something like wss://cerberus-xxxx.lb.slack-msgs.com/websocket/XXXX (where XXXX is specific to your connection). In this case there seems to be just a newline instead. This comes from the slack library rather than from irc-slack directly.

Then there is "invalid_auth". From Slack's API documentation:

Some aspect of authentication cannot be validated.
Either the provided token is invalid or the request
originates from an IP address disallowed from making
the request.

I would safely assume that this is not a disallowed IP address issue, so the other option is "invalid token". To rule out any client issue, could you try the same process using irssi and report back here? The command line is irssi -c localhost -p 6666 -w 'your token'.
If the above doesn't work, we can look into why the websocket URL is empty

from irc-slack.

insomniacslk avatar insomniacslk commented on August 26, 2024

Also can you confirm that the token you obtain with autotoken is of the form xoxp-XXXX|d=YYYY;? The important details are the |d= and the ; at the end. Thanks!

from irc-slack.

Mythra avatar Mythra commented on August 26, 2024

Hey! @insomniacslk , Autotoken doesn't seem to work for me (I believe it's because I have MFA!). However the tokens I have are in the format:

xoxc-xxxxxx|d=xxxx;

Using irssi I get the same result which (is good(?)):

[2020-07-11T00:20:10Z]  INFO main: Setting log level to 'info'
[2020-07-11T00:20:10Z]  INFO main: Starting server on 127.0.0.1:6666
[2020-07-11T00:20:10Z]  INFO main: Listening on 127.0.0.1:6666
[2020-07-11T00:20:27Z]  INFO main: Starting Slack client
[2020-07-11T00:20:27Z]  INFO slack-api: Connecting to RTM
[2020-07-11T00:20:27Z]  INFO slack-api: Using URL: 

[2020-07-11T00:20:27Z]  INFO slack-api: Failed to start or connect to RTM: invalid_auth
[2020-07-11T00:20:27Z]  INFO slack-api: invalid auth when connecting with RTM: invalid_auth
[2020-07-11T00:20:27Z]  INFO slack-api: Failed to connect with RTM on try 0: invalid_auth
[2020-07-11T00:20:37Z]  WARN main: Cannot connect to Slack: Connection to Slack timed out after 10s
[2020-07-11T00:20:37Z]  WARN main: Error handling connection from 127.0.0.1:27093: read tcp 127.0.0.1:6666->127.0.0.1:27093: use of closed network connection

from irc-slack.

insomniacslk avatar insomniacslk commented on August 26, 2024

Yes, MFA would make autotoken fail (and it should be possible to add support for it).

Since you've used the manual procedure, it's still possible that the token is invalid. When I was developing autotoken, the first few times I copied the percent-encoded string instead of the decoded string. In the browser console the token can show up in both ways, depending on where it was copied from. Could you please check that you have a non-percent-encoded cookie?

from irc-slack.

Mythra avatar Mythra commented on August 26, 2024

I can confirm there is no percents in the cookie value (or in the xoxc- value). The cookie seems to be a valid base64 string.

Anyway I can perhaps try manually using the cookie with curl, or something of the like to validate it's correctness?

from irc-slack.

Mythra avatar Mythra commented on August 26, 2024

I disabled mfa and used autotoken, and it looks like it actually wanted the percent encoded value for me, and not the non-percent encoded value.

from irc-slack.

insomniacslk avatar insomniacslk commented on August 26, 2024

@securityinsanity I have implemented MFA support in autotoken in #131 . Just call autotoken with -mfa <your auth code>. If it doesn't work, there is another new flag, -show-browser that can be used to debug it. Hope that helps!

from irc-slack.

emersion avatar emersion commented on August 26, 2024

I can confirm the cookie value needs to be percent-encoded, or otherwise causes an auth failure.

from irc-slack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.