Coder Social home page Coder Social logo

spellshift / realm Goto Github PK

View Code? Open in Web Editor NEW
326.0 11.0 26.0 54.85 MB

Realm is a cross platform Red Team engagement platform with a focus on automation and reliability.

Home Page: https://docs.realm.pub/

License: GNU General Public License v3.0

Dockerfile 0.31% Shell 3.28% Go 24.79% HTML 0.17% TypeScript 25.74% Rust 44.11% HCL 0.57% Batchfile 0.01% CSS 0.07% JavaScript 0.01% Python 0.94%
golang rust agent bot c2 cyber cybersecurity graphql implant redteam

realm's People

Contributors

1nv8rzim avatar adm1npanda avatar alexcote1 avatar alextibtab avatar ankit-pn avatar arunjohnkuruvilla avatar cictrone avatar cmp5987 avatar dependabot[bot] avatar hulto avatar jabbate19 avatar kcarretto avatar milkshak3s avatar raynecafaro avatar shashank73744 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realm's Issues

[feature] imix callback and main loop

Is your feature request related to a problem? Please describe.
Implement the main loop and callback mechanism for the imix agent.

Describe the solution you'd like

  1. Web request, send task updates and claim new tasks (graphql)
  2. Parse response
  3. Web request to get new times
  4. Untargz and run times

Describe alternatives you've considered
N/a

Additional context
N/a

[RELEASE] MVP v0.0.1

Release Information for v0.0.1 (MVP)

Target Release Date: 3/3/2023
Agent Support Windows, Linux, MacOS
Teamserver Support Yes
Eldritch Support Limited
UI Support in-dev
  • Agent Support
    • This version will support running the imix agent on Windows, Linux, and MacOS platforms
  • Teamserver Support
    • GraphQL API fully available, relay pagination not yet supported
    • Agent auth not yet supported
  • Eldritch Support
    • Parameter types limited to strings
    • No support for in memory (tome-embedded) files yet
  • UI Support
    • UI is under active development, the only component ready for release in v0.0.1 will be the GraphQL Playground

[feature][backend] Schema Upload

Is your feature request related to a problem? Please describe.
We need a way to bulk import targets and tags at the start of an engagement.

Describe the solution you'd like
Create an endpoint that creates targets & tags based on a JSON array.

Implement time.format_to_readable

Describe the solution you'd like
Create a function time.format_to_readable function.

Should take an epoch time stamp, and a string to format the time stamp as. Eg "%Y %M %S"

[feature] Switch back to starklark standard

Is your feature request related to a problem? Please describe.
Currently rely on a private fork of starlark-rust

Describe the solution you'd like
Switch back to the standard library.

Additional context
Switch was originally made when starlark-rust tests started failing due to rust nightly implementing a memory optomization.
This may require us to stay on rust nightly.

facebook/starlark-rust#54

[bug] Tests fail in actions w/o output

Describe the bug
Tests are failing for all PRs. As a contributor, I cannot see the output of the failing GitHub Actions runners.

To Reproduce
Steps to reproduce the behavior:

  1. Create a PR with code changes
  2. Wait for GH actions tests to run, they will fail
  3. As a contributor, click on the failing action
  4. Witness the lack of visibility

Expected behavior
As a contributor, I can see the resulting output of tests, failing or otherwise

Screenshots
Screen Shot 2022-03-30 at 11 54 17 AM

Desktop (please complete the following information):
N/A, SaaS issue

Smartphone (please complete the following information):
N/A

Additional context

[feature] Eldritch file.is_file

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to check if a path is a file.

Describe the solution you'd like
Create a file.is_file function in eldritch.

Should take a path as a String and return true if it's a file and false if it dosen't exist or is a directory.

Implement crypto.decrypt_file

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to decrypt a file.

Describe the solution you'd like
Create a function crypto.decrypt_file.

Should take a src file path, dst file path, and an encryption key.
Should return a status code after writing the decrypted file to disk.
Should be thoroughly tested and work on Linux, Windows, and Mac.

