|
2 | 2 |
|
3 | 3 | This set of modules are meant for targetting Azure AD data. Each module will output a set of data files for further analysis. Support is provided for bloodhound compatible data files in each module. Microsoft is deprecating the use of the Azure AD Graph API on June 30 2022. So, these modules are not going to use any of the now deprecated API calls. Rather, they will be using other available APIs including the currently supported Microsoft Graph API. |
4 | 4 |
|
5 | | -## get_groups.py |
| 5 | +## General Functionality |
6 | 6 |
|
7 | | -This module uses the Microsoft Graph API to request all groups present within Azure AD. It requires an ms_graph token or a refresh token to be supplied as an argument, or a refresh token supplied as an environment variable `REFRESH_TOKEN`. This module will output a condensed set of results to stdout. Additionally, the module will create three data files. One condensed data json file, one raw json output file, and one file compatible for use with BloodHound. |
| 7 | +Each of these modules will output a set of files. All include a raw json response file and a bloodhound compatible json file. Some include a condensed json output file. Usage of these modules is flexible. You may supply the required access token, or a refresh token via script arguments. You may also define an envrionment variable that contains a refresh token. This is the recommended way, and each module will handle the token requests to get the appropriate access token type. |
8 | 8 |
|
9 | | -## get_users.py |
| 9 | +## Installation |
10 | 10 |
|
11 | | -This module uses the Microsoft Graph API to request all users present within Azure AD. It requires an ms_graph token or a refresh token to be supplied as an argument, or a refresh token supplied as an environment varialbe `REFRESH_TOKEN`. This module will output a condensed set of results to stdout. Additionally, the module will create three data files. One condensed data json file, one raw json output file, and one file compatible for use with BloodHound. |
| 11 | +```bash |
| 12 | +git clone https://github.com/blacklanternsecurity/offensive-azure.git |
| 13 | +cd ./offensive-azure/Azure_AD/ |
| 14 | +pipenv shell |
| 15 | +pip install -r requirements.txt |
| 16 | +``` |
12 | 17 |
|
13 | | -The module attempts to pull all available properties as defined in the Microsoft Graph documentation, not just the default properties. |
| 18 | +## get_vms Usage |
14 | 19 |
|
15 | | -## get_tenant.py |
| 20 | +```bash |
| 21 | +usage: get_vms.py [-t|--arm_token <arm_token>] [-r|--refresh_token <refresh_token>] |
16 | 22 |
|
17 | | -This module uses a combination of access token and public endpoints to gather the tenant ID and tenant name (Federation Brand Name). It requires that an access token or a refresh token is supplied as arguments. If neither are supplied, the module will also check for the `REFRESH_TOKEN` variable and use it to request a valid access token. |
| 23 | + ========================================================== |
| 24 | + # # |
| 25 | + # Uses Azure Resource Management API to pull a full # |
| 26 | + # list of virtual machines. # |
| 27 | + # # |
| 28 | + # If no ARM token or refresh_token is supplied, # |
| 29 | + # module will look in the REFRESH_TOKEN environment # |
| 30 | + # variable and request the ARM token # |
| 31 | + # # |
| 32 | + # Outputs a raw json output file, and a json file # |
| 33 | + # compatible with BloodHound # |
| 34 | + # # |
| 35 | + ========================================================== |
18 | 36 |
|
19 | | -The module will output two data files. One text file containing the tenant ID and tenant name. Second a JSON file compatible for use with BloodHound. |
| 37 | +optional arguments: |
| 38 | + -h, --help show this help message and exit |
| 39 | + -t <arm_token>, --arm_token <arm_token> |
| 40 | + The ARM token you would like to use |
| 41 | + -r <refresh_token>, --refresh_token <refresh_token> |
| 42 | + The refresh token you would like to use |
| 43 | + -R <refresh_token_file>, --refresh_token_file <refresh_token_file> |
| 44 | + A JSON file saved from token_juggle.py containing the refresh token you would like to use. |
| 45 | + -o <path>, --outfile_path <path> |
| 46 | + The path of where you want the virtual machine data saved. If not supplied, module defaults to the current directory. |
| 47 | +``` |
20 | 48 |
|
21 | | -## Installation |
| 49 | +## get_resource_groups Usage |
22 | 50 |
|
23 | 51 | ```bash |
24 | | -git clone https://github.com/blacklanternsecurity/offensive-azure.git |
25 | | -cd ./offensive-azure/Azure_AD/ |
26 | | -pipenv shell |
27 | | -pip install -r requirements.txt |
| 52 | +usage: get_resource_groups.py [-t|--arm_token <arm_token>] [-r|--refresh_token <refresh_token>] |
| 53 | + |
| 54 | + ========================================================== |
| 55 | + # # |
| 56 | + # Uses Azure Resource Management API to pull a full # |
| 57 | + # list of resource groups. # |
| 58 | + # # |
| 59 | + # If no ARM token or refresh_token is supplied, # |
| 60 | + # module will look in the REFRESH_TOKEN environment # |
| 61 | + # variable and request the ARM token # |
| 62 | + # # |
| 63 | + # Outputs a raw json output file, and a json file # |
| 64 | + # compatible with BloodHound # |
| 65 | + # # |
| 66 | + ========================================================== |
| 67 | + |
| 68 | +optional arguments: |
| 69 | + -h, --help show this help message and exit |
| 70 | + -t <arm_token>, --arm_token <arm_token> |
| 71 | + The ARM token you would like to use |
| 72 | + -r <refresh_token>, --refresh_token <refresh_token> |
| 73 | + The refresh token you would like to use |
| 74 | + -R <refresh_token_file>, --refresh_token_file <refresh_token_file> |
| 75 | + A JSON file saved from token_juggle.py containing the refresh token you would like to use. |
| 76 | + -o <path>, --outfile_path <path> |
| 77 | + The path of where you want the resource group data saved. If not supplied, module defaults to the current directory. |
| 78 | +``` |
| 79 | + |
| 80 | +## get_subscriptions Usage |
| 81 | + |
| 82 | +```bash |
| 83 | +usage: get_subscriptions.py [-t|--arm_token <arm_token>] [-r|--refresh_token <refresh_token>] |
| 84 | + |
| 85 | + ========================================================== |
| 86 | + # # |
| 87 | + # Uses Azure Resource Management API to pull a full # |
| 88 | + # list of subscriptions. # |
| 89 | + # # |
| 90 | + # If no ARM token or refresh_token is supplied, # |
| 91 | + # module will look in the REFRESH_TOKEN environment # |
| 92 | + # variable and request the ARM token # |
| 93 | + # # |
| 94 | + # Outputs condensed results in a text file, a raw json # |
| 95 | + # output file, and a json file compatible with # |
| 96 | + # BloodHound # |
| 97 | + # # |
| 98 | + ========================================================== |
| 99 | + |
| 100 | +optional arguments: |
| 101 | + -h, --help show this help message and exit |
| 102 | + -t <arm_token>, --arm_token <arm_token> |
| 103 | + The ARM token you would like to use |
| 104 | + -r <refresh_token>, --refresh_token <refresh_token> |
| 105 | + The refresh token you would like to use |
| 106 | + -R <refresh_token_file>, --refresh_token_file <refresh_token_file> |
| 107 | + A JSON file saved from token_juggle.py containing the refresh token you would like to use. |
| 108 | + -o <path>, --outfile_path <path> |
| 109 | + The path of where you want the subscription data saved. If not supplied, module defaults to the current directory. |
| 110 | +``` |
| 111 | + |
| 112 | +## get_group_members Usage |
| 113 | + |
| 114 | +```bash |
| 115 | +usage: get_group_members.py [-t|--graph_token <graph_token>] [-r|--refresh_token <refresh_token>] |
| 116 | + |
| 117 | + ========================================================== |
| 118 | + # # |
| 119 | + # Uses the Microsoft Graph API to pull a full list of # |
| 120 | + # user group membership details. # |
| 121 | + # # |
| 122 | + # If no ms_graph token or refresh_token is supplied, # |
| 123 | + # module will look in the REFRESH_TOKEN environment # |
| 124 | + # variable and request the ms_graph token # |
| 125 | + # # |
| 126 | + # Outputs condensed results in a text file, a raw json # |
| 127 | + # output file, and a json file compatible with # |
| 128 | + # BloodHound # |
| 129 | + # # |
| 130 | + ========================================================== |
| 131 | + |
| 132 | +optional arguments: |
| 133 | + -h, --help show this help message and exit |
| 134 | + -t <graph_token>, --graph_token <graph_token> |
| 135 | + The ms_graph token you would like to use |
| 136 | + -r <refresh_token>, --refresh_token <refresh_token> |
| 137 | + The refresh token you would like to use |
| 138 | + -R <refresh_token_file>, --refresh_token_file <refresh_token_file> |
| 139 | + A JSON file saved from token_juggle.py containing the refresh token you would like to use. |
| 140 | + -o <path>, --outfile_path <path> |
| 141 | + The path of where you want the group membership data saved. If not supplied, module defaults to the current directory. |
28 | 142 | ``` |
29 | 143 |
|
30 | 144 | ## get_groups Usage |
|
0 commit comments