Skip to content

Modules: Copilot M365 ‐ Whoami

lanasalameh1 edited this page Aug 7, 2024 · 5 revisions

Description

Extracts useful information about the current user such as:

  1. Name, title, email, manager etc.
  2. Accessible documents
  3. Weekly schedule
  4. Accessible Sharepoint sites
  5. Access to financial data
  6. Emails
  7. Collaborators and Contacts

and more

Usage

powerpwn cli

  • Run the following command:
    powerpwn copilot whoami --user {user} --password {password} --scenario {scenario} --verbose {verbosity level}

The access token is cached in tokens.json local cache file if acquired successfully.

  • Run the whoami command with following arguments to use the cached access token:
    powerpwn copilot whoami --user {user} --cached-token --scenario {scenario} --verbose {verbosity level}

Command Parameters

  • user: The email of the connected user. Required parameter.

  • password: The password of the connected account. Optional parameter.

  • scenario: Copilot application to connect to. 'teamshub' for Teams and 'officeweb' Business Chat web applications. Required parameter.

  • verbose: Verbosity flag for writing logs to a local file with name 'session_{session_id}.log'. Options are 'off', 'mid' and 'full'. Default is 'off'

  • cached-token: If presents in the command arguments, it tries to use the cached access token if exists, otherwise it falls back to user/password authentication if password is provided.

Notice:
All command outputs are saved to 'who_i_am_{random execution GUID}' directory
The final findings will be saved to file 'who_i_am_report.txt'
The execution logs will be saved to file 'who_i_am_debug.log'

python

from powerpwn.copilot.models.chat_argument import ChatArguments
from powerpwn.copilot.enums.copilot_scenario_enum import CopilotScenarioEnum
from powerpwn.copilot.enums.verbose_enum import VerboseEnum
from powerpwn.copilot.whoami.whoami import WhoAmI

args = ChatArguments(
        user="USER",
        password="PASSWORD",
        verbose=VerboseEnum.full,
        scenario=CopilotScenarioEnum.teamshub,
        use_cached_access_token=False
    )

whoami = WhoAmI(args).execute()