Open ranlo opened 11 months ago
I also have a similar issue. I had this issue with both the previous version of GHunt but also the newest one.
Describe the bug While running the code below in PyCharm, I get the error: hunt.errors.GHuntOSIDAuthError: [-] No OSID header detected, exiting...
Code used: import asyncio import base64 from ghunt.helpers.utils import * from ghunt.modules import login
async def main(): try: print("hi2") async with httpx.AsyncClient() as client: await login.check_and_login(client, clean=False) except Exception as e: print(f"Error: {e}")
asyncio.run(main())
Screenshots/Code Output: hi2 [-] No stored session found.
You can facilitate configuring GHunt by using the GHunt Companion extension on Firefox, Chrome, Edge and Opera here : => https://github.com/mxrch/ghunt_companion
[1] (Companion) Put GHunt on listening mode (currently not compatible with docker) [2] (Companion) Paste base64-encoded authentication [3] Enter the oauth_token (stats with "oauth2_4/") [4] Enter the master token (starts with "aas_et/") Choice => 2 Paste the encoded credentials here => {deducted_base64_cookies}
[+] Got OAuth2 token => oauth2_4/{deducted_oath_token}
[Connected account] Name : {deducted_name} Email : {deducted_email}
🔑 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, hist, youtube, dynamite, local Generating cookies and osids...
[+] New token for chrome has been generated cookies in gen_cookies_and_osids: { 'SID': 'deducted', 'Secure-1PSID': 'deducted', 'Secure-3PSID': 'deducted', 'HSID': 'deducted', 'SSID': 'deducted', 'APISID': 'deducted', 'SAPISID': 'deducted', 'Secure-1PAPISID': 'deducted', 'Secure-3PAPISID': 'deducted', 'NID': 'deducted', 'LSID': 'deducted', 'Host-1PLSID': 'deducted', 'Host-3PLSID': 'deducted', 'ACCOUNT_CHOOSER': 'deducted', 'Host-GAPS': 'deducted' } osids in gen_cookies_and_osids: ['cloudconsole', 'cl'] req text: cookies: { 'SID': 'deducted', 'Secure-1PSID': 'deducted', 'Secure-3PSID': 'deducted', 'HSID': 'deducted', 'SSID': 'deducted', 'APISID': 'deducted', 'SAPISID': 'deducted', 'Secure-1PAPISID': 'deducted', 'Secure-3PAPISID': 'deducted', 'NID': 'deducted', 'LSID': 'deducted', 'Host-1PLSID': 'deducted', 'Host-3PLSID': 'deducted', 'ACCOUNT_CHOOSER': 'deducted', 'Host-GAPS': 'deducted' }
params: {} req text: cookies: { 'SID': 'deducted', 'Secure-1PSID': 'deducted', 'Secure-3PSID': 'deducted', 'HSID': 'deducted', 'SSID': 'deducted', 'APISID': 'deducted', 'SAPISID': 'deducted', 'Secure-1PAPISID': 'deducted', 'Secure-3PAPISID': 'deducted', 'NID': 'deducted', 'LSID': 'deducted', 'Host-1PLSID': 'deducted', 'Host-3PLSID': 'deducted', 'ACCOUNT_CHOOSER': 'deducted', '__Host-GAPS': 'deducted' } params: {} https://console.cloud.google.com/accounts/SetOSID req text(osid): < h1 >Unauthorized < h2 >Error 401
req.cookies: <Cookies[]>
Traceback (most recent call last):
File "C:\Users{deducted}\PycharmProjects{deducted_test_project}\new_effort.py", line 92, in
Process finished with exit code 1
System (please complete the following information):
Windows 10 Python 3.11 (Pycharm environment) ghunt 2.1.3
https://console.cloud.google.com/accounts/SetOSID req text(osid): < h1 >Unauthorized < h2 >Error 401
Please check that: Params output is empty req text output is empty or brings out the 401 message from server
Describe the bug Getting an exception while trying to login
No OSID header detected, exiting
Traceback (most recent call last): File "/Users/root/.local/bin/ghunt", line 8, in
sys.exit(main())
^^^^^^
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/ghunt/ghunt.py", line 15, in main
parse_and_run()
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/ghunt/cli.py", line 31, in parse_and_run
process_args(args)
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/ghunt/cli.py", line 38, in process_args
trio.run(login.check_and_login, None, args.clean)
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/trio/_core/_run.py", line 1946, in run
raise runner.main_task_outcome.error
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/ghunt/modules/login.py", line 90, in check_and_login
ghunt_creds.osids = await gen_osids(cookies, osids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/root/.local/pipx/venvs/ghunt/lib/python3.11/site-packages/ghunt/helpers/auth.py", line 92, in gen_osids
raise GHuntOSIDAuthError("[-] No OSID header detected, exiting...")
Screenshots the call to console.cloud.google.com returns this
400. That’s an error.
The server cannot process the request because it is malformed. It should not be retried. That’s all we know.