Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a quick split command implementation #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dynom
Copy link

@Dynom Dynom commented Feb 22, 2024

I've added two commands:

  • Fakr -- A tool which generates fake payloads to use for testing the split command
  • Split -- A tool which splits BloodHound source files into smaller chunks, so that it becomes more easily digestable by BloodHound

To try it out:

Clone

git clone -b AddingASplitter --depth 1 --single-branch [email protected]:Dynom/BHCEupload.git

(The optional --depth and --single-branch flags just reduce the download size and provides you with the essentials.)

Cloning into 'BHCEupload'...
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 17 (delta 2), reused 14 (delta 1), pack-reused 0
Receiving objects: 100% (17/17), 10.99 KiB | 5.50 MiB/s, done.
Resolving deltas: 100% (2/2), done.
# All commands will be relative from within the BHCEupload directory, so lets hop on in:
cd BHCEupload

The Splitter

Build

go build ./cmd/split

If you don't have Go, you can get it from: https://go.dev/doc/install

Run

./split -h
Usage of ./split:
  -chunk-size uint
    	Data Items to split on (default 100)
  -source string
    	The path of the source file (e.g.: export.json)

Example

./split -source fake-source.json -chunk-size 10_000
# 545.73s user 68.38s system 174% cpu 5:52.61 total for 60GiB

The Fakr

The utility fakr generates a fake structure of data. Nice to test with

Build

go build ./cmd/fakr

Run

./fakr -count 100_000
# Generating 100000 items, writing to "fake-source.json"...
# generating 100% |██████████████████████████████████████████████████████████████| (100000/100000, 4965 it/s)
# Thanks for choppin' by!
ls -nh fake-source.json
# -rw-r--r--  1 501  20   683M Mar  4 15:22 fake-source.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant