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

roadrecon gather: Add sanity-check for token resource #111

Open
rgmz opened this issue Jan 17, 2025 · 0 comments
Open

roadrecon gather: Add sanity-check for token resource #111

rgmz opened this issue Jan 17, 2025 · 0 comments

Comments

@rgmz
Copy link

rgmz commented Jan 17, 2025

Description

I foolishly created a token for graph.microsoft.com instead of graph.windows.net. Running roadrecon gather yielded a large number of 401 errors without an obvious cause:

Error 401 for URL https://graph.windows.net/<id>/applications?api-version=1.61-internal&$select=keyCredentials,objectId

Further debugging showed the error as Authentication_MissingOrMalformed, which was confusing because the requests contained an auth token.

{"odata.error":{"code":"Authentication_MissingOrMalformed","codeForMetrics":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access Token missing or malformed."}}}

It took me longer than I'd like to admit to realize my mistake.

Proposed Solution

I have a could ideas to avoid wasting time and sending extraneous requests with an 'invalid' token:

  1. Add a sanity check in run that the token is for graph.windows.net
  2. Update dump_object (or somewhere more appropriate) to treat 401 as a fatal error and cease enumeration.
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

No branches or pull requests

1 participant