Code Monkey home page Code Monkey logo

offensive-azure's Introduction

Python Version Build Status PyPI Wheel

Collection of offensive tools targeting Microsoft Azure written in Python to be platform agnostic. The current list of tools can be found below with a brief description of their functionality.

  • ./Device_Code/device_code_easy_mode.py
    • Generates a code to be entered by the target user
    • Can be used for general token generation or during a phishing/social engineering campaign.
  • ./Access_Tokens/token_juggle.py
    • Takes in a refresh token in various ways and retrieves a new refresh token and an access token for the resource specified
  • ./Access_Tokens/read_token.py
    • Takes in an access token and parses the included claims information, checks for expiration, attempts to validate signature
  • ./Outsider_Recon/outsider_recon.py
    • Takes in a domain and enumerates as much information as possible about the tenant without requiring authentication
  • ./User_Enum/user_enum.py
    • Takes in a username or list of usernames and attempts to enumerate valid accounts using one of three methods
    • Can also be used to perform a password spray
  • ./Azure_AD/get_tenant.py
    • Takes in an access token or refresh token, outputs tenant ID and tenant Name
    • Creates text output file as well as BloodHound compatible aztenant file
  • ./Azure_AD/get_users.py
    • Takes in an access token or refresh token, outputs all users in Azure AD and all available user properties in Microsoft Graph
    • Creates three data files, a condensed json file, a raw json file, and a BloodHound compatible azusers file
  • ./Azure_AD/get_groups.py
    • Takes in an access token or refresh token, outputs all groups in Azure AD and all available group properties in Microsoft Graph
    • Creates three data files, a condensed json file, a raw json file, and a BloodHound compatible azgroups file
  • ./Azure_AD/get_group_members.py
    • Takes in an access token or refresh token, outputs all group memberships in Azure AD and all available group member properties in Microsoft Graph
    • Creates three data files, a condensed json file, a raw json file, and a BloodHound compatible azgroups file
  • ./Azure_AD/get_subscriptions.py
    • Takes in an ARM token or refresh token, outputs all subscriptions in Azure and all available subscription properties in Azure Resource Manager
    • Creates three data files, a condensed json file, a raw json file, and a BloodHound compatible azgroups file
  • ./Azure_AD/get_resource_groups.py
    • Takes in an ARM token or refresh token, outputs all resource groups in Azure and all available resource group properties in Azure Resource Manager
    • Creates two data files, a raw json file, and a BloodHound compatible azgroups file
  • ./Azure_AD/get_vms.py
    • Takes in an ARM token or refresh token, outputs all virtual machines in Azure and all available VM properties in Azure Resource Manager
    • Creates two data files, a raw json file, and a BloodHound compatible azgroups file

Installation

Offensive Azure can be installed in a number of ways or not at all.

You are welcome to clone the repository and execute the specific scripts you want. A requirements.txt file is included for each module to make this as easy as possible.

Poetry

The project is built to work with poetry. To use, follow the next few steps:

git clone https://github.com/blacklanternsecurity/offensive-azure.git
cd ./offensive-azure
poetry install

Pip

The packaged version of the repo is also kept on pypi so you can use pip to install as well. We recommend you use pipenv to keep your environment as clean as possible.

pipenv shell
pip install offensive_azure

Usage

It is up to you for how you wish to use this toolkit. Each module can be ran independently, or you can install it as a package and use it in that way. Each module is exported to a script named the same as the module file. For example:

Poetry

poetry install
poetry run outsider_recon your-domain.com

Pip

pipenv shell
pip install offensive_azure
outsider_recon your-domain.com

offensive-azure's People

Contributors

debifrank avatar jamesmcroft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

offensive-azure's Issues

error when running against some domains

Traceback (most recent call last):
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in validate_conn
conn.connect()
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 474, in
runner()
File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 470, in runner
prog.main()
File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 411, in main
user_realm_json = self.enumerate_login_info(args.Domain, user)
File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 178, in enumerate_login_info
user_realm_json4 = requests.post(endpoint4, headers=headers4, data=json_data).json()
File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 532, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

This is on my kali system

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.