-
Notifications
You must be signed in to change notification settings - Fork 14
Usage
This page documents the available arguments and switches for Graphpython.
usage: Graphpython [-h] [--command COMMAND] [--list-commands] [--token TOKEN] [--estsauthcookie ESTSAUTHCOOKIE] [--use-cae] [--cert CERT]
[--domain DOMAIN] [--tenant TENANT] [--username USERNAME] [--secret SECRET] [--id ID] [--select SELECT] [--query QUERY]
[--search SEARCH] [--entity {driveItem,message,chatMessage,site,event}] [--device {Mac,Windows,AndroidMobile,iPhone}]
[--browser {Android,IE,Chrome,Firefox,Edge,Safari}] [--only-return-cookies]
[--mail-folder {Allitems,inbox,archive,drafts,sentitems,deleteditems,recoverableitemsdeletions}] [--top TOP]
[--script SCRIPT] [--email EMAIL]
examples:
Graphpython --command invoke-reconasoutsider --domain company.com
Graphpython --command invoke-userenumerationasoutsider --username <email@company.com/emails.txt>
Graphpython --command get-graphtokens --use-cae
Graphpython --command invoke-refreshtoazuremanagementtoken --tenant <tenant-id> --token refresh-token --use-cae
Graphpython --command get-users --token eyJ0... -- select displayname,id [--id <userid>]
Graphpython --command list-recentonedrivefiles --token token
Graphpython --command invoke-search --search "credentials" --entity driveItem --token token
Graphpython --command invoke-customquery --query https://graph.microsoft.com/v1.0/sites/{siteId}/drives --token token
Graphpython --command assign-privilegedrole --token token
Graphpython --command spoof-owaemailmessage [--id <userid to spoof>] --token token --email email-body.txt
Graphpython --command get-manageddevices --token intune-token
Graphpython --command deploy-maliciousscript --script malicious.ps1 --token token
Graphpython --command backdoor-script --id <scriptid> --script backdoored-script.ps1 --token token
Graphpython --command add-exclusiongrouptopolicy --id <policyid> --token token
Graphpython --command reboot-device --id <deviceid> --token eyj0...
-
-h, --help
- Show the help message and exitGraphpython -h
-
--command COMMAND
- Specify the command to executeGraphpython --command list-users
-
--list-commands
- List all available commandsGraphpython --list-commands
-
--token TOKEN
- Provide a Microsoft Graph access token or refresh token for FOCI abuseGraphpython --token YOUR_ACCESS_TOKEN
-
--estsauthcookie ESTSAUTHCOOKIE
- Use 'ESTSAuth' or 'ESTSAuthPersistent' cookieGraphpython --estsauthcookie YOUR_COOKIE
-
--use-cae
- Enable Continuous Access Evaluation (CAE). This adds 'cp1' as a client claim to obtain an access token valid for 24 hoursGraphpython --use-cae
-
--username USERNAME
- Provide a username or a file containing usernames for user enumeration as an outsiderGraphpython --username user@example.com
-
--cert CERT
- Path to an X509Certificate (.pfx file)Graphpython --cert /path/to/certificate.pfx
-
--domain DOMAIN
- Specify the target domainGraphpython --domain example.com
-
--tenant TENANT
- Specify the target tenant IDGraphpython --tenant YOUR_TENANT_ID
-
--secret SECRET
- Enterprise application secret for accessing tokens (used withinvoke-appsecrettoaccesstoken
command)Graphpython --secret YOUR_SECRET
-
--id ID
- ID of the target objectGraphpython --id OBJECT_ID
-
--select SELECT
- Specify fields to select from the outputGraphpython --select id,displayName
-
--query QUERY
- Raw API query URL (GET only)Graphpython --query https://graph.microsoft.com/v1.0/users
-
--search SEARCH
- Search string for queryingGraphpython --search "John Doe"
-
--entity {driveItem,message,chatMessage,site,event}
- Specify the type of entity to search for:-
driveItem
: OneDrive items -
message
: Mail messages -
chatMessage
: Teams chat messages -
site
: SharePoint sites -
event
: Calendar events
Graphpython --entity message
-
-
--device {Mac,Windows,AndroidMobile,iPhone}
- Specify the device type for User-Agent forgingGraphpython --device Windows
-
--browser {Android,IE,Chrome,Firefox,Edge,Safari}
- Specify the browser type for User-Agent forgingGraphpython --browser Chrome
-
--only-return-cookies
- Only return cookies from the request (used withopen-owamailboxinbrowser
command)Graphpython --only-return-cookies
-
--mail-folder {Allitems,inbox,archive,drafts,sentitems,deleteditems,recoverableitemsdeletions}
- Specify the mail folder to dump using thedump-owamailbox
commandGraphpython --mail-folder inbox
-
--top TOP
- Number of messages to retrieve (integer)Graphpython --top 50
-
--script SCRIPT
- File containing the script content fordeploy-maliciousscript
orbackdoor-script
Graphpython --script /path/to/script.ps1
-
--email EMAIL
- File containing OWA email message body content forspoof-owaemailmessage
Graphpython --email /path/to/email.txt