Skip to content

Commit

Permalink
initial public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkjanm committed Apr 15, 2020
0 parents commit 1ce51f3
Show file tree
Hide file tree
Showing 119 changed files with 21,260 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build/
dist/
*.egg-info
*.pyc
*.db
pocs/
metadatastore/
.roadtools_auth
Pipfile
__pycache__
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Dirk-jan Mollema

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# ROADtools
*(**R**ogue **O**ffice 365 and **A**zure (active) **D**irectory tools)*

![Python 3 only](https://img.shields.io/badge/python-3.6+-blue.svg)
![License: MIT](https://img.shields.io/pypi/l/roadlib.svg)

![ROADtools logo](roadrecon/frontend/src/assets/rt_transparent.svg)

ROADtools is a framework to interact with Azure AD. It currently consists of a library (roadlib) and the ROADrecon Azure AD exploration tool.

## ROADlib
![PyPI version](https://img.shields.io/pypi/v/roadlib.svg)

ROADlib is a library that can be used to authenticate with Azure AD or to build tools that integrate with a database containing ROADrecon data. The database model in ROADlib is automatically generated based on the metadata definition of the Azure AD internal API. ROADlib lives in the ROADtools namespace, so to import it in your scripts use `from roadtools.roadlib import X`

## ROADrecon
![PyPI version](https://img.shields.io/pypi/v/roadrecon.svg)
[![Build Status](https://dev.azure.com/dirkjanm/adconnectdump/_apis/build/status/fox-it.adconnectdump?branchName=master)](https://dev.azure.com/dirkjanm/adconnectdump/_build/latest?definitionId=16&branchName=master)

ROADrecon is a tool for exploring information in Azure AD from both a Red Team and Blue Team perspective. In short, this is what it does:
* Uses an automatically generated metadata model to create an SQLAlchemy backed database on disk.
* Use asynchronous HTTP calls in Python to dump all available information in the Azure AD graph to this database.
* Provide plugins to query this database and output it to a useful format.
* Provide an extensive interface built in Angular that queries the offline database directly for its analysis.

ROADrecon uses `async` Python features and is only compatible with Python 3.6-3.8 (development is done with Python 3.8).

### Installation
There are multiple ways to install ROADrecon:

**Using a published version on PyPi**
Stable versions can be installed with `pip install roadrecon`. This will automatically add the `roadrecon` command to your PATH.

**Using a version from GitHub**
Every commit to master is automatically built into a release version with Azure Pipelines. This ensures that you can install the latest version of the GUI without having to install `npm` and all it's dependencies. Simply download the `roadlib` and `roadrecon` zip files from the Azure Pipelines artifacts, then unzip both and install them in the correct order (`roadlib` first):

```
pip install roadlib/
pip install roadrecon/
```

You can also install them in development mode with `pip install -e roadlib/`.

**Developing the front-end**
If you want to make changes to the Angular front-end, you will need to have `node` and `npm` installed. Then install the components from git:
```
git clone https://github.com/dirkjanm/roadtools.git
pip install -e roadlib/
pip install -e roadrecon/
cd roadrecon/frontend/
npm install
```

You can run the Angular frontend with `npm start` or `ng serve` using the Angular CLI from the `roadrecon/frontend/` directory. To build the JavaScript files into ROADrecon's `dist_gui` directory, run `npm build`.

### Developing
See [this README](roadrecon/README.md) for more info.
103 changes: 103 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:
- job: Tests
pool:
vmImage: 'ubuntu-latest'

strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
displayName: 'Install pip'
- script: |
pip install .
find roadtools/ -name '*.py' -exec python -m py_compile {} \;
displayName: 'Install ROADlib'
workingDirectory: roadlib
- script: |
pip install .
find roadtools/ -name '*.py' -exec python -m py_compile {} \;
roadrecon -h
roadrecon-gui -h
displayName: 'Install ROADrecon'
workingDirectory: roadrecon
- job: Build
dependsOn: Tests
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
displayName: 'Use Python 3.8'
- task: Npm@1
inputs:
command: 'install'
workingDir: 'roadrecon/frontend/'

- task: Npm@1
inputs:
command: 'custom'
workingDir: 'roadrecon/frontend/'
customCommand: 'run build -- --prod'

- script: |
pip install --upgrade setuptools wheel
displayName: 'Update setuptools'
- script: |
pip install .
python setup.py sdist
python setup.py bdist_wheel
displayName: 'Create ROADlib package'
workingDirectory: roadlib
- script: |
pip install .
python setup.py sdist
python setup.py bdist_wheel
displayName: 'Create ROADrecon package'
workingDirectory: roadrecon
- task: CopyFiles@2
displayName: 'Copy ROADrecon Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: 'roadrecon/dist/'
Contents: '*'
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy ROADlib Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: 'roadlib/dist/'
Contents: '*'
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: ROADtools
Empty file.
Loading

0 comments on commit 1ce51f3

Please sign in to comment.