Uses Sharphound, Bloodhound and Neo4j to produce an actionable list of attack paths for targeted remediation.

Overview

GoodHound

PyPI - Downloads

   ______                ____  __                      __
  / ____/___  ____  ____/ / / / /___  __  ______  ____/ /
 / / __/ __ \/ __ \/ __  / /_/ / __ \/ / / / __ \/ __  / 
/ /_/ / /_/ / /_/ / /_/ / __  / /_/ / /_/ / / / / /_/ /  
\____/\____/\____/\__,_/_/ /_/\____/\__,_/_/ /_/\__,_/   
                                                         

Attackers think in graphs, defenders think in actions, management think in charts.

GoodHound operationalises Bloodhound by determining the busiest paths to high value targets and creating actionable output to prioritise remediation of attack paths.

ko-fi

I'm lucky enough to do this for a living. Any donations will be passed on to my local foodbank, animal sanctuary and animal rescue centres.

Usage

Quick Start

For a very quick start with most of the default options, make sure you have your neo4j server running and loaded with SharpHound data and run:

pip install goodhound
goodhound -p "neo4jpassword"

This will process the data in neo4j and output 3 csv reports in the current working directory.

Demo

Documentation

All documentation can be found in the wiki

Acknowledgments

  • The py2neo project which makes this possible.
  • The PlumHound project which gave me the idea of creating something similar which suited my needs.
  • The aclpwn for the idea around exploit cost.
  • The Bloodhound Gang Slack channel for Cypher help.
  • The BloodHound project for changing the world and for continuing their support for the Open-Source community even when having a commercial offering.
