Skip to content

Commit

Permalink
BED 4329: Add Sample Data and Link (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHinck authored Apr 19, 2024
1 parent 4e203da commit 3f1f711
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 25 deletions.
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@

<hr />

BloodHound is a monolithic web application composed of an embedded React frontend
with [Sigma.js](https://www.sigmajs.org/) and a [Go](https://go.dev/) based REST API backend. It is deployed with a
[Postgresql](https://www.postgresql.org/) application database and a [Neo4j](https://neo4j.com/) graph database, and is fed by the
[SharpHound](https://github.com/BloodHoundAD/SharpHound) and [AzureHound](https://github.com/BloodHoundAD/AzureHound)
data collectors.

BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure
environment. Attackers can use BloodHound to easily identify highly complex attack paths that would otherwise be
impossible to identify quickly. Defenders can use BloodHound to identify and eliminate those same attack paths. Both blue and red
teams can use BloodHound to easily gain a deeper understanding of privilege relationships in an Active Directory or Azure
environment.

BloodHound CE is created and maintained by the [BloodHound Enterprise Team](https://bloodhoundenterprise.io). The
original BloodHound was created by [@_wald0](https://www.twitter.com/_wald0), [@CptJesus](https://twitter.com/CptJesus), and
[@harmj0y](https://twitter.com/harmj0y).
BloodHound is a monolithic web application composed of an embedded React frontend with [Sigma.js](https://www.sigmajs.org/) and a [Go](https://go.dev/) based REST API backend. It is deployed with a [Postgresql](https://www.postgresql.org/) application database and a [Neo4j](https://neo4j.com/) graph database, and is fed by the [SharpHound](https://github.com/BloodHoundAD/SharpHound) and [AzureHound](https://github.com/BloodHoundAD/AzureHound) data collectors.

BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure environment. Attackers can use BloodHound to easily identify highly complex attack paths that would otherwise be impossible to identify quickly. Defenders can use BloodHound to identify and eliminate those same attack paths. Both red and blue teams can use BloodHound to easily gain a deeper understanding of privilege relationships in an Active Directory or Azure environment.

BloodHound CE is created and maintained by the [BloodHound Enterprise Team](https://bloodhoundenterprise.io). The original BloodHound was created by [@_wald0](https://www.twitter.com/_wald0), [@CptJesus](https://twitter.com/CptJesus), and [@harmj0y](https://twitter.com/harmj0y).

## Running BloodHound Community Edition

Expand All @@ -29,8 +19,10 @@ The easiest way to get up and running is to use our pre-configured Docker Compos
3. Locate the randomly generated password in the terminal output of Docker Compose
4. In a browser, navigate to `http://localhost:8080/ui/login`. Login with a username of `admin` and the randomly generated password from the logs

NOTE: going forward, the default `docker-compose.yml` example binds only to localhost (127.0.0.1). If you want to access BloodHound outside of localhost,
you'll need to follow the instructions in [examples/docker-compose/README.md](examples/docker-compose/README.md) to configure the host binding for the container.
NOTE: Going forward, the default `docker-compose.yml` example binds only to localhost (127.0.0.1). If you want to access BloodHound outside of localhost, you'll need to follow the instructions in [examples/docker-compose/README.md](examples/docker-compose/README.md) to configure the host binding for the container.

### Importing sample data
The BloodHound team has provided some sample data for testing BloodHound without performing a SharpHound or AzureHound collection. That data may be found [here](examples/sample-data/README.md).

## Installation Error Handling

Expand Down
12 changes: 11 additions & 1 deletion cmd/ui/src/views/Explore/GraphView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,22 @@ const GraphView: FC = () => {
</Link>
);

const sampleDataLink = (
<Link target='_blank' href={'https://github.com/SpecterOps/BloodHound/tree/main/examples/sample-data'}>
GitHub Sample Collection
</Link>
);

if (isError) throw new Error();

if (!data.length)
return (
<Box position={'relative'} height={'100%'} width={'100%'} overflow={'hidden'}>
<NoDataAlert dataCollectionLink={dataCollectionLink} fileIngestLink={fileIngestLink} />
<NoDataAlert
dataCollectionLink={dataCollectionLink}
fileIngestLink={fileIngestLink}
sampleDataLink={sampleDataLink}
/>
</Box>
);

Expand Down
14 changes: 14 additions & 0 deletions examples/sample-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BloodHound Sample Data

The BloodHound team has provide some sample data for testing the tool without performing a SharpHound or AzureHound collection. The sample data sets are outlined below.

## AD Example Data

File: [ad_example_data.zip](examples/sample-data/ad_example_data.zip)

This example environment includes:

- 3 collected domains with trusts between them
- Additional, visible, trusted domains without collections
- Coverage for local permissions
- Multiple ADCS escalation paths
Binary file added examples/sample-data/ad_example_data.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import NoDataAlert from '.';

const dataCollectionLinkText = 'data collection';
const fileIngestLinkText = 'file ingest';
const sampleDataLinkText = 'github sample collection';

describe('NoDataAlert', () => {
it('should render', () => {
Expand All @@ -30,19 +31,24 @@ describe('NoDataAlert', () => {

//This text only displays if file ingest link prop is passed
expect(screen.queryByText(/file ingest/)).toBeNull();

//This text only displays if sample data link prop is passed
expect(screen.queryByText(/github sample collection/)).toBeNull();
});

it('should show the file ingest text if the prop is passed', () => {
render(
<NoDataAlert
dataCollectionLink={<>{dataCollectionLinkText}</>}
fileIngestLink={<>{fileIngestLinkText}</>}
sampleDataLink={<>{sampleDataLinkText}</>}
/>
);

expect(screen.getByText('No Data Available')).toBeInTheDocument();
expect(screen.getByText(/It appears that no data has been uploaded yet./)).toBeInTheDocument();
expect(screen.getByText(/data collection/)).toBeInTheDocument();
expect(screen.getByText(/file ingest/)).toBeInTheDocument();
expect(screen.getByText(/github sample collection/)).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,33 @@ import { FC } from 'react';
type NoDataAlertProps = {
dataCollectionLink: JSX.Element;
fileIngestLink?: JSX.Element;
sampleDataLink?: JSX.Element;
};

export const NoDataAlert: FC<NoDataAlertProps> = ({ dataCollectionLink, fileIngestLink }) => {
export const NoDataAlert: FC<NoDataAlertProps> = ({ dataCollectionLink, fileIngestLink, sampleDataLink }) => {
const theme = useTheme();

return (
<Box display={'flex'} justifyContent={'center'} mt={theme.spacing(8)} mx={theme.spacing(4)}>
<Alert severity={'info'}>
<AlertTitle>No Data Available</AlertTitle>
It appears that no data has been uploaded yet.
<br />
See our {dataCollectionLink} documentation to learn how to start collecting data.
<br />
<p>
It appears that no data has been uploaded yet. See our {dataCollectionLink} documentation to learn
how to start collecting data.
</p>

{fileIngestLink && (
<>
<p>
If you have files available from a SharpHound or AzureHound collection, please visit the{' '}
{fileIngestLink} page to begin uploading your data.
</>
</p>
)}

{sampleDataLink && (
<p>
If you want to test BloodHound with sample data, you may download some from our {sampleDataLink}{' '}
GitHub page.
</p>
)}
</Alert>
</Box>
Expand Down

0 comments on commit 3f1f711

Please sign in to comment.