GHunt icon indicating copy to clipboard operation
GHunt copied to clipboard

Some organization email queries is causing KeyError: 'people'

Open juhkarh opened this issue 2 years ago • 8 comments

Hi, I found out there is 'feature' like this. Is some knowhow needed or just good old bug?

Input:

ghunt email <some organization | association>@gmail.com

Result:

Traceback (most recent call last):
  File "/root/.local/bin/ghunt", line 8, in <module>
    sys.exit(main())
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/ghunt.py", line 15, in main
    parse_and_run()
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/cli.py", line 31, in parse_and_run
    process_args(args)
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/cli.py", line 41, in process_args
    trio.run(email.hunt, None, args.email_address, args.json)
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/trio/_core/_run.py", line 1946, in run
    raise runner.main_task_outcome.error
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/modules/email.py", line 31, in hunt
    is_found, target = await people_pa.people_lookup(as_client, email_address, params_template="max_details")
  File "/root/.local/pipx/venvs/ghunt/lib/python3.10/site-packages/ghunt/apis/peoplepa.py", line 103, in people_lookup
    person_data = list(data["people"].values())[0]
KeyError: 'people'

OS:

  • Docker container - base image python:3.10

I cannot give a email for testing.. OPSEC 😉

juhkarh avatar Sep 27 '23 19:09 juhkarh

its a bug in the script, examine the code of the ghunt script to identify and fix the issue.

bhavna3 avatar Sep 29 '23 12:09 bhavna3

It might be possible that there was some authentication problems in background.

juhkarh avatar Sep 29 '23 12:09 juhkarh

@pranali18-Ai wtf is that useless ChatGPT reply

mxrch avatar Oct 11 '23 11:10 mxrch

Did you guys find a fix for it? I am facing the same problem.

JINN031 avatar Nov 08 '23 08:11 JINN031

Did you guys find a fix for it? I am facing the same problem.

I haven't had time for this. But maybe someone can add some try..except logic around this person_data = list(data["people"].values())[0]. Its very error prone to make this kind of assumptions in code that is consuming external api.

juhkarh avatar Nov 08 '23 13:11 juhkarh

{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}

and the argument you must crop from the request is :

https://github.com/mxrch/GHunt/blob/7042aa0f4664b273e6f8748710c0b8d06890934c/ghunt/apis/peoplepa.py#L60 "GPLUS_ADDITIONAL_DATA"

eqa avatar Nov 08 '23 13:11 eqa

Google invalided the GPLUS_ADDITIONAL_DATA param, please pipx upgrade ghunt :)

mxrch avatar Nov 08 '23 13:11 mxrch

Google invalided the GPLUS_ADDITIONAL_DATA param, please pipx upgrade ghunt :)

please tell me what this parameter was responsible for? What information are we now deprived of?

iKey-333 avatar Nov 09 '23 14:11 iKey-333

KeyError: 'people' This error was fixed in latest release. It was about changes at Google side.

juhkarh avatar Jan 19 '24 10:01 juhkarh