https://github.com/hakbyte/snatch
A helper tool to retrieve the tokens required by AzureHound.
https://github.com/hakbyte/snatch
azure azurehound bloodhound redteam
Last synced: 4 months ago
JSON representation
A helper tool to retrieve the tokens required by AzureHound.
- Host: GitHub
- URL: https://github.com/hakbyte/snatch
- Owner: hakbyte
- License: mit
- Created: 2024-09-16T18:26:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T10:38:31.000Z (over 1 year ago)
- Last Synced: 2025-03-31T06:32:12.226Z (about 1 year ago)
- Topics: azure, azurehound, bloodhound, redteam
- Language: Python
- Homepage:
- Size: 225 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snatch
A helper tool to retrieve the tokens required by AzureHound. It relies on the
Azure PowerShell app (client id `1950a258-227b-4e31-a9cf-717495945fc2`) which is
available by default to all users.
Check out the [AzureHound Wiki](https://bloodhound.readthedocs.io/en/latest/data-collection/azurehound.html)
for the complete story.
## Usage
Run `snatch` from a terminal. It will get a Device Authentication code and ask
you to visit a URL to complete the authentication flow:

Enter the Device Code:

Complete the next steps to authenticate yourself. Once done, you will see the
following message:

Back to the terminal, press any key to retrieve the tokens:

Use the refresh token with AzureHound to query the MS Graph API. For example:
```
azurehound -r "0.ARwA6Wg..." list --tenant "contoso.onmicrosoft.com" -o output.json
```
## Installation
I recommend using [pipx](https://github.com/pypa/pipx) as it has become quite
the standard these days:
```
pipx install git+https://github.com/hakbyte/snatch
```
However if you don't want to use `pipx`, just clone this repo and build the
tool locally:
```
python3 setup.py sdist bdist_wheel
```
The resulting package (e.g. `dist/snatch-0.1.0-py3-none-any.whl`) can be
installed using `pip`:
```
pip install dist/snatch-0.1.0-py3-none-any.whl
```