Comments
  • Error with goodhound.py when [0] == None

    Error with goodhound.py when [0] == None

    Location: https://github.com/idnahacks/GoodHound/blob/main/goodhound.py#L185

    When I run this code, I see that I have a few entries where the group is "None". Currently, I am doing this to resolve:

    df = pd.DataFrame(allresults)
    allresults = df[~df[0].isna()].values.tolist()
    

    Error:

    sorted(allresults, key=lambda i: (i[0], -i[5]))
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    TypeError: '<' not supported between instances of 'NoneType' and 'str'
    

    Testing:

    df = pd.DataFrame(allresults)
    len(df[df[0].isna()])
    4
    
    bug 
    opened by thecasual 10
  • Password with & symbol

    Password with & symbol

    Do not use the standard neo4j password and our password contained a & symbol, the password not parsed properly from the parameters and is being seen as a command.

    help wanted 
    opened by lucasni2 3
  • Add query to pull users with paths that do not rely on them being in a group

    Add query to pull users with paths that do not rely on them being in a group

    Individual users with a path are not captured by the groups query. While this is kind of by design as the intention is to get the most exposed (busiest) paths, these other paths can exist and should be included.

    enhancement 
    opened by idnahacks 2
  • Add check for paths to principals that can perform DCSync

    Add check for paths to principals that can perform DCSync

    As DCSync requires both GetChanges and GetChanges all I think it needs to be a separate query to the main one,

    The script needs to look for these principals, check whether they will already by picked up by the main query and if not run a shortestpath to these principals query..

    enhancement 
    opened by idnahacks 1
  • Bloodhound 4.1 issue with highvalue attribute

    Bloodhound 4.1 issue with highvalue attribute

    The latest version of Bloodhound (4.1) currently has a bug where it doesn't set the highvalue property for anywhere where it's not TRUE. This means the queries in GoodHound will not pull results properly.

    I'll work around this by setting it manually.

    bug 
    opened by idnahacks 1
  • Bloodhound query output

    Bloodhound query output

    If the Bloodhound query output can be adjusted to show the exact path, rather than the start - end nodes this will rapidly speed up using these queries for reporting.

    enhancement 
    opened by idnahacks 1
  • Memory usage problem

    Memory usage problem

    Hi,

    I am having issues with neo4j using too much memory as a result of goodhound execution, I have not been able to get goodhound to finish running at all because of this, even with a low '-r' parameter.

    I have set the max heap size to 28GB, even then it fails with the error below, I cannot tell what specific query is causing this. Can the script or query be optimized in anyway to avoid this problem?

    DEBUG:Adding connection pool for profile ConnectionProfile('bolt://localhost:7687')
    DEBUG:Trying to acquire connection from pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:[#0000] C: (Dialing <localhost:7687>)
    DEBUG:[#EB39] S: (Accepted)
    DEBUG:[#EB39] C: <BOLT>
    DEBUG:[#EB39] C: <PROTOCOL> 4.3~4.0 | 4.0 | 3.0 | 2.0
    DEBUG:[#EB39] S: <PROTOCOL> 4.3
    DEBUG:[#EB39] C: HELLO {'user_agent': 'py2neo/2021.2.3 Python/3.11.1-final-0 (win32)', 'scheme': 'basic', 'principal': 'neo4j', 'credentials': '*******'}
    DEBUG:[#EB39] C: (Sent 133 bytes)
    DEBUG:[#EB39] S: SUCCESS {'server': 'Neo4j/4.4.12', 'connection_id': 'bolt-138', 'hints': {}}
    DEBUG:Releasing connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> from thread <_MainThread(MainThread, started 3432)>
    DEBUG:Connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> does not belong to pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:Connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> acquired by thread <_MainThread(MainThread, started 3432)>
    DEBUG:Releasing connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> from thread <_MainThread(MainThread, started 3432)>
    Warming up database
    DEBUG:Attempting to acquire read-write connection to default database
    DEBUG:Using connection pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:Trying to acquire connection from pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:Connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> acquired by thread <_MainThread(MainThread, started 3432)>
    DEBUG:[#EB39] C: RUN 'MATCH (n) OPTIONAL MATCH (n)-[r]->() RETURN count(n.name) + count(r.isacl)' {} {}
    DEBUG:[#EB39] C: PULL {'n': -1, 'qid': -1}
    DEBUG:[#EB39] C: (Sent 99 bytes)
    DEBUG:[#EB39] S: SUCCESS {'t_first': 15, 'fields': ['count(n.name) + count(r.isacl)']}
    DEBUG:[#EB39] S: RECORD * 1
    DEBUG:[#EB39] S: SUCCESS {'bookmark': 'FB:', 'type': 'r', 't_last': 31939, 'db': 'neo4j'}
    DEBUG:Releasing connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> from thread <_MainThread(MainThread, started 3432)>
    INFO:Setting cost.
    DEBUG:Attempting to acquire read-write connection to default database
    DEBUG:Using connection pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:Trying to acquire connection from pool <py2neo.client.ConnectionPool object at 0x000001CEE1CA48D0>
    DEBUG:Connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> acquired by thread <_MainThread(MainThread, started 3432)>
    DEBUG:[#EB39] C: RUN 'MATCH (n)-[r:MemberOf]->(m:Group) SET r.cost = 0' {} {}
    DEBUG:[#EB39] C: PULL {'n': -1, 'qid': -1}
    DEBUG:[#EB39] C: (Sent 73 bytes)
    DEBUG:[#EB39] S: SUCCESS {'t_first': 12547, 'fields': []}
    DEBUG:[#EB39] S: FAILURE {'code': 'Ne
    o.TransientError.General.OutOfMemoryError', 'message': "There is not enough memory to perform the current task. Please try increasing 'dbms.memory.heap.max_size' in the neo4j configuration (normally in 'conf/neo4j.conf' or, if you are using Neo4j Desktop, found through the user interface) or if you are running an embedded installation increase the heap by using '-Xmx' command line flag, and then restart the database."}
    DEBUG:[#EB39] C: RESET
    DEBUG:[#EB39] C: (Sent 6 bytes)
    DEBUG:[#EB39] S: SUCCESS {}
    DEBUG:Releasing connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> from thread <_MainThread(MainThread, started 3432)>
    DEBUG:Releasing connection <py2neo.client.bolt.Bolt4x3 object at 0x000001CEE2085510> from thread <_MainThread(MainThread, started 3432)>
    WARNING:Error setting cost!
    
    opened by ag-michael 0
  • Nested group memberships

    Nested group memberships

    sometimes a path shows up twice if one group is a member of another group. An if statement to see if $group ismember of $group then break might work and might even speed up the process

    bug 
    opened by idnahacks 0
Releases(v1.1.2)
  • v1.1.2(Mar 22, 2022)

    Changelog

    1.1.2

    • Fix bug with userpath call
    • Move hosted image away from github

    1.1.1

    • Add logo to report (Important stuff!)

    1.1

    • Update the weakest links function to include bloodhound query
    • Add basic HTML report

    1.0.1

    • Improve the ability to select the sql-path

    1.0

    • Upload to Pypi and update installation docs

    0.8

    • Restructure files to follow pypi structure
    • Make BloodHound 4.1 patch optional
    • Add changelog
    • Add more options relating to logging and output
    • Add error handling to neo4j connection
    • Add error handling to file output
    • change parameter for output dir to -d as this made more sense
    • remove custom query option as it could just end up messy
    • switch to pathlib for determining filepaths
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Mar 16, 2022)

  • v1.1.0(Mar 11, 2022)

  • v1.0.1(Mar 10, 2022)

  • v1.0.0(Feb 25, 2022)

Owner
idna
idna
A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)

MassDNS A high-performance DNS stub resolver MassDNS is a simple high-performance DNS stub resolver targeting those who seek to resolve a massive amou

B. Blechschmidt 2.5k Jan 07, 2023
md5 hash cracking with python.

Python-Md5-Cracker- md5 hash cracking with python. Original files added First create a file called word.txt then run the wordCreate.py script The task

Nebil Sharifi 0 Aug 31, 2022
Fast and customizable vulnerability scanner For JIRA written in Python

Fast and customizable vulnerability scanner For JIRA. 🤔 What is this? Jira-Lens 🔍 is a Python Based vulnerability Scanner for JIRA. Jira is a propri

Mayank Pandey 185 Dec 25, 2022
Scarecrow is a tool written in Python3 allowing you to protect your Python3 scripts.

🕷️ Scarecrow 🕷️ Scarecrow is a tool written in Python3 allowing you to protect your Python3 scripts. It looks for processes with specific names to v

Billy 33 Sep 28, 2022
Providing DevOps and security teams script to identify cloud workloads that may be vulnerable to the Log4j vulnerability(CVE-2021-44228) in their AWS account.

We are providing DevOps and security teams script to identify cloud workloads that may be vulnerable to the Log4j vulnerability(CVE-2021-44228) in their AWS account. The script enables security teams

Mitiga 13 Jan 04, 2022
CVE-2021-26084 - Confluence Pre-Auth RCE OGNL injection

CVE-2021-26084 - Confluence Pre-Auth RCE OGNL injection Usage usage: cve-2021-26084_confluence_rce.py [-h] --url URL [--cmd CMD] [--shell] CVE-2021-2

r0cky 92 Jul 20, 2022
PoC for CVE-2020-6207 (Missing Authentication Check in SAP Solution Manager)

PoC for CVE-2020-6207 (Missing Authentication Check in SAP Solution Manager) This script allows to check and exploit missing authentication checks in

chipik 82 Nov 09, 2022
LaxrFar Python Obfuscator

LaxrFar Python Obfuscator Usage First do the things from "Upload to Webserver" o

LaxrFar 5 Jul 19, 2022
Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples

Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples Above is an adversarial example: the slightly pert

Anish Athalye 838 Dec 18, 2022
The Modern Hash Identification System

🔗 Don't know what type of hash it is? Name That Hash will name that hash type! 🤖 Identify MD5, SHA256 and 3000+ other hashes ☄ Comes with a neat web app 🔥

1.2k Dec 28, 2022
Log4jScanner is a Log4j Related CVEs Scanner, Designed to Help Penetration Testers to Perform Black Box Testing on given subdomains.

Log4jScanner Log4jScanner is a Log4j Related CVEs Scanner, Designed to Help Penetration Testers to Perform Black Box Testing on given subdomains. Disc

Pushpender Singh 35 Dec 12, 2022
A brute Force tool for Facebook

EliBruter A brute Force tool for Facebook Installing this tool -- $ pkg upgrade && update $ pkg install python $ pkg install python3 $ pkg install gi

Eli Hacks 3 Mar 29, 2022
A Simple File Encryptor/Decryptor

Ec: A Simple File Encryptor/Decryptor This has been made for educational reasons only, any constructive criticism/advice/comments are welcome! Also, p

1 Dec 10, 2021
An ARP Spoofer attacker for windows to block away devices from your network.

arp0_attacker An ARP Spoofer-attacker for Windows -OS to block away devices from your network. INFO Built in Python 3.8.2. arp0_attackerx.py is Upgrad

Wh0_ 15 Mar 17, 2022
WhPhisher: a Phishing tool With Python

WhPhisher Herramienta para hacer phishing con muchos métodos de túneling -----Como Instalarlo------- pkg install python3 pkg install git git clone htt

WhBeatZ 80 Jan 02, 2023
"KeyLogger-WebService" Is a Keylogger Write In python.

KeyLogger-WebService "KeyLogger-WebService" Is a Keylogger Write In python. When you Inject the file on a computer once the file is opened on the comp

Freddox 21 Dec 16, 2022
CVE-2021-22005 - VMWare vCenter Server File Upload to RCE

CVE-2021-22005 - VMWare vCenter Server File Upload to RCE Analyze Usage ------------------------------------------------------------- [*] CVE-2021-220

r0cky 224 Aug 05, 2022
Fuck - Multi Brute Force 🚶‍♂

f-mbf Fuck - Multi Brute Force 🚶‍♂ Install Script $ pkg update && pkg upgrade $ pkg install python2 $ pkg install git $ pip2 install requests $ pip2

Yumasaa 1 Dec 03, 2021
Everything I needed to understand what was going on with "Spring4Shell" - translated source materials, exploit, links to demo apps, and more.

springcore-0day-en These are all my notes from the alleged confirmed! 0day dropped on 2022-03-29. This vulnerability is commonly referred to as "Sprin

Chris Partridge 105 Nov 26, 2022
ssh-audit is a tool for ssh server & client configuration auditing.

SSH server & client auditing (banner, key exchange, encryption, mac, compression, compatibility, security, etc)

Joe Testa 1.4k Dec 31, 2022