Cyber security

BadZure – A PowerShell To Set Up Azure Active Directory Tenants

BadZure is a PowerShell script that uses the Microsoft Graph SDK to set up Azure Active Directory tenants. It fills them with different entities and makes common security mistakes to make tenants that are easy to attack and have multiple entry points.

BadZure automates the process of creating users, groups, application registrations, service principals, and administrative units, among other things.

It gives Azure AD roles, Graph permissions, and application ownership privileges to randomly chosen security principals to mimic common security misconfigurations in real environments.

This lets it create new attack paths. In line with the “Assume Breach” principle, BadZure gives users two ways to gain initial access to the vulnerable tenants it makes. This simulates account takeover scenarios.

BadZure’s main benefit is that it can quickly fill and clean up existing Azure AD tenants with randomly generated vulnerable configurations and pre-configured initial access.

This makes it easier for both the red team (attack simulation) and the blue team (detection development) to try out new ideas. It is made for security professionals who want to learn more about and explore Azure AD security.

Goals and Use Cases

BadZure was first made for a class at X33fcon 2023 called Azure AD Battle School: Hands-on Attack and Defense.

When BadZure is added to an Azure AD tenant, red and blue teams can also:

  • Try out popular ways and tools to attack Azure AD (for ideas, see the Azure AD Attack and Defense Playbook).
  • Set up quickly Azure AD lab users that have been set up wrong.
  • Get information about attacks so you can build, test, and improve detection controls.
  • Purple team routines should be done in a safe place.
  • Help set up hands-on security training for Azure AD.
  • Attack Paths Host changeable Azure AD Capture the Flag (CTF) events.

Attack Paths

Initial Access

BadZure makes it easier to log in for the first time by modeling account takeover methods like password attacks and token theft. It accomplishes this by giving the principal JWT access tokens or assigning a password (which the user can choose or generate randomly).

BadZure also instantly makes a file called “users.txt” that lists the usernames of the new accounts. This is done to support testing methods like “password spraying.” Users can put themselves in the shoes of an attacker who is going after an Azure AD tenant by using the passwords or tokens that are given out in the output.

Privilege Escalation

BadZure makes three attack vectors for gaining more privileges by simulating service principal abuse situations. It does this by making sure that Azure AD roles, Graph rights, and application ownerships cause misconfigurations. Below is a BloodHound-made image that shows the attack paths that BadZure makes.


Demo

You can learn more and download this tool here

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

AutoExif – Simplifying Image Metadata Editing With Bash

AutoExif is a powerful Bash script designed to streamline the process of editing image metadata…

2 days ago

SimpleImager V4.3 : A Step-by-Step Guide To Efficient System Imaging

SimpleImager V4.3, your go-to tool for streamlined system imaging and data acquisition. Designed to simplify…

2 days ago

MetaOSINT – Revolutionizing OSINT Investigations With Top Tools And Resources

MetaOSINT enables open source intelligence ("OSINT") practitioners to jumpstart their investigations by quickly identifying relevant,…

2 days ago

ThreatPinch Lookup – Enhancing Cybersecurity Investigations Through Automated Tooltips

ThreatPinch Lookup creates informational tooltips when hovering oven an item of interest on any website.…

2 days ago

Oh Shint! Navigating The Depths Of Cyber-Intelligence With Donvito

Myself and any other potential contributors to this website are NOT in any way affiliated…

2 days ago

M.E.A.T. – Pioneering Mobile Forensics With The Mobile Evidence Acquisition Toolkit

The Mobile Evidence Acquisition Toolkit designed by BlackStone Discovery. Developed to enhance digital forensics, this…

3 days ago