Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work!( #492

Open
cryptobesikairdrops01 opened this issue Jan 25, 2024 · 10 comments · May be fixed by #493
Open

Doesn't work!( #492

cryptobesikairdrops01 opened this issue Jan 25, 2024 · 10 comments · May be fixed by #493

Comments

@cryptobesikairdrops01
Copy link

After installation as written in the manual and at startup - errors are displayed and won't start! Doesn't work!(
Screenshot_2

@shion1305
Copy link

Hi,
I've looked into the problem and found that some exceptions are not handled correctly.
It looks like GHunt failed to handle GHuntAndroidAppOAuth2Error in the following code.

try:
ghunt_creds = await auth.load_and_auth(as_client, help=False)
except GHuntInvalidSession as e:
print(f"[-] {e}\n")
is_session_valid = False

I'll make a PR that fixes this part.

@shion1305 shion1305 linked a pull request Jan 26, 2024 that will close this issue
@mxrch
Copy link
Owner

mxrch commented Jan 26, 2024

Hi, I've looked into the problem and found that some exceptions are not handled correctly. It looks like GHunt failed to handle GHuntAndroidAppOAuth2Error in the following code.

try:
ghunt_creds = await auth.load_and_auth(as_client, help=False)
except GHuntInvalidSession as e:
print(f"[-] {e}\n")
is_session_valid = False

I'll make a PR that fixes this part.

@shion1305 the GHuntAndroidAppOAuth2Error already abstracts the error, and it means what the errors means, that the OAuth2 connection failed. We'll not abstract an abstraction.
The real issue here is that the OAuth2 connection failed, but I can't help with that because I can't reproduce and never had this issue.

@cryptobesikairdrops01 Can you retry with another Google account ?

@shion1305
Copy link

@mxrch
I think he is saying that he cannot enter login option selection, because ghunt login keeps failing before he can select an authentication method.

I don't think GHuntInvalidSession will handle GHuntAndroidAppOAuth2Error, as the definitions of GHuntInvalidSession and GHuntAndroidAppOAuth2Error are the following...

GHunt/ghunt/errors.py

Lines 31 to 41 in f37efa4

class GHuntAndroidAppOAuth2Error(BaseException):
pass
class GHuntOSIDAuthError(BaseException):
pass
class GHuntCredsNotLoaded(BaseException):
pass
class GHuntInvalidSession(BaseException):
pass

In fact, if you change the code as follows, python main.py login will always fail.

    try:
        ghunt_creds = await auth.load_and_auth(as_client, help=False)
        raise GHuntAndroidAppOAuth2Error("!!!!!!!!!!!!!")
    except GHuntInvalidSession as e:
        print(f"[-] {e}\n")
        is_session_valid = False

image

I've confirmed the fix in #493 , plz check it 🙏

@mxrch
Copy link
Owner

mxrch commented Jan 26, 2024

I really think that's the an error related to the Google Account, not GHunt.

In fact, the master token can expire if you change the password. @cryptobesikairdrops01 is it the case ?
Also, can you can try ghunt login --clean and re-login ?

@shion1305
Copy link

shion1305 commented Jan 26, 2024

@mxrch You're right that the error is due to the Google Account, but I'm saying that users should be able to know the cause and recover from it easily, though GHunt should handle the error and let user know what is the problem.

In @cryptobesikairdrops01 case, running GHunt login leads to an error that prevents further authentication steps, and is it difficult for users to know that they should use --clean option.

To make it more user-friendly, I've submitted PR #494 , proposing a way to handle errors that guides users to re-authenticate instead of abruptly stopping the program.

Thanks for considering my suggestion.

@cryptobesikairdrops01
Copy link
Author

I really think that's the an error related to the Google Account, not GHunt.

In fact, the master token can expire if you change the password. @cryptobesikairdrops01 is it the case ? Also, can you can try ghunt login --clean and re-login ?

@mxrch You're right that the error is due to the Google Account, but I'm saying that users should be able to know the cause and recover from it easily, though GHunt should handle the error and let user know what is the problem.

In @cryptobesikairdrops01 case, running GHunt login leads to an error that prevents further authentication steps, and is it difficult for users to know that they should use --clean option.

To make it more user-friendly, I've submitted PR #494 , proposing a way to handle errors that guides users to re-authenticate instead of abruptly stopping the program.

Thanks for considering my suggestion.

Thank you! It worked.

@cryptobesikairdrops01
Copy link
Author

I didn't know about the --clean option.
Thank you!

@albotroz
Copy link

albotroz commented Mar 8, 2024

It is still not working for me.
Ghunt only worked very briefly (1-2 days) about a week ago and has not been usable since then because error messages are constantly being displayed. Even with the update.

@mxrch
Copy link
Owner

mxrch commented Mar 8, 2024

It is still not working for me.
Ghunt only worked very briefly (1-2 days) about a week ago and has not been usable since then because error messages are constantly being displayed. Even with the update.

Even with the latest update, from yesterday ?

@albotroz
Copy link

albotroz commented Mar 8, 2024

It is still not working for me.
Ghunt only worked very briefly (1-2 days) about a week ago and has not been usable since then because error messages are constantly being displayed. Even with the update.

Even with the latest update, from yesterday ?

yes.

🎉 You are up to date !

[+] Stored session loaded !
[+] Authenticated !

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\users\sdf\.local\bin\ghunt.exe\__main__.py", line 7, in <module>
  File "C:\Users\sdf\AppData\Local\pipx\pipx\venvs\ghunt\Lib\site-packages\ghunt\ghunt.py", line 18, in main
    parse_and_run()
  File "C:\Users\sdf\AppData\Local\pipx\pipx\venvs\ghunt\Lib\site-packages\ghunt\cli.py", line 31, in parse_and_run
    process_args(args)
  File "C:\Users\sdf\AppData\Local\pipx\pipx\venvs\ghunt\Lib\site-packages\ghunt\cli.py", line 41, in process_args
    asyncio.run(email.hunt(None, args.email_address, args.json))
  File "C:\Users\sdf\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\sdf\Python\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\sdf\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\sdf\AppData\Local\pipx\pipx\venvs\ghunt\Lib\site-packages\ghunt\modules\email.py", line 24, in hunt
    is_found, target = await people_pa.people_lookup(as_client, email_address, params_template="max_details")
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\sdf\AppData\Local\pipx\pipx\venvs\ghunt\Lib\site-packages\ghunt\apis\peoplepa.py", line 103, in people_lookup
    person_data = list(data["people"].values())[0]
                       ~~~~^^^^^^^^^^
KeyError: 'people'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants