icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading DECRYPT
SHA256 checksum (decrypt_231.tgz) 45abac56131fbf722c1709a239a9e63da691e2bc0fef801f0906b2794853ff64 SHA256 checksum (decrypt_221.tgz) 4f8cb4e030d84ccc02fcb910c7e1a9e0fcac1d4247b6ac145f006aebac53b372 SHA256 checksum (decrypt_20.tgz) fe329a21ea88af829a0ecc34fe28e63393395fd25cb64dab7d48e1f11dddc6b1
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

DECRYPT

Splunk Cloud
This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
DECRYPT is a set of Splunk commands which provide Base32, Base64, XOR, ROTX, RC4 and ROL/ROR routines which are commonly used for obfuscating malware communications and data exfiltration.

These commands can be leveraged in Splunk queries by users or automation to decipher previously indexed communications.

Installation

DECRYPT is a standard Splunk App and requires no special configuration.


Usage

DECRYPT is implemented as a single search command which exposes a number of data manipulation functions. It takes the required field to manipulate and then one or more functions as arguments.

Usage: decrypt [field=<name>] FUNCTIONS...

The following example will transform the sourcetype field into its hex representation:

... | decrypt field=sourcetype hex() emit('sourcetype')

Note: Fields must be output via the emit function. The input field is not modified in place.


Arguments

field

The field argument specifies the Splunk field to use as input.

... | decrypt field="hostname" ...

If no field argument is passed then _raw will be used by default.

If a field argument is passed and the field does not exist in the current record being processed, no error or warning will be given.

FUNCTIONS

Each function passed as an argument will be executed in order, with the output of the previous function provided as input to the next.

... | decrypt field=hostname b64 xor('s\x65cr\x65t') hex emit('decrypted')

The above example can be explained as:

  • Pass the value of the hostname field to b64 as input
  • Pass the output of b64 to xor as input with the argument 's\x65cr\x65t'
  • Pass the output of xor to hex as input
  • Pass the output of hex to emit with the argument 'decrypted'

Functions

btoa()

Encodes input to a Base64 string.

b64(), atob()

Decodes a Base64 encoded string.

b32()

Decodes a Base32 encoded string.

rotx(count)

Implements Caesarian shift. The count argument specifies the amount to shift and must be an integer.

rol(count)

Implements rotate-on-left to each character within the string using an 8 bit boundary. The count argument specifies the amount to rotate and must be an integer.

ror(count)

Implements rotate-on-right to each character within the string using an 8 bit boundary. The count argument specifies the amount to rotate and must be an integer.

xor(key)

Implements basic XOR cipher against the field with the supplied key. The key can be provided as a string or integer.

rc4(key)

Implements the RC4 cipher against the field with the supplied key. The key provided must be a string.

hex()

Transforms input into its hexadecimal representation.

unhex()

Transforms hexadecimal input into its byte form.

save(name)

Saves the current state to memory as name.

load(name)

Recalls the previously saved state name from memory.

ascii()

Transforms input into ASCII output. Non-printable characters will be replaced with a period.

emit(name)

Outputs the current state as UTF-8 to the field name.

substr(offset, count)

Returns a substring of the input, starting at the index offset with the number of characters count.


Function Arguments

Strings

Strings can be specified by encapsulating values in apostrophes (single quote). Strings accept Pythonic escape sequences, so hexadecimal and octal values can be specified with \xhh and \ooo respectively.

'This is a valid string'
'This is also \x61 valid string.'

Quotation marks (double quotes) cannot be used.

"This is not a valid string"

Integers

Integers can be specified numerically or as hexadecimal representations by prefixing values with a 0x.

The value 256 could be passed as is or as its hexadecimal representation 0x100.

Field References

The value of Splunk fields can be used in function parameters by passing the field name as an argument. All referenced fields must be complete words unbroken by whitespace.

... | decrypt field=_raw xor(sourcetype) ...

The above example demonstrates passing the sourcetype field as the key to the xor function.

Fields saved using the save command can also be referenced.

... | decrypt field=_raw substr(0,1) save('1byte') substr(1, 4096) xor(1byte) ...

Style

Functions which take no arguments do not need parenthesis in order for syntax checking to pass. The following examples will pass syntax checks and execute the same.

... | decrypt field=_raw b64 hex unhex
... | decrypt field=_raw b64() hex() unhex()
... | decrypt field=_raw b64() hex unhex

New lines can be used to break up command sequences for easier readability.

... | decrypt field=_raw
      b64
      hex
      unhex

Recipes

XOR

... | decrypt field=data xor('secret') emit('result')

ROT13 cipher

... | decrypt field=data rotx(13) emit('result')

Base64 decode, XOR

... | decrypt field=data b64 xor('secret') emit('result')

Base64 decode, XOR with first byte

... | decrypt field=data
      b64
      save('bin')
      substr(0, 1) emit('key')
      load('bin')
      substr(1, 9999) xor(key) emit('result')

Brute force RC4

... | decrypt field=data
      b64
      save('orig') rc4('secret') emit('rc4-secret')
      load('orig') rc4('password') emit('rc4-password')
      load('orig') rc4('abc123') emit('rc4-abc123')
      load('orig') rc4('aabbccdd') emit('rc4-aabbccdd')

Brute force XOR key

... | decrypt field=data
      b64
      save('data') xor(0x01) emit('xor0x01')
      load('data') xor(0x02) emit('xor0x02')
      load('data') xor(0x03) emit('xor0x03')
      ...

Contributors

Shannon Davis (Splunk)

Release Notes

Version 2.3.1
Feb. 16, 2021
  • Bug fix for distributed search environments

2.3.0

  • Unicode support
  • Introduce ascii command
  • Command change to SCPv2
  • Changes to save/load command mechanics

2.2.1

  • Bug fix and minor package metadata updates

2.2

  • Addition of Base32 decoding
  • Addition of Base64 decoding alias (b64)

2.1

  • Works with Splunk 8.x
  • Bug fix to work in distributed search environments

2.0

  • Rearchitected due to a limitation with passing binary data between commands
  • Introduced SAVE/LOAD/EMIT/HEX/UNHEX functions

1.0

  • Initial release
Version 2.2.1
Oct. 19, 2020
  • Bug fix and minor package metadata updates

2.2

  • Addition of Base32 decoding
  • Addition of Base64 decoding alias (b64)

2.1

  • Works with Splunk 8.x
  • Bug fix to work in distributed search environments

2.0

  • Rearchitected due to a limitation with passing binary data between commands
  • Introduced SAVE/LOAD/EMIT/HEX/UNHEX functions

1.0

  • Initial release
Version 2.0
March 22, 2015
  • Rearchitected due to a limitation with passing binary data between commands
  • Introduced SAVE/LOAD/EMIT/HEX/UNHEX functions

Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.