Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/XMCyber/MacHound
https://github.com/XMCyber/MacHound
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/XMCyber/MacHound
- Owner: XMCyber
- License: gpl-3.0
- Created: 2021-02-16T07:11:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-02-16T13:00:23.000Z (over 3 years ago)
- Last Synced: 2024-06-07T23:42:27.437Z (5 months ago)
- Language: Python
- Size: 28.3 KB
- Stars: 99
- Watchers: 6
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-hacking-lists - XMCyber/MacHound - (Python)
README
# What is MacHound
MacHound is an extension to the Bloodhound audting tool allowing collecting and ingesting of Active Directory relationships on MacOS hosts.
MacHound collects information about logged-in users, and administrative group members on Mac machines and ingest the information into the Bloodhound database.
In addition to using the HasSession and AdminTo edges, MacHound adds three new edges to the Bloodhound database:
* CanSSH - entity allowed to SSH to host
* CanVNC - entity allowed to VNC to host
* CanAE - entity allowed to execute AppleEvent scripts on hostTo read more about MacHound, refer to the [introduction post](https://medium.com/xm-cyber/introducing-machound-a-solution-to-macos-active-directory-based-attacks-2a425f0a22b6)
# Data Collection
## Logged-in users (HasSession)
MacHound uses the utmpx API to query currently active users and OpenDirectory and membership API to validate Active Directory users.## Administrative Groups
MacHound collects Active Directory members of the following local administrative groups:### admin
The local administrative groups, allowing for root operations.### com.apple.access_ssh
Members of this local group are allowed to access the remote login service (SSH).### com.apple.remote_ae
Members of this local group are allowed to remotely execute AppleEvent scripts.### com.apple.access_screensharing
Members of this local group are allowed to access the screen sharing service (VNC)# Components
MacHound is split into two main components: the collector and the ingestor.### Collector
The MacHound collector is a Python3.7 scripts that run locally on Active Directory joined MacOS hosts.
The collector queries the local OpenDirectory and the Active Directory for information about priviliged users and groups.
The output of the execution is a JSON file that contains all the collected information.### Ingestor
The MacHound ingestor is a Python3.7 script that parses the output JSON files (one per host), connects to the neo4j database and inserts the edges to the database.
The ingestor uses the neo4j library for Python to query information to and from the neo4j database.
The ingestor must be executed on a host that has TCP access to the neo4j database.# Getting Started
## Requirements
MacHound requires Python3.7.
The ingestor requires the neo4j library for Python3.7.
## Collector### Deployment
The Collector should be deployed and executed locally on Macs. The output is stored locally and needs to be transfered to the host running the ingestor. The collector depends on builtin libraries in Python3.7 and does not require additional installations.
MacHound can be compiled as an Application using the py2app library to ease the deployment.### Usage
The Collector takes no arguments by default queries all information, and writes the output file into ./output.json.
The Collector must be executed as a root user.
```
collector.py -o -c [-v] [-l log_file_path]
```## Ingestor
The Ingestor should be deployed on a host that has direct TCP connection to Bloodhound's neo4j database, preferably locally on the neo4j database server to avoid security risks.
The ingestor requires the installation of neo4j driver for Python (see requirements file).```
ingestor.py -u -p -i
```# License
MacHound is released under the GPL-3.0 License. For more details see LICENSE.md.# Contact Us
For any question, suggestion, bug reporting please feel free to contact at [email protected]