mxrch / GHunt

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

Maps reviews retrieval is failing #526

Closed micduffy closed 1 month ago

micduffy commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Install and configure latest Ghunt
  2. run an email analysis
  3. See error

Expected behavior Expecting it to run to completion

Screenshots If applicable, add screenshots to help explain your problem. 🎮 Play Games data

[-] No player profile found.

🗺️ Maps data Traceback (most recent call last): File "/home/mike/.local/bin/ghunt", line 8, in sys.exit(main()) File "/home/mike/.local/lib/python3.10/site-packages/ghunt/ghunt.py", line 18, in main parse_and_run() File "/home/mike/.local/lib/python3.10/site-packages/ghunt/cli.py", line 55, in parse_and_run process_args(args) File "/home/mike/.local/lib/python3.10/site-packages/ghunt/cli.py", line 65, in process_args asyncio.run(email.hunt(None, args.email_address, args.json)) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/mike/.local/lib/python3.10/site-packages/ghunt/modules/email.py", line 117, in hunt err, stats, reviews, photos = await gmaps.get_reviews(as_client, target.personId) File "/home/mike/.local/lib/python3.10/site-packages/ghunt/helpers/gmaps.py", line 56, in get_reviews data = json.loads(req.text[5:]) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

System (please complete the following information):

Additional context Add any other context about the problem here. Seems to be related to the get_reviews call - perhaps the url has changed ? It currently returns a 302 return code.

Navitas28 commented 1 month ago

Yes similar issue here Screenshot 2024-09-07 at 16 45 43

The retrieval at line 56 of gmaps.py returns status_code = 302 so the URL has changed

We need to update the

req = await as_client.get(f"https://www.google.com/locationhistory/preview/mas?authuser=0&hl=en&gl=us&pb={gb.config.templates['gmaps_pb']['stats'].format(gaia_id)}")

to new reloacted URL I think

@micduffy any luck finding the solution ?

micduffy commented 1 month ago

I dont think this is an easy fix, as I go to https://www.google.com/maps/contrib/XYZ/reviews

where XYZ is a GAIA id. This firstly CAPTCHAS me but even after that, all reviews data is transferred in what appears to be a binary format - perhaps WASM blobs.

The above, coupled with locationhistory being removed from web channels makes be believe that there may not be a fix for this.

micduffy commented 1 month ago

So I found out that the retrieval fails on calculating the cost statistics so I changed line 333 of gmaps.py from

        costs_stats[review.location.cost_level] += 1

to costs_stats[1] += 1

As I dont need the cost analysis for my purposes, then I just bypassed it.

Most likely the location.cost or location.cost_level has changed.

Hope this helps

pegaggio commented 1 month ago

This did not fix it for me, I still got the same error mentioned in the original post. However, I did try the url that ghunt attempted on an older, much more used account (completely separate from my ghunt only account) and it did work. I believe the problem is the same as the "KeyError: 'people'" one. Google looking at various statistics of an account and rate-limiting it based on the calculated legitimacy.