GithubHelp home page GithubHelp logo

oseferi / azurecli-extractor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0x09al/azurecli-extractor

0.0 1.0 0.0 274 KB

A tool to extract and abuse access tokens from AzureCLI for bypassing 2FA/MFA.

C# 100.00%

azurecli-extractor's Introduction

AzureCLI-Extractor

AzureCLI-Extractor abuses the insecure storage of AzureCLI access and refresh tokens, bypassing Multi-Factor Authentication to create a new global administrator.

AzureCLI

AzureCLI is a command-line tool which allows system administrators to easily manage Azure Sources. Additionally, this tool is designed to be easy to learn but powerful enough to build custom automation using Azure Resources. Before using any of the features of the tool, the users needs to sign in with the az login command. This type authentication supports Multi-Factor Authentication and is the most popular one. When a user tries to login, Azure-CLI opens an Azure sign-in page which will allow you to sign in, and after a successful login, it will send the Access Token Information on a local web server it started.

As can bee seen from the image below the tokens are stored in clear-text.

Technically, this is not a vulnerability as that's how it's supposed to work. The behaviour can be improved by saving the access and refresh tokens only when, the users specifies so.

In case an attacker manages to extract the content of the accessToken.json file, by compromising a backup server, using a file read primitive etc. This tool can be used to create a new Global Admin account. Since it uses the Graph API to create the user, it will bypass Multi-Factor authentication.

Usage

AzureCLI-Extractor supports the following commands :

  • adduser - Adds a Global Admin User.

    • -d, --displayname Required. User display name.

    • -u, --username Required. Account username.

    • -a, --accountprincipal Required. The account principal name. It should be something like [email protected] / [email protected] .

    • -p, --password Required. Account password.

    • --help Display this help screen.

    • --version Display version information.

  • gettoken - Retrieve an updated user access token.

Example

Retrieve an updated token.

Add a new global admin user.

azurecli-extractor's People

Contributors

0x09al avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.