facebook-delete icon indicating copy to clipboard operation
facebook-delete copied to clipboard

Add support for 2FA

Open julianxhokaxhiu opened this issue 3 years ago • 7 comments

Hi,

thank you very much for this project. It seems your script is missing 2FA support. Would you be able to add that?

Thank you in advance, Julian

julianxhokaxhiu avatar Sep 14 '20 14:09 julianxhokaxhiu

Hi, I don't have this enabled. It would be great if you could check how the 2FA login works on https://mbasic.facebook.com/. It would be interesting whether the 2FA code is sent via a POST request.

marcelja avatar Sep 14 '20 16:09 marcelja

Hi, I don't have this enabled. It would be great if you could check how the 2FA login works on https://mbasic.facebook.com/. It would be interesting whether the 2FA code is sent via a POST request.

I currently found a way to accomplish the same thing on the new Facebook Layout using Javascript, but as soon as I'm done cleaning up I'll definitely try and let you know :) Cheers!

julianxhokaxhiu avatar Sep 14 '20 17:09 julianxhokaxhiu

Perhaps add a way to use existing browser cookie to be used as login?

r1bnc avatar Sep 16 '21 04:09 r1bnc

Perhaps add a way to use existing browser cookie to be used as login?

I don't think that there's an easy way to get the cookie out of a browser.

marcelja avatar Sep 29 '21 15:09 marcelja

I forgot to reply with my approach, but for anyone curious to know, this is where you can find it: https://gist.github.com/julianxhokaxhiu/f8a2dae96cd0d29277aa5912d0a07f5f

I've used it by the time the Gist was created and it worked successfully, although it might be Facebook did change their HTML so minor adaptations might be required.

julianxhokaxhiu avatar Sep 29 '21 15:09 julianxhokaxhiu

Perhaps add a way to use existing browser cookie to be used as login?

I don't think that there's an easy way to get the cookie out of a browser.

Theres addons/extensions that can dump the cookies off the browser.

r1bnc avatar Sep 30 '21 02:09 r1bnc

Perhaps add a way to use existing browser cookie to be used as login?

I don't think that there's an easy way to get the cookie out of a browser.

Theres addons/extensions that can dump the cookies off the browser.

Nice, I didn't know about that. I just tested it with this extension https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg I went to https://mbasic.facebook.com, used the extension to export the cookie in json format and changed the format to work with the persistent cookiejar.

Here's a small python script which generates the .go-cookies file.

json_to_go_cookie.py

json_string = """
PASTE_JSON_COOKIE_HERE
"""

import json

json_object = json.loads(json_string)
out_json = []
for elem in json_object:
    out_elem = {}
    for key, value in elem.items():
        out_elem[key[0].upper() + key[1:]] = value
    out_elem["Persistent"] = True
    out_elem["CanonicalHost"] = "mbasic.facebook.com"
    out_elem["Domain"] = "facebook.com"
    out_elem["Expires"] = "2099-01-30T00:00:00.000000+00:00"
    out_json.append(out_elem)
print(json.dumps(out_json).replace(' ', ''))

Paste json in the file and run this:

$ python3 json_to_go_cookie.py > ~/.go-cookies

marcelja avatar Sep 30 '21 16:09 marcelja