mxrch / GHunt

🕵️‍♂️ Offensive Google framework.
Other
15.65k stars 1.3k forks source link

Invalid cookies at login #456

Closed XFORWORKS closed 9 months ago

XFORWORKS commented 1 year ago

Describe the bug A new bug from httpx disables the feature of using the script and adding new cookies.

To Reproduce Just type the command "ghunt login" and try to add new cookies.

Expected behavior It says it received the cookies but no matter the account I use, they are always invalid (I know it's a problem with the script because the same account I used, worked in the past for me). The expected behavior is for it to work.

Screenshots ghunt1

System (please complete the following information):

Additional context Before I reinstalled GHunt, I had the message : <UserWarning: Unclosed <httpx.AsyncClient object at 0x7f7425f99390> If I could I would gladly send a picture again, but the message stopped showing after I reinstalled GHunt with pip3.

esidate commented 1 year ago

I have the same issue

frHaKtal commented 1 year ago

idem for me... :-(

mxrch commented 1 year ago

Only time I had this error recently was when I was "connected" at multiple accounts on the same browser (you know, when you switch between accounts etc, Google makes you easily to switch between them), so I cleared cookies, re-tried and it worked. Can someone who have this error try this ?

mxrch commented 1 year ago

This is not an error of which I know how to reproduce 100% of the time, so it makes it difficult to fix.

esidate commented 1 year ago

@mxrch You're right. I removed the other gmail accounts leaving only one and it worked. I might do a pull request soon to fix this. Thank you.

XFORWORKS commented 1 year ago

And hopefully, that's soon.

micduffy commented 1 year ago

Confirmed also for me, that having a browser with multiple accounts caused this issue. Switching to a browser with only one account attached to it resolved the issue for me.

mxrch commented 1 year ago

I start to get the issue too, so I can investigate For a temporary workaround, go on https://accounts.google.com/robots.txt, clear your cookies and retry to login with the extension

CreedoW commented 1 year ago

I start to get the issue too, so I can investigate For a temporary workaround, go on https://accounts.google.com/robots.txt, clear your cookies and retry to login with the extension

Just get firefox or other browser, install the extension, login with google then use it. Simple as that and u don't have to login again on ur main browser !

mxrch commented 1 year ago

I start to get the issue too, so I can investigate For a temporary workaround, go on https://accounts.google.com/robots.txt, clear your cookies and retry to login with the extension

Just get firefox or other browser, install the extension, login with google then use it. Simple as that and u don't have to login again on ur main browser !

Ok thanks I will try it (joking I'm the developer)

v9lu commented 1 year ago

I was have same issue, use Firefox instead of Chrome helps me

XFORWORKS commented 1 year ago

Likewise, it did in fact help.

ubranch commented 1 year ago

same, latest firefox

diehard88 commented 1 year ago

Only time I had this error recently was when I was "connected" at multiple accounts on the same browser (you know, when you switch between accounts etc, Google makes you easily to switch between them), so I cleared cookies, re-tried and it worked. Can someone who have this error try this ?

bingo! worked here.

pip-ru commented 11 months ago

I have a slightly different issue, and it's not related to where I obtain cookies. I'm using the Mozilla browser, and the cookies have been cleared. They are valid on the second server but not on the first one. I've tried various options, but the result is zero. Below, I'm providing information from the terminal. As you can see, it says, "The cookies seem valid" and "Got OAuth2 token." I've established a connection with the account, and I've received the name and email address. However, then some magic happens, and I end up with a KeyError: 'SIDCC.' What could be the cause? Linux 6.1.42 Python 3.10.0

PS: The email address, account name, servers, and token mentioned below have been altered)

[+] The cookies seems valid !

[+] Got OAuth2 token => oauth2_4/0AfJohXn76B6brtOCpK6udfP7FL-Lxim0OL7oQTxX_KrtoI3UNrWNMc9aqDEP5Vyb_PHYtg

[Connected account] Name : Sergo Danse Email : sergodanse777@gmail.com

🔑 A master token has been generated for your account and saved in the credentials file, please keep it safe as if it were your password, because it gives access to a lot of Google services, and with that, your personal information. Master token services access : mail, youtube, hist, cl Generating OSIDs ... Traceback (most recent call last): File "/home/bond007/.local/bin/ghunt", line 8, in sys.exit(main()) File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/ghunt.py", line 15, in main parse_and_run() File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/cli.py", line 31, in parse_and_run process_args(args) File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/cli.py", line 38, in process_args trio.run(login.check_and_login, None, args.clean) File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/trio/_core/_run.py", line 1946, in run raise runner.main_task_outcome.error File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/modules/login.py", line 90, in check_and_login ghunt_creds.osids = await gen_osids(cookies, osids) File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/helpers/auth.py", line 77, in gen_osids sample_cookies[cookie] = req.cookies[cookie] File "/home/bond007/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/httpx/_models.py", line 1144, in getitem raise KeyError(name) KeyError: 'SIDCC'

matteovidali commented 11 months ago

Can confirm that this worked for me as well. Initially tried both ways, got invalid cookie error, clearing cookies generated a valid cookie!

Shion1305 commented 9 months ago

I'm having the invalid cookies issue. I was successful doing this on another device a month ago, however, I'm getting trouble now. I have tried on both Firefox and Chrome with clearing all cookies on browser, but keep getting invalid cookies.

I have been messing around with Google authentication page on the beginning of the year, noticed some changes. I think this issue can be related to the update.

Shion1305 commented 9 months ago

Confirmed the report on the same situation on #476 . I suggest this issue be closed.