Skip to main content

No project description provided

Project description

GRR Shell

TL;DR

GRRShell is an interactive command line utility used for navigating a remote client's Emulated Filesystem (EFS)[0], collecting files and launching artefact collection flows.

[0] So named to disambiguate with the Virtual File System (VFS) in the GRR Web UI.

Usage

Important: Using GRRShell requires that you already have been granted access to a client to launch flows. GRRShell does not have functionality to request access to a remote client, you will need to do this through the GRR web UI.

Run grrshell as follows:

grrshell command [options]

If command is not provided, shell is assumed.

Commands Supported

shell

The primary function of GRRShell is the interactive shell, launched by this command. The shell uses the results of a TimelineFlow to populate an in-memory representation of the remote filesystem, referred to as the EFS. When launching, a Timeline is selected in the following precedence:

  1. A Timeline flow ID that is specified by the operator with the --initial-timline flag
  2. A Timeline flow which completed successfully on the client within the last 3 hours
  3. A new Timeline flow is launched

Note: Windows machines only have C:/ collected by default. To collect other volumes, use refresh D:/ (for example.)

Based on the need for a Timeline flow it can take a few minutes for the shell to become usable, and #3 will only work if the client is online.

Command options:

  • --username GRR username
  • --password GRR password
  • --grr-server GRR HTTP Endpoint
  • --client - The remote client. Supports FQDNs (eg. ramoj.domain.com) or GRR Client IDs (C.abcdef0123456789)
  • --initial-timeline - [Optional] Specify an existing timeline flow ID forthe host (eg, A1B2C3D4E5F6A1B2).
  • --max-file-size - [Optional] Specify a max file size for file collections. If not specified, the GRR default of 500MB is used.
  • --no-initial-timeline Start without collecting a timeline from the client. Mostly used for debugging.

Once launched, a prompt similar to the below will be presented:

GRR Shell Prompt example

The prompt displays the Client ID followed by the current working directory. Shell mode supports autocomplete of shell commands, and where appropriate, remote paths (shown here) and artefact names.

Visible in the status bar of the display is the Last seen time for the client (helpfully green if seen in the last 10 minutes, yellow up to a half hour, red for longer.) Additionally, an indicator of how many flows are running in the background, as well as the total count of flows launched is shown. Finally, the freshness of the timeline used for the Emulated FS is also displayed (coloured similarly to Last Seen).[1]

[1] As the refresh command allows for partial Timeline updates, this timestamp is the freshness of the EFS at the current working directory.

The following shell commands are supported. [] params are optional, <> are required.

  • help - Display help text (also h and ?.) Display extended help for a command with help <command>.
  • pwd - Print the current working directory.
  • ls [path] - List entries in the current working directory. [path] is optional, ./ is assumed if not specified. Wildcards * are supported in the final path component. Default sort order is alphabetical with directories first. Flags:
    • -S Sort by file size
    • -t Sort by modification time
    • -r Reverse sort order
  • cd <path> - Change working directory.
  • info <path> - Collect information for a file (also hash <path>). This is performed by a synchronous ClientFileFinder flow with the HASH option. Will display MAC times, permission info, and hashes, among other things. Supports ClientFileFinder wildcards. Optional flags:
    • --ads - Attempt Zone.Identifier alternate data stream collection (not supported with wildcards; Windows only).
    • --offline - Use the cached TimelineFlow info rather than launching a flow.* collect <path> - Collect remote files. This is performed in the background by an asynchronous ClientFileFinder flow, and so supports ClientFileFinder path wildcards. Files are downloaded to the local current working directory, named for the client ID, and remote directory structure is preserved.
  • artefact <artefact_name> (alt spelling artifact) Collect an artefact via ArtifactCollectorFlow. This is performed asynchronously in the background. Similar to collect, files are downloaded to the local current working directory, and remote directory structure is preserved.
  • flows - Fetch current state of any background flows for display. If all [count] is specified, then all flows launched on the client are listed, not just flows from this GRR Shell session.
  • detail <flow id> - Fetch and display more detailed information on a flow.
  • resume <flow id> - (Re)attach a flow to this shell session. ClientFileFinder, ArtifactCollectorFlow, and GetFile (Zone.Identifier ADS only) are supported. Resuming an asynchronous flow will download the flow results in the background. Synchronous flows will display the flow result.
  • refresh [path] - Update the emulated filesystem with a fresh TimelineFlow (synchronous). Giving an optional path sets that path as the Timeline root, which can speed up flow collection. Useful if the entire filesystem is not required to be refreshed.
  • find [dir] <regex> - Search for files matching a regex pattern. Functionally similar to bash's find <dir> | grep -P <regex>. If <dir> is not specified, ./ is assumed.
  • clear Clear the terminal screen.
  • exit Exit shell (also quit and <CTRL+D>)

Additionally, set can be used to set shell runtime values. Currently, only one such value is used:

  • max-file-size Specify a max file size for file collections. If not specified, the GRR default of 500MB is used.

collect

Use to collect a set of files from the remote client. This uses the GRR ClientFileFinder flow, and so path wildcards available to ClientFileFinder are supported.

Command options:

  • --username GRR username
  • --password GRR password
  • --grr-server GRR HTTP Endpoint
  • --client - The remote client. Supports FQDNs (eg. ramoj.domain.com) or GRR Client IDs (C.abcdef0123456789)
  • --remote-path - ClientFileFinder expression for files to collect
  • --local_path - Location to store the retrieved files

Remote file path structures are preserved on collection, so a command with --remote-path /home/ramoj/tmp/file --local-path /tmp will result in the collected file being available at /tmp/home/ramoj/tmp/file.

artefact

Alt spelling artifact.

Collect an artefact from the client.

  • --username GRR username
  • --password GRR password
  • --grr-server GRR HTTP Endpoint
  • --client - The remote client. Supports FQDNs (eg. ramoj.domain.com) or GRR Client IDs (C.abcdef0123456789)
  • --artefact - Artefact definition to collect, eg, BrowserHistory.
  • --local_path - Location to store the retrieved files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grrshell-0.1.0.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

grrshell-0.1.0-py3-none-any.whl (91.1 kB view details)

Uploaded Python 3

File details

Details for the file grrshell-0.1.0.tar.gz.

File metadata

  • Download URL: grrshell-0.1.0.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for grrshell-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfa73cb7458d82ecf60b845ec6514a3ca180fe6f62801a1996929acf03b79ffd
MD5 5139eb6c94c1145a68941e8766ea4f02
BLAKE2b-256 e53cae7d11c4b1cec7f12bc7d56fa4e4973fd9610a08e4ea2e24a0e9531c2be6

See more details on using hashes here.

File details

Details for the file grrshell-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: grrshell-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 91.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for grrshell-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39889ccab534e38dd3077cb9b3952ebca187b136cfd92a53974dfc69d01e8c21
MD5 0cf51e9775d4afec2aee722e17047f95
BLAKE2b-256 0c07cbaacd2b7c7173f407baab0d317ce9af389bbfb3ab51c8449f2d02cee34f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page