Implement file.set_perms

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to set file permissions or extended attributes.

Describe the solution you'd like
Create a function file.set_perms.

Should take user, group, perms...., and xattrs...
Should be thoroughly tested and work on Linux, Windows, and Mac.

Implement time.format_to_epoch

Describe the solution you'd like
Create a time.format_to_epoch function should take a human readable timestamp, and a time format and return the epoch repsentation.

Implement process.name

Is your feature request related to a problem? Please describe.
Eldritch does not have a simple way to get the name of a process from its PID.

Describe the solution you'd like
Implement a process.name function.

  • Should take an int PID and return a string that is the name of that process.

[feature] Eldritch: Implement file.Download

Is your feature request related to a problem? Please describe.
Imix should be able to download and save files, for example from our CDN.

Describe the solution you'd like
Implement the file.Download eldritch method to download files. It must support HTTP(s), but other protocols (e.g. FTP & SFTP) would be useful.

[bug][eldritch] allocate_unusued_ports fails when port is already in use.

Describe the bug
When multiple network based tests are running ports can be selected through allocate_localhost_unused_ports but by the time they get to setup_test_listener they can already have been bound.

To Reproduce

while true; do cargo test -- --skip test_process_shell_current_user --nocapture; sleep 1; done

Expected behavior
Tests should pass

Screenshots
image

[feature] Implement and document using git-lfs for images other large files.

Is your feature request related to a problem? Please describe.
Scaling our dev will become challenging if we continue to store large files like images in the repository.
Cloning down the repository will get slower and slower if different image revisions are stored in it Eg. how we currently manage the docs web pages.

Describe the solution you'd like
To solve this we should start using git-lfs a tool that will store large files outside the repository and just save a reference to the image which will then automatically be pulled based on the current working version.

Describe alternatives you've considered
None

Additional context
Current images in the repository.
/realm/docs/assets/images/.png
/realm/tavern/internal/www/public/
.png

[bug] Disable high resource portscan tests.

Describe the bug
portscan testing is consuming too many resources in the CI runner causing unrelated tests to fail.

To Reproduce
Run the CI pipeline a couple times.

Expected behavior
Tests should pass independent of each other.

[feature] Eldritch sys.dll_inject

Is your feature request related to a problem? Please describe.
Create the ability to inject dlls into a target process on Windows.

Describe the solution you'd like
Add a basic CreateRemoteThread() dll inject function.

Describe alternatives you've considered
No alternatives considered.

Additional context

[feature] Eldritch file.template

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to create a file using jinja2 templates.

Describe the solution you'd like
Create a function file.template.

Should take a file path to a jinja2 template, some args to populate the template, and a destination.
Should be thoroughly tested and work on Linux, Windows, and Mac.

[feature] Validate graphql input

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Implement file.mkdir

Implement Eldritch's file.mkdir function, which should exhibit the following behaviour:

  • If the directory already exists, this method should be a noop (e.g. it should not error)
  • It should create all parent directories in the path that do not yet exist
    • For example, when creating /tmp/somedir/another/ if /tmp/somedir does not exist, it should be created
  • It should be implemented to be cross platform (e.g. Windows support). If an invalid path is supplied for the current operating system, an error should be returned.

[bug] Starlark dependencies

Describe the bug
Building starlark-rust on Windows errors out due to a dependency.

image

To Reproduce
cargo build on windows.

Expected behavior
Should compile

[feature] eldritch pivot.ncat implementation

Is your feature request related to a problem? Please describe.
This issue exists to record the thought process around developing the pivot.ncat function in eldritch.

Describe the solution you'd like
The goal of this feature is to enable a user to send arbitrary text to a host, port, and protocol then receive a response if one exists.

** Solution **
Libraries:

  • tokio
    • Already imported and supports UDP, TCP, and more.

** Testing **

[bug] Report output on error

Describe the bug
We received no output back from this tome, expected an error from the following eldritch:

"print(sys.shell(input_vars[\"cmd\"]))"

[feature] Docs: Dark Mode

Enable a dark mode toggle in the nav bar for our docs. It should persist the setting, such that subsequent page visits or reloads preserve the user’s choice.

Implement file.replace

Implement Eldritch's file.replace function, which should exhibit the following behaviour:

  • If the file does exists this method should error.
  • It should take a regular expression using the Regex library and a value string to replace matching with.
  • It should be implemented to be cross platform (e.g. Windows support). If an invalid path is supplied for the current operating system, an error should be returned.

Implement file.find

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to search for files.

Describe the solution you'd like
Create a function file.find(name: String, path: String, file_type: Optional<String>, permissions: Optional<String>, modified_time: Optional<String>, create_time: Optional<String> )

Should take a file path to search.
Should take options for name, file type, permissions, modified time, create time.
Should be thoroughly tested and work on Linux, Windows, and Mac.

Implement crypto.encrypt_file

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to encrypt a file.

Describe the solution you'd like
Create a function crypto.encrypt_file.

Should take a src file path, dst file path, and an encryption key.
Should return a status code after writing the encrypted file to disk.
Should be thoroughly tested and work on Linux, Windows, and Mac.

Implement time.now

Describe the solution you'd like
Create a function time.now() to get the current epoch time.

Should return a number.

[feature][eldritch] Eldritch receive variable parameters through the `eldritch_run` function

Is your feature request related to a problem? Please describe.
To allow users to pass parameters through Tavern tomes into imix the eldritch run function needs to accept parameters and pass them into the interpreter.

Describe the solution you'd like

  • Add tome_parameters to the eldritch_run function in eldritch/src/lib.rs
  • Receive tome_parameters as a JSON string.
  • Use serde to deserialize the tome_parameters into a Dict or HashMap
  • Pass the deserialized parameters into the GlobalsBuilder using the get_eldritch function.
  • Reference parameters as input_vars['cmd']

Describe alternatives you've considered
N/a

Additional context
N/a

[bug] GitHub Actions runner enters unrecoverable state, remains running

Describe the bug
Some Eldritch job instances cause the Actions runner to enter a state where it no longer appears to be performing any actions, but remains running until some external timeout (generally > 1 hour). The errors do not appear to be specific to a single OS, as we have an example of an indefinite job running on each of the 3 operating systems we run tests on. It also does not appear to be limited to a single step in a workflow, as there are examples of this state occurring in both "build" and "test" steps.

Cancelling and re-running the failed job appears to fix the problem when a runner hits this state, which makes this bug inconsistent to reproduce.

To Reproduce
Steps to reproduce the behavior:

  1. Submit a PR with changes to Eldritch code
  2. Keep adding commits until a GH Actions workflow takes > 30 minutes
  3. Observe the pain of a lack of logs, and a stalled runner
  4. Cancel the workflow run
  5. Re-run the failed jobs
  6. Observe that the job completes this time (probably)

Expected behavior
When running a GitHub Actions workflow for Eldritch steps the workflow completes in an amount of time consistent from run-to-run.

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS, Ubuntu, Windows
  • Browser N/A
  • Versions at and following #110

Smartphone (please complete the following information):
N/A

Additional context
Since cancelling and re-running the failed job appears to fix the problem, a working mitigration should be to add a workflow timeout to the Eldritch workflows.

[bug] missing libssl-dev library in build container.

Describe the bug
When build container starts it has the libssl1.1 library but not the libssl-dev library which is required by the openssl-sys crate.

To Reproduce
Steps to reproduce the behavior:

  1. Clean up any dev environment and volumes.
  2. Run cargo test

Expected behavior
The project should compile out of the box with the dev container

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOs running dev container ubuntu

[feature] Eldritch file.compress

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to compress a file.

Describe the solution you'd like
Create a function file.compress.

Should take a file path and an archive path.
Should create a compressed archive from the source path.
Should be thoroughly tested and work on Linux, Windows, and Mac.

[bug] Download_impl throws warning during compilation.

Describe the bug
When compiling eldritch the download impl throws a warning of used Result.
image

To Reproduce
Steps to reproduce the behavior:

  1. cd ./implants/eldritch
  2. cargo test test_download_file

Additional context
@Milkshak3s Sorry missed this during review when you get a chance can you push a PR.

Implement file.decompress

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to decompress a file.

Describe the solution you'd like
Create a function file.decompress.

Should take a destination path and an archive path.
Should create the original files form the archive into the destination folder.
Should be thoroughly tested and work on Linux, Windows, and Mac.

Implement file.timestomp

Implement Eldritch's file.replace function, which should exhibit the following behaviour:

  • If the file does exists this method should error.
  • It should take a file to source metadata from and a path to apply that time data to.
  • It should be implemented to be cross platform (e.g. Windows support). If an invalid path is supplied for the current operating system, an error should be returned. Be aware that Windows NTFS metadata is different and can leave artifacts if not careful. Consult https://github.com/limbenjamin/nTimetools for more information.

[bug] Starlark package appears to be broken

Describe the bug
When compiling the eldritch package the build fails on compiling starlark v0.6.0

To Reproduce
Steps to reproduce the behavior:

  1. Clone prokect
  2. Open in development container
  3. run cargo build

Expected behavior
The package should compile without error.

Screenshots
image

Additional context
I've tried using starlark v0.7.1 and v0.8.0 with no luck.
Testing with a empty project a different seemingly related error occurs.
image

[feature] Eldritch interpreter standalone

Is your feature request related to a problem? Please describe.
Create an inline way to run the eldritch interpreter without a c2.
This will allow allow us to leverage the eldritch language to do deployment and serve as a replacement to GScript and Ansible.

Describe the solution you'd like
Goal:

  • Run eldritch interpreter on tomes from a local system without needing a c2.
  • Run multiple tomes concurrently. If we have a lot of deployment tomes we want them all to run regardless of the others.
  • Interactive mode. Have a log-less and low IoC shell is helpful. Instead of a process list showing /bin/sh -c "whoami" we can have /bin/golem

Reach goal:

  • Single file executable bundle. Tome and supporting files are packaged inside the executable in a compressed and encrypted format. Should be doable with include_dir
  • Reimplement paragon ticker functionality. Either in the interpreter or with a tome.

Describe alternatives you've considered
Using GScript or ansible for deployment.

GScript is unmaintained and unreliable. It also doesn't integrate with our existing tome workflow.
Ansible has a number or requirements like allowing SSH in bound, having a common user, and known password / certificate.

Additional context

Implement file.write

Implement Eldritch's file.write function, which should exhibit the following behaviour:

  • If the file does exists this method should error.
  • It should write a string to a file path.
  • It should be implemented to be cross platform (e.g. Windows support). If an invalid path is supplied for the current operating system, an error should be returned.

[feature] Eldritch sys.exec

Is your feature request related to a problem? Please describe.
Eldritch doesn't have a way to execute files.

Describe the solution you'd like
Create a function sys.exec that allows a user to execute a file on the system through the eldritch language.

  • Should take a path to the binary as a string.
  • Should receive an ordered list of strings as arguments for the binary.
  • Should take a boolean value to run the program as a child of the current process or disown it.
  • Should be thoroughly tested and work on Linux, Windows, and Mac.

[bug] Add docs to `agent-development` around `claimTask` parameters field.

Describe the bug
Working on imix and unclear on what data I should expect in the nested JSON for Tome.parameters.

Would also be nice to see docs around the createTome parameters field I know that will specify the variable names and types and createTask/claimTask will specify values populated in those fields.

[feature][backend] Upload Tome Endpoint

Is your feature request related to a problem? Please describe.
We need a way to upload new tomes.

Describe the solution you'd like
Multi-file upload that creates a tome (UI web form responsible for doing this)

Describe alternatives you've considered
We decided that uploading tar.gz would be too complex for users, UI can guide them through defining the metadata.yml

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.