ROADtools Framework

repository·master·Indexed 25 days ago

https://github.com/dirkjanm/roadtools

A framework for interacting with Azure AD consisting of three main components: ROADlib (a core library with an automatically generated database model), ROADrecon (an exploration tool for Red and Blue Team analysis that dumps graph information into an SQLAlchemy-backed database with an Angular GUI), and roadtx (a tool for exchanging and using Azure AD issued tokens). It also includes roadoidc, a collection of scripts for hosting an OIDC provider to act as an External Authentication Method (EAM) in Entra ID.

Tokens
10.9K
Snippets
11
Records
83
Agent score
83%

What's inside ROADtools

  1. Overview of ROADtools framework

    master

    ROADtools (Rogue Office 365 and Azure (active) Directory tools) is a framework for interacting with Azure AD. It consists of three main components:

    1. ROADlib: A core library containing common components and an automatically generated database model based on Azure AD internal API metadata.
    2. ROADrecon: An Azure AD exploration tool used for Red and Blue Team analysis. It dumps Azure AD graph information into an SQLAlchemy-backed database and provides an Angular-based GUI for analysis.
    3. roadtx (ROADtools Token eXchange): A tool for exchanging and using various Azure AD issued tokens, supporting multiple authentication flows, device registration, and PRT operations.
  2. Develop the ROADrecon Angular front-end

    master

    To modify the Angular frontend, you need node and npm installed. Follow these steps to set up the development environment:

    1. Clone the repository.
    2. Install roadlib and roadrecon in editable mode.
    3. Install npm dependencies in the frontend directory.

    To run the frontend locally, use npm start or ng serve from the roadrecon/frontend/ directory. To build the JavaScript files into the dist_gui directory, use npm run build.

    git clone https://github.com/dirkjanm/roadtools.git
    pip install -e roadlib/
    pip install -e roadrecon/
    cd roadrecon/frontend/
    npm install
  3. Use roadoidc as an External Authentication Method (EAM)

    master

    roadoidc can act as an EAM in Entra ID to bypass MFA in lab environments. This requires hosting roadoidc as an Azure App Service (not static files) and including the --eam flag during configuration generation with genconfig.py.

    Entra ID Configuration Steps:

    1. App Registration: Create an app registration and add the roadoidc redirect URL (the issuer URL + /eam/authorize) as a redirect URI. Ensure openid and profile permissions are granted and consented.
    2. Add External Method: In Entra ID (Security -> Authentication methods -> Policies -> Add external method):
      • Name: Any name.
      • Client ID: A random GUID.
      • Discovery Endpoint: The issuer URL + /eam/.well-known/openid-configuration.
      • App ID: The Client ID of the app registration created in step 1.
    3. Scope: Assign the EAM to specific users or groups.
  4. Install roadoidc

    master

    roadoidc is provided as a collection of scripts rather than a standalone package. To install, clone the ROADtools repository and install roadlib and roadtx from the local directories to ensure you have the latest versions. Alternatively, you can install the dependencies via requirements.txt located in the roadoidc directory.

    git clone https://github.com/dirkjanm/ROADtools
    cd ROADtools/
    pip install roadlib/
    pip install roadtx/
    cd roadoidc
  5. Install ROADrecon

    master

    ROADrecon requires Python 3.10 or newer. You can install it using one of the following methods:

    Via PyPI (Stable):

    pip install roadrecon

    Via GitHub (Latest/Manual): If installing from a cloned repository or downloaded build files, you must install roadlib first:

    pip install roadlib/
    pip install roadrecon/

    Development Mode: To install in editable mode:

    pip install -e roadlib/
    pip install -e roadrecon/
    pip install roadrecon
  6. Host roadoidc as an Azure App Service

    master

    After generating the configuration, you can deploy the Flask application to Azure App Services using the Azure CLI. Once deployed, verify the deployment by accessing the .well-known/openid-configuration endpoint.

    cd flaskapp/
    az webapp up -n yourappname --sku B1 --runtime PYTHON:3.10
  7. Install roadtx

    master

    roadtx requires Python 3.10 or newer.

    Via PyPI (Stable):

    pip install roadtx

    Via GitHub (Latest/Manual): When installing from a cloned repository, ensure roadlib is installed first:

    pip install roadlib/
    pip install roadtx/

    Development Mode: To install in editable mode:

    pip install -e roadtx/
    pip install roadtx
  8. Run the ROADrecon development server

    master
    To start the development server for the ROADrecon Angular frontend, use the Angular CLI command ng serve. Once running, the application is accessible at http://localhost:4200/. The server supports hot-reloading, meaning the app will automatically reload when source files are modified.
    ng serve
  9. Generate code scaffolding with Angular CLI

    master

    You can use the Angular CLI to scaffold new parts of the application. Use the ng generate command followed by the type of entity you wish to create.

    Available types include:

    • component (e.g., ng generate component component-name)
    • directive
    • pipe
    • service
    • class
    • guard
    • interface
    • enum
    • module
    ng generate component component-name
  10. Host roadoidc on Azure Blob Storage

    master

    To host roadoidc as static files on Azure Blob Storage:

    1. Run the Flask app locally to generate the configuration files:
      cd flaskapp/
      flask run
    2. Download the required files from the local instance:
      wget http://127.0.0.1:5000/.well-known/openid-configuration -O config.json
      wget http://127.0.0.1:5000/keys.json -O keys.json
    3. Upload the files to an Azure Storage container using the Azure CLI. Ensure the container allows public blob access.
    export RESOURCE_GROUP="roadoidc"
    # Change location to where you want
    export LOCATION="westus2"
    az group create --name "${RESOURCE_GROUP}" --location "${LOCATION}"
    
    export AZURE_STORAGE_ACCOUNT="yourstoragename"
    export AZURE_STORAGE_CONTAINER="containername"
    az storage account create --resource-group "${RESOURCE_GROUP}" --name "${AZURE_STORAGE_ACCOUNT}" --allow-blob-public-access true
    az storage container create --name "${AZURE_STORAGE_CONTAINER}" --public-access blob
    az storage blob upload \
      --container-name "${AZURE_STORAGE_CONTAINER}" \
      --file config.json \
      --name .well-known/openid-configuration
    az storage blob upload \
      --container-name "${AZURE_STORAGE_CONTAINER}" \
      --file keys.json \
      --name keys.json
  11. Use ROADrecon CLI subcommands

    master

    ROADrecon is an Azure AD / Entra ID exploration tool. It operates via several primary subcommands to authenticate, gather data, or explore/export data.

    Primary Commands:

    • auth: Authenticate to Azure AD / Entra ID.
    • gather (alias: dump): Gather Azure AD / Entra ID information.
    • iggather (alias: igdump): Gather Identity Governance information.
    • pimgather (alias: pimdump): Gather Privileged Identity Management information.
    • azgather (alias: azdump): Gather Azure RM access and resources.
    • gatherall (alias: dumpall): Gather data via all available APIs (requires --autotoken).
    • gui: Launch the web-based GUI.
    • plugin: Run a specific ROADrecon plugin.
    roadrecon auth <options>
    roadrecon gather <options>
    roadrecon gui
    roadrecon plugin <plugin_name> <